File tree Expand file tree Collapse file tree 3 files changed +11
-46
lines changed Expand file tree Collapse file tree 3 files changed +11
-46
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88# $1: exercise slug
99# $2: path to solution folder
1010# $3: path to output directory
11+ # $4: [--no-build]: Don't run docker build
1112
1213# Output:
1314# Writes the test results to a results.json file in the passed-in output directory.
1718# ./bin/run-in-docker.sh two-fer path/to/solution/folder/ path/to/output/directory/
1819
1920# 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"
2225 exit 1
2326fi
2427
@@ -29,8 +32,10 @@ output_dir=$(realpath "${3%/}")
2932# Create the output directory if it doesn't exist
3033mkdir -p " ${output_dir} "
3134
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
3439
3540# Run the Docker image using the settings mimicking the production environment
3641docker run \
Original file line number Diff line number Diff line change 11#! /bin/bash -e
22
33# 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
55# solutions with an expected output.
66# The test runner Docker image is built automatically.
77
@@ -24,7 +24,7 @@ for test_dir in tests/*; do
2424 results_file_path=" ${test_dir_path} /results.json"
2525 expected_results_file_path=" ${test_dir_path} /expected_results.json"
2626
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
2828
2929 # Normalize the results file
3030 sed -i " s~${test_dir_path} ~/solution~g" " ${results_file_path} "
You can’t perform that action at this time.
0 commit comments