New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update starter files #27
Conversation
ErikSchierboom
commented
Apr 7, 2021
- Add version to output
- Update README
- Rename test directory to tests
- Update ignored files
- Update shell scripts
- Simplify TODOs
- Add sanitize option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff.
4. Build the test runner, conforming to the [Test Runner interface specification](https://github.com/exercism/docs/blob/main/building/tooling/test-runners/interface.md). | ||
- Update the files to match your track's needs. At the very least, you'll need to update `bin/run.sh`, `Dockerfile` and the test files in the `tests` directory | ||
- Tip: look for `TODO:` comments to point you towards code that need updating | ||
- Tip: look for `OPTIONAL:` comments to point you towards code that _could_ be useful | ||
|
||
Once you're happy with your test runner, [open an issue on the exercism/automated-tests repo](https://github.com/exercism/automated-tests/issues/new?assignees=&labels=&template=new-test-runner.md&title=%5BNew+Test+Runner%5D+) to request an official test runner repository for your track. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This repository has been archived by the owner. It is now read-only.
The link is a 404
3. Remove this [Exercism Test Runner Template](#exercism-test-runner-template) section from the `README.md` file | ||
4. Build the test runner, conforming to the [Test Runner interface specification](https://github.com/exercism/docs/blob/main/building/tooling/test-runners/interface.md). | ||
- Update the files to match your track's needs. At the very least, you'll need to update `bin/run.sh`, `Dockerfile` and the test files in the `tests` directory | ||
- Tip: look for `TODO:` comments to point you towards code that need updating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Tip: look for `TODO:` comments to point you towards code that need updating | |
- 💡 Tip: look for `TODO:` comments to point you towards code that need updating |
4. Build the test runner, conforming to the [Test Runner interface specification](https://github.com/exercism/docs/blob/main/building/tooling/test-runners/interface.md). | ||
- Update the files to match your track's needs. At the very least, you'll need to update `bin/run.sh`, `Dockerfile` and the test files in the `tests` directory | ||
- Tip: look for `TODO:` comments to point you towards code that need updating | ||
- Tip: look for `OPTIONAL:` comments to point you towards code that _could_ be useful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Tip: look for `OPTIONAL:` comments to point you towards code that _could_ be useful | |
- 💡 Tip: look for `OPTIONAL:` comments to point you towards code that _could_ be useful |
@@ -53,10 +46,23 @@ To run the tests to verify the behavior of the test runner, do the following: | |||
1. Open a terminal in the project's root | |||
2. Run `./bin/run-tests.sh` | |||
|
|||
These are [golden tests][golden] that compare the `results.json` generated by running the current state of the code against the "known good" `test/<test-name>/results.json`. All files created during the test run itself are discarded. | |||
These are [golden tests][golden] that compare the `results.json` generated by running the current state of the code against the "known good" `tests/<test-name>/results.json`. All files created during the test run itself are discarded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this block to:
## Verify the test runner
To test the behaviour of the test runner, do the following:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to write golden tests (snapshot tests)
, which is a common term used in a lot of languages / test libs / frameworks.
|
||
# Arguments: | ||
# $1: exercise slug | ||
# $2: **RELATIVE** path to solution folder (with trailing slash) | ||
# $3: **RELATIVE** path to output directory (with trailing slash) | ||
# $2: absolute path to solution folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing slash part is probably still important. absolute
only means it starts with a drive, mount or /
# Example: | ||
# ./bin/run-tests.sh | ||
|
||
exit_code=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exit_code=0 | |
set -euo pipefail | |
exit_code=0 |
|
||
echo "$SLUG: comparing ${OUTPUT_DIR}/results" | ||
diff "${INPUT_DIR}/results.json" "${OUTPUT_DIR}/results.json" | ||
slug="$1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slug="$1" | |
set -euo pipefail | |
slug="$1" |
# PLACEHOLDER - Insert call to run your language tests here | ||
# Arguments: | ||
# $1: exercise slug | ||
# $2: absolute path to solution folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing slash part is probably still important. absolute
only means it starts with a drive, mount or /