Skip to content

Add track test instructions #101

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
36 changes: 28 additions & 8 deletions docs/TESTS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
# Tests

<!-- TODO: write document
## Installing the Exercism GDScript track test runner

This document should describe everything related to running tests in the track.
You'll need [Godot installed][installation] correctly to use the test runner.

If your track uses skipped tests, this document can explain why thet is used and
how to unskip tests.
To build and test GDScript scripts for Exercism, Godot will be run in "headless" mode from the CLI.
These instructions currently require Linux and bash.

This document can also link to the testing framework documentation.
### Step 1: Installing the overall test runner infrastructure

The contents of this document are displayed on the track's documentation
page at `https://exercism.org/docs/tracks/<track>/tests`.
To set up for testing, clone [https://github.com/exercism/gdscript-test-runner][gdscript-test-runner] and move its contents to `/opt/exercism/gdscript/test-runner/`:

See https://exercism.org/docs/building/tracks/docs for more information. -->
```sh
git clone https://github.com/exercism/gdscript-test-runner.git
sudo mkdir -p /opt/exercism/gdscript/
sudo mv gdscript-test-runner/ /opt/exercism/gdscript/test-runner/
```

### Step 2: Downloading the single-exercise test runner script

Assuming you have the `exercism` tool set up and have downloaded at least one GDScript exercise, it should have created an `exercism/gdscript` folder to house the exercises.
Save [the test runner][test-local-gdscript-solution] in this folder and mark the file executable.

## Running tests

With the installation steps done, you should be able start from any exercise directory (e.g., `~/exercism/gdscript/two-fer`) and run the script (living one level up, in `../`) to test your local solution to that exercise:

```sh
../test-local-gdscript-solution.sh
```

[installation]: https://exercism.org/docs/tracks/gdscript/installation
[gdscript-test-runner]: https://github.com/exercism/gdscript-test-runner
[test-local-gdscript-solution]: https://raw.githubusercontent.com/exercism/gdscript-test-runner/refs/heads/main/bin/test-local-gdscript-solution.sh
20 changes: 12 additions & 8 deletions exercises/shared/.docs/tests.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Tests

<!-- TODO: write document
## Running tests

This document should contain instructions on how to run the exercise's tests.
With the [installation steps][test-installation-steps] done, you should be able start from any exercise directory (e.g., `~/exercism/gdscript/two-fer`) and run the script (living one level up, in `../`) to test your local solution to that exercise:

The instructions should be short and to the point.
```sh
../test-local-gdscript-solution.sh
```

The docs/TESTS.md file can contain a more verbose description on how to run tests.
## Solving an exercise

When a student downloads an exercise via the CLI, this file's contents are
included into the HELP.md file.
Solving an exercise means making all its tests pass.

See https://exercism.org/docs/building/tracks/shared-files for more information.
-->
To help you get started, each exercise comes with a GDScript file named after the exercise (e.g., `exercism/gdscript/two-fer/two_fer.gd`).
You can use this file as a starting point for building your solution.
Feel free to change it as needed, but the tests expect the function names to be as originally provided.

[test-installation-steps]: https://exercism.org/docs/tracks/gdscript/tests