summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-10-14 18:35:58 +0300
committerLars Wirzenius <liw@liw.fi>2017-10-14 18:35:58 +0300
commit4c5bfc6aae6bf4e608a5e675be075bc37b910b53 (patch)
tree91aa05ad0f8201b92a2072b2533775a3cef114c5 /check
parent5480d64352e1f5b7fbc61d48b7d8e1156253fc97 (diff)
downloadick2-4c5bfc6aae6bf4e608a5e675be075bc37b910b53.tar.gz
Add: run yarns against locallly started instance, or remote
Diffstat (limited to 'check')
-rwxr-xr-xcheck70
1 files changed, 54 insertions, 16 deletions
diff --git a/check b/check
index 1cca3c1..165142b 100755
--- a/check
+++ b/check
@@ -30,37 +30,75 @@ title()
}
-title Unit tests
-python3 -m CoverageTestRunner --ignore-missing-from=without-tests ick2
+title Remote or local yarns?
+remote=no
+if [ "$#" -gt 0 ]
+then
+ case "$1" in
+ https://*)
+ remote=yes
+ remote_url="$1"
+ shift 1
+ ;;
+ local)
+ remote=no
+ shift 1
+ ;;
+ *)
+ echo "Don't understand args: $@" 1>&2
+ exit 1
+ ;;
+ esac
+fi
+if [ "$remote" = no ]
+then
+ echo "Run yarns against a locally managed instance"
+else
+ echo "Run yarns against remote instance $remote_url"
+fi
-if [ -e .git ]
+if [ "$remote" = no ]
then
- sources="$(git ls-files | grep -Fvxf copyright-exceptions)"
+ title Unit tests
+ python3 -m CoverageTestRunner --ignore-missing-from=without-tests ick2
- title Copyright statements
- copyright-statement-lint $sources
+ if [ -e .git ]
+ then
+ sources="$(git ls-files | grep -Fvxf copyright-exceptions)"
- title Copyright licences
- ./is-agpl3+ $sources
-fi
+ title Copyright statements
+ copyright-statement-lint $sources
-python_sources="ick_controller.py worker_manager ick2"
+ title Copyright licences
+ ./is-agpl3+ $sources
+ fi
-title pycodestyle
-pycodestyle ick2 $python_sources
+ python_sources="ick_controller.py worker_manager ick2"
-title pylint
-pylint3 --rcfile pylint.conf $python_sources
+ title pycodestyle
+ pycodestyle ick2 $python_sources
+
+ title pylint
+ pylint3 --rcfile pylint.conf $python_sources
+fi
title Yarns
-yarn yarns/*.yarn \
+if [ "$remote" = no ]
+then
+ impl=yarns/900-local.yarn
+ args=""
+else
+ impl=yarns/900-remote.yarn
+ args="--env ICK_URL=$remote_url"
+fi
+yarn yarns/[^9]*.yarn yarns/900-implements.yarn "$impl" \
--shell python2 \
--shell-arg '' \
--shell-library yarns/lib.py \
--cd-datadir \
+ $args \
"$@"
-
title OK
echo "All tests pass"