File tree 3 files changed +11
-46
lines changed
3 files changed +11
-46
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 8
8
# $1: exercise slug
9
9
# $2: path to solution folder
10
10
# $3: path to output directory
11
+ # $4: [--no-build]: Don't run docker build
11
12
12
13
# Output:
13
14
# Writes the test results to a results.json file in the passed-in output directory.
17
18
# ./bin/run-in-docker.sh two-fer path/to/solution/folder/ path/to/output/directory/
18
19
19
20
# If any required arguments is missing, print the usage and exit
20
- if [ -z " $1 " ] || [ -z " $2 " ] || [ -z " $3 " ]; then
21
- echo " usage: ./bin/run-in-docker.sh exercise-slug path/to/solution/folder/ path/to/output/directory/"
21
+ if [ -z " $1 " ] || [ -z " $2 " ] || [ -z " $3 " ] || [ " ${4:- --no-build} " != " --no-build" ]; then
22
+ echo " usage: ./bin/run-in-docker.sh exercise-slug path/to/solution/folder/ path/to/output/directory/ [--no-build]"
23
+ echo " All arguments are positional, including the optional --no-build flag"
24
+ echo " Pass in --no-build as fourth argument to stop the Docker build from running"
22
25
exit 1
23
26
fi
24
27
@@ -29,8 +32,10 @@ output_dir=$(realpath "${3%/}")
29
32
# Create the output directory if it doesn't exist
30
33
mkdir -p " ${output_dir} "
31
34
32
- # Build the Docker image
33
- bin/build-crac-checkpoint-image.sh
35
+ if [ " $4 " != " --no-build" ]; then
36
+ # Build the Docker image
37
+ bin/build-crac-checkpoint-image.sh
38
+ fi
34
39
35
40
# Run the Docker image using the settings mimicking the production environment
36
41
docker run \
Original file line number Diff line number Diff line change 1
1
#! /bin/bash -e
2
2
3
3
# Synopsis:
4
- # Test the test runner Docker image by running it against a predefined set of
4
+ # Test the test runner Docker image by running it against a predefined set of
5
5
# solutions with an expected output.
6
6
# The test runner Docker image is built automatically.
7
7
@@ -24,7 +24,7 @@ for test_dir in tests/*; do
24
24
results_file_path=" ${test_dir_path} /results.json"
25
25
expected_results_file_path=" ${test_dir_path} /expected_results.json"
26
26
27
- bin/run-in-docker-without-build .sh " ${test_dir_name} " " ${test_dir_path} " " ${test_dir_path} "
27
+ bin/run-in-docker.sh " ${test_dir_name} " " ${test_dir_path} " " ${test_dir_path} " --no-build
28
28
29
29
# Normalize the results file
30
30
sed -i " s~${test_dir_path} ~/solution~g" " ${results_file_path} "
You can’t perform that action at this time.
0 commit comments