Skip to content

Commit

Permalink
Add more
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Aug 13, 2024
1 parent 1ba0621 commit 6c9b4e0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions building/tooling/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,12 @@ This means building the Docker image and then running the built image on a solut
#### Use golden tests

Integration tests should be defined as [golden tests](https://ro-che.info/articles/2017-12-04-golden-tests), which are tests where the expected output is stored in a file.
This is perfect for tooling integration tests, as the output of tooling are also files.
This is perfect for track-tooling integration tests, as the output of tooling are also files.

For example, the test runner
which 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.
##### Example: test runner

```exercism/note
When you've made modifications to the code that will result in a new "golden" state, you'll need to update the affected `tests/<test-name>/expected_results.json` file(s).
```
When running the test runner on a solution, its output is a `results.json` file.
We can then compare this file against a "known good" (i.e. "expected") output file (named `expected_results.json`) to check if the test runner works as intended.

## Safety

Expand Down

0 comments on commit 6c9b4e0

Please sign in to comment.