Add verify-exercises-in-docker script#361
Conversation
|
Hello 👋 Thanks for your PR. This repo does not currently have dedicated maintainers. Our cross-track maintainers team will attempt to review and merge your PR, but it will likely take longer for your PR to be reviewed. If you enjoy contributing to Exercism and have a track-record of doing so successfully, you might like to become an Exercism maintainer for this track. Please feel free to ask any questions, or chat to us about anything to do with this PR or the reviewing process on the Exercism forum. (cc @exercism/cross-track-maintainers) |
| cd "${tmp_dir}" | ||
|
|
||
| splice_example_with_tests | ||
| run_tests "${slug}" || { cat "${PWD}/results.json"; exit 1; } |
There was a problem hiding this comment.
Prefer return to exit where viable
| count=0 | ||
| for exercise_dir in ./exercises/{concept,practice}/${exercise_slug}/; do | ||
| if [[ -d "${exercise_dir}" ]]; then | ||
| verify_exercise "${exercise_dir}" | ||
| ((++count)) | ||
| fi | ||
| done | ||
| ((count > 0)) || die 'no matching exercises found!' |
There was a problem hiding this comment.
| count=0 | |
| for exercise_dir in ./exercises/{concept,practice}/${exercise_slug}/; do | |
| if [[ -d "${exercise_dir}" ]]; then | |
| verify_exercise "${exercise_dir}" | |
| ((++count)) | |
| fi | |
| done | |
| ((count > 0)) || die 'no matching exercises found!' | |
| exercises=(./exercises/{concept,practice}/${exercise_slug}/) | |
| (( "${#exercises[@]}" == 0 )) && die 'no matching exercises found!' | |
| for exercise_dir in "${exercises[@]}"; do | |
| verify_exercise "${exercise_dir}" | |
| done |
There was a problem hiding this comment.
I have kept the count variable.
We want to report 'no matching exercises found!' when the user mistypes an exercise slug.
There was a problem hiding this comment.
FWIW I used this file as a base to build a Go verify-in-docker script: https://github.com/IsaacG/fork-exercism-go/blob/main/bin/verify-exercises-in-docker
Feel free to copy anything you like in there :)
2dba53c to
45d4fcd
Compare
This useful script from generic-track tests exercise(s) against the test runner.
Like bin/test-exercise,
we splice the exercise's example solution with the unittest block from the source.