Skip to content

Commit 5e9dbc8

Browse files
committed
add some info on running tests
1 parent b590aef commit 5e9dbc8

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Idris Versions: `v0.5.1`, `v0.6.0`, `v0.7.0`, `latest` (Up to date with [Idris2/
2020
- [Running Locally](#running-locally)
2121
- [Build Latest](#build-latest)
2222
- [Build From a Tagged Release/SHA commit](#build-from-a-tagged-releasesha-commit)
23+
- [Running tests](#running-tests)
2324
- [Credit](#credit)
2425

2526
## Motivation
@@ -86,9 +87,13 @@ To run the images locally, I recommend opening the workspace in the Devcontainer
8687
This is the default behaviour when running the script.
8788

8889
```bash
90+
# this is the only module we need, so i chose not to create a requirements.txt file
91+
pip install -U requests
92+
8993
# builds base from latest commit on the Idris repo. Tag is base-latest
9094
python scripts/build-image.py --image base
91-
python scripts/build-image.py --image devcontainer --tag devcontainer-latest-test
95+
python scripts/build-image.py --image ubuntu
96+
python scripts/build-image.py --image devcontainer --tag devcontainer-latest
9297
```
9398

9499
### Build From a Tagged Release/SHA commit
@@ -99,6 +104,26 @@ python scripts/build-image.py --image base --sha 58e5d156621cfdd4c54df26abf7ac96
99104
python scripts/build-image.py --image devcontainer --version v0.6.0
100105
```
101106

107+
### Running tests
108+
109+
We have some tests to ensure the docker images are working as expected, using [bats](https://github.com/bats-core/bats-core). The bats CLI tool should already be installed in the devcontainer.
110+
111+
You'll need to install the `bats-support` and `bats-assert` libraries. I found the easiest way to do this was to clone via git:
112+
113+
```bash
114+
git clone https://github.com/bats-core/bats-support test/test_helper/bats-support
115+
git clone https://github.com/bats-core/bats-assert test/test_helper/bats-assert
116+
```
117+
118+
To run a test on a specific image, set the required variables, and run the bats command:
119+
120+
```bash
121+
export LIB_PATH=$(pwd)/tests/test_helper
122+
export DOCKER_IMAGE=
123+
export IDRIS_VERSION=latest
124+
bats tests/base.bats
125+
```
126+
102127
## Credit
103128

104129
* [dgellow/idris-docker-image](https://github.com/dgellow/idris-docker-image) for giving me a starting point

0 commit comments

Comments
 (0)