File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717# ./bin/run-in-docker.sh two-fer /absolute/path/to/two-fer/solution/folder/ /absolute/path/to/output/directory/
1818
1919# If any required arguments is missing, print the usage and exit
20- if [ -z " $1 " ] || [ -z " $2 " ] || [ -z " $3 " ] ; then
20+ if (( $# != 3 )) ; then
2121 echo " usage: ./bin/run-in-docker.sh exercise-slug /absolute/path/to/solution/folder/ /absolute/path/to/output/directory/"
2222 exit 1
2323fi
Original file line number Diff line number Diff line change 1- #! /usr/bin/env sh
1+ #! /usr/bin/env bash
22
33# Synopsis:
44# Test the test runner Docker image by running it against a predefined set of
@@ -21,12 +21,10 @@ docker build --rm -t exercism/go-test-runner .
2121# TODO: allow image to work with --read-only filesystem
2222
2323# Run the Docker image using the settings mimicking the production environment
24- docker run \
25- --rm \
26- --network none \
27- --mount type=bind,src=" ${PWD} /tests" ,dst=/opt/test-runner/tests \
28- --mount type=volume,dst=/tmp \
29- --volume " ${PWD} /bin/run-tests.sh:/opt/test-runner/bin/run-tests.sh" \
30- --workdir /opt/test-runner \
31- --entrypoint /opt/test-runner/bin/run-tests.sh \
32- exercism/go-test-runner
24+ args=(--rm --network none)
25+ args+=( --mount type=bind,src=" ${PWD} /tests" ,dst=/opt/test-runner/tests )
26+ args+=( --mount type=volume,dst=/tmp )
27+ args+=( --volume " ${PWD} /bin/run-tests.sh:/opt/test-runner/bin/run-tests.sh" )
28+ args+=( --workdir /opt/test-runner )
29+ args+=( --entrypoint /opt/test-runner/bin/run-tests.sh )
30+ docker run " ${args[@]} " exercism/go-test-runner
Original file line number Diff line number Diff line change 1- #! /usr/bin/env sh
1+ #! /usr/bin/env bash
22
33# Synopsis:
44# Test the test runner by running it against a predefined set of solutions
@@ -37,9 +37,9 @@ for test_dir in tests/*; do
3737 echo " ${test_dir_name} : comparing results.json to expected_results.json"
3838 diff " ${results_file_path} " " ${expected_results_file_path} "
3939
40- if [ $? -ne 0 ] ; then
40+ if (( $? != 0 )) ; then
4141 exit_code=1
4242 fi
4343done
4444
45- exit ${exit_code}
45+ exit " ${exit_code} "
Original file line number Diff line number Diff line change 1010# ./run.sh two-fer twofer outdir
1111
1212cd " $2 " || exit
13- /opt/test-runner/bin/test-runner $2 $3
13+ /opt/test-runner/bin/test-runner " $2 " " $3 "
You can’t perform that action at this time.
0 commit comments