You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* initial test-runner, with tests
* add script to validate moonscript track in docker
* Ryan's review comments
* additional cleanup
* bin/run.sh not needed
* typo
* updating the verify scripts in the moonscript track; found a missing luarock
* shrink the test-runner image size
Copy file name to clipboardExpand all lines: README.md
+10-18Lines changed: 10 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,24 +2,14 @@
2
2
3
3
The Docker image to automatically run tests on MoonScript solutions submitted to [Exercism].
4
4
5
-
## Getting started
6
-
7
-
Build the test runner, conforming to the [Test Runner interface specification](https://github.com/exercism/docs/blob/main/building/tooling/test-runners/interface.md).
8
-
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 solutions in the `tests` directory
9
-
10
-
- Tip: look for `TODO:` comments to point you towards code that need updating
11
-
- Tip: look for `OPTIONAL:` comments to point you towards code that _could_ be useful
12
-
- Tip: if it proves impossible for the Docker image to work on a read-only filesystem, remove the `--read-only` flag from the `bin/run-in-docker.sh` and `bin/run-tests-in-docker.sh` files.
13
-
We don't yet enforce a read-only file system in production, but we might in the future!
14
-
15
5
## Run the test runner
16
6
17
7
To run the tests of a single solution, do the following:
18
8
19
9
1. Open a terminal in the project's root
20
-
2. Run `./bin/run.sh <exercise-slug> <solution-dir> <output-dir>`
10
+
2. Run `bin/run.moon ${exercise_slug} ${solution_dir} ${output_dir}`
21
11
22
-
Once the test runner has finished, its results will be written to `<output-dir>/results.json`.
12
+
Once the test runner has finished, its results will be written to `${output_dir}/results.json`.
23
13
24
14
## Run the test runner on a solution using Docker
25
15
@@ -28,9 +18,9 @@ _This script is provided for testing purposes, as it mimics how test runners run
28
18
To run the tests of a single solution using the Docker image, do the following:
29
19
30
20
1. Open a terminal in the project's root
31
-
2. Run `./bin/run-in-docker.sh <exercise-slug> <solution-dir> <output-dir>`
21
+
2. Run `./bin/run-in-docker.sh ${exercise_slug} ${solution_dir} ${output_dir}`
32
22
33
-
Once the test runner has finished, its results will be written to `<output-dir>/results.json`.
23
+
Once the test runner has finished, its results will be written to `${output_dir}/results.json`.
34
24
35
25
## Run the tests
36
26
@@ -39,9 +29,9 @@ To run the tests to verify the behavior of the test runner, do the following:
39
29
1. Open a terminal in the project's root
40
30
2. Run `./bin/run-tests.sh`
41
31
42
-
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>/expected_results.json`. All files created during the test run itself are discarded.
32
+
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}/expected_results.json`. All files created during the test run itself are discarded.
43
33
44
-
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).
34
+
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).
45
35
46
36
## Run the tests using Docker
47
37
@@ -52,12 +42,14 @@ To run the tests to verify the behavior of the test runner using the Docker imag
52
42
1. Open a terminal in the project's root
53
43
2. Run `./bin/run-tests-in-docker.sh`
54
44
55
-
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>/expected_results.json`. All files created during the test run itself are discarded.
45
+
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}/expected_results.json`. All files created during the test run itself are discarded.
56
46
57
-
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).
47
+
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).
58
48
59
49
## Benchmarking
60
50
51
+
**_NOTE: not implemented_**
52
+
61
53
There are two scripts you can use to benchmark the test runner:
62
54
63
55
1.`./bin/benchmark.sh`: benchmark the test runner code
Copy file name to clipboardExpand all lines: bin/run-in-docker.sh
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,25 @@
1
1
#!/usr/bin/env sh
2
+
set -e
2
3
3
4
# Synopsis:
4
5
# Run the test runner on a solution using the test runner Docker image.
5
6
# The test runner Docker image is built automatically.
6
7
7
8
# Arguments:
8
9
# $1: exercise slug
9
-
# $2: path to solution folder
10
-
# $3: path to output directory
10
+
# $2: absolute path to solution folder
11
+
# $3: absolute path to output directory
11
12
12
13
# Output:
13
14
# Writes the test results to a results.json file in the passed-in output directory.
14
15
# The test results are formatted according to the specifications at https://github.com/exercism/docs/blob/main/building/tooling/test-runners/interface.md
0 commit comments