File tree 2 files changed +17
-15
lines changed
2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 1
- #! /usr/bin/env bash
1
+ #! /usr/bin/env sh
2
+
2
3
set -eu
3
4
unset CDPATH
4
- cd " $( dirname " ${BASH_SOURCE[0]} " ) /../.."
5
+ cd " $( dirname " $0 " ) /../.."
5
6
6
7
7
- function usage() {
8
+ usage () {
8
9
cat >&2 << EOF
9
10
Build scitran-core image and run tests in a docker container
10
11
20
21
}
21
22
22
23
23
- function main() {
24
+ main () {
24
25
local DOCKER_BUILD=true
25
26
local TEST_ARGS=
26
27
27
- while [[ " $# " > 0 ] ]; do
28
+ while [ $# -gt 0 ]; do
28
29
case " $1 " in
29
30
-B|--no-build) DOCKER_BUILD=false; ;;
30
31
-h|--help) usage; exit 0 ;;
@@ -56,14 +57,14 @@ function main() {
56
57
-e SCITRAN_PERSISTENT_DB_URI=mongodb://scitran-core-test-mongo:27017/scitran \
57
58
-e SCITRAN_PERSISTENT_DB_LOG_URI=mongodb://scitran-core-test-mongo:27017/logs \
58
59
-v $( pwd) :/var/scitran/code/api \
59
- --entrypoint bash \
60
+ --entrypoint sh \
60
61
scitran-core:run-tests \
61
62
/var/scitran/code/api/tests/bin/run-tests-ubuntu.sh \
62
63
$TEST_ARGS
63
64
}
64
65
65
66
66
- function clean_up() {
67
+ clean_up () {
67
68
local TEST_RESULT_CODE=$?
68
69
set +e
69
70
Original file line number Diff line number Diff line change 1
- #! /usr/bin/env bash
1
+ #! /usr/bin/env sh
2
+
2
3
set -eu
3
4
unset CDPATH
4
- cd " $( dirname " ${BASH_SOURCE[0]} " ) /../.."
5
+ cd " $( dirname " $0 " ) /../.."
5
6
6
7
7
- function usage() {
8
+ usage () {
8
9
cat >&2 << EOF
9
10
Run scitran-core tests
10
11
35
36
}
36
37
37
38
38
- function main() {
39
+ main () {
39
40
export RUN_ALL=true
40
41
local RUN_LINT=false
41
42
local RUN_UNIT=false
42
43
local RUN_INTEG=false
43
44
local RUN_ABAO=false
44
45
local PYTEST_ARGS=
45
46
46
- while [[ " $# " > 0 ] ]; do
47
+ while [ $# -gt 0 ]; do
47
48
case " $1 " in
48
49
-l|--lint) RUN_ALL=false; RUN_LINT=true ;;
49
50
-u|--unit) RUN_ALL=false; RUN_UNIT=true ;;
@@ -82,7 +83,7 @@ function main() {
82
83
export SCITRAN_PERSISTENT_DB_LOG_URI=${SCITRAN_PERSISTENT_DB_LOG_URI:- " mongodb://localhost:$SCITRAN_PERSISTENT_DB_PORT /logs" }
83
84
export SCITRAN_PERSISTENT_PATH=` mktemp -d`
84
85
export SCITRAN_PERSISTENT_DATA_PATH=" $SCITRAN_PERSISTENT_PATH /data"
85
- export SCITRAN_CORE_DRONE_SECRET=${SCITRAN_CORE_DRONE_SECRET:- $( openssl rand -base64 32 ) }
86
+ export SCITRAN_CORE_DRONE_SECRET=${SCITRAN_CORE_DRONE_SECRET:- T+27oHSKw+WQqT / rre+iaiIY4vNzav / fPStHqW / Eczk= }
86
87
87
88
if ${RUN_LINT} ; then
88
89
echo " Running pylint ..."
@@ -158,14 +159,14 @@ function main() {
158
159
}
159
160
160
161
161
- function clean_up () {
162
+ clean_up () {
162
163
local TEST_RESULT_CODE=$?
163
164
set +e
164
165
165
166
echo
166
167
echo " Test return code = $TEST_RESULT_CODE "
167
168
168
- if [[ -n " ${API_PID:- } " ] ]; then
169
+ if [ " ${API_PID:- } " ]; then
169
170
# Killing uwsgi
170
171
kill $API_PID
171
172
wait 2> /dev/null
You can’t perform that action at this time.
0 commit comments