Skip to content
Merged
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
12 changes: 8 additions & 4 deletions bin/verify-exercises-in-docker
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ copy_example_or_exemplar_to_solution() {

pull_docker_image() {
# shellcheck disable=SC1083
docker pull exercism/{{SLUG}}-test-runner ||
die $'Could not find the `exercism/{{SLUG}}-test-runner` Docker image.\nCheck the test runner docs at https://exercism.org/docs/building/tooling/test-runners for more information.'
docker pull exercism/vimscript-test-runner ||
die $'Could not find the `exercism/vimscript-test-runner` Docker image.\nCheck the test runner docs at https://exercism.org/docs/building/tooling/test-runners for more information.'
}

run_tests() {
Expand All @@ -47,10 +47,14 @@ run_tests() {
--mount type=bind,src="${PWD}",dst=/solution \
--mount type=bind,src="${PWD}",dst=/output \
--mount type=tmpfs,dst=/tmp \
exercism/{{SLUG}}-test-runner "${slug}" /solution /output
exercism/vimscript-test-runner "${slug}" /solution /output
jq -e '.status == "pass"' "${PWD}/results.json" >/dev/null 2>&1
}

print_failure() {
jq -r '.message // ""' "${PWD}/results.json"
}

verify_exercise() {
local dir
local slug
Expand All @@ -67,7 +71,7 @@ verify_exercise() {
cd "${tmp_dir}"

copy_example_or_exemplar_to_solution
run_tests "${slug}"
run_tests "${slug}" || { print_failure; exit 1; }
)
}

Expand Down