Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ COPY --from=builder /TestRunner/.build/release/TestRunner bin/
COPY --from=builder /opt/test-runner/.build .build
COPY --from=builder /opt/test-runner/Package.resolved Package.resolved

ENV RUN_IN_DOCKER=TRUE

ENTRYPOINT ["./bin/run.sh"]
2 changes: 1 addition & 1 deletion bin/benchmark-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ CURRENT_PATH=${PWD}

hyperfine \
--parameter-list slug $(find tests -maxdepth 1 -mindepth 1 -type d -printf '%f\n' | paste -sd ",") \
"SKIP_DOCKER_BUILD=true bin/run-in-docker.sh {slug} $CURRENT_PATH/tests/{slug} $CURRENT_PATH/tests/{slug}"
"bin/run-in-docker.sh {slug} $CURRENT_PATH/tests/{slug} $CURRENT_PATH/tests/{slug}"
1 change: 0 additions & 1 deletion bin/run-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ docker run \
--mount type=bind,src="${INPUT_DIR}",dst=/solution \
--mount type=bind,src="${OUTPUT_DIR}",dst=/output \
--mount type=volume,dst=/tmp \
-e RUN_IN_DOCKER=TRUE \
exercism/swift-test-runner $SLUG /solution/ /output/
1 change: 0 additions & 1 deletion bin/run-tests-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ for test_dir in tests/*; do
--mount type=volume,dst=/tmp \
--workdir "${work_dir}" \
--entrypoint ${work_dir}/bin/run-test.sh \
-e RUN_IN_DOCKER=TRUE \
exercism/swift-test-runner \
"${dst_test_dir}"

Expand Down
8 changes: 6 additions & 2 deletions bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ SLUG="$1"
INPUT_DIR="${2%/}"
OUTPUT_DIR="${3%/}"

WORKING_DIR="${PWD}"
cp -r "${INPUT_DIR}/." "${WORKING_DIR}"
if [[ "${RUN_IN_DOCKER}" == "TRUE" ]]; then
WORKING_DIR="${PWD}"
cp -r "${INPUT_DIR}/." "${WORKING_DIR}"
else
WORKING_DIR=${INPUT_DIR}
fi

junit_file="${WORKING_DIR}/results-swift-testing.xml"
spec_file="${WORKING_DIR}/$(jq -r '.files.test[0]' ${WORKING_DIR}/.meta/config.json)"
Expand Down