Skip to content

Commit ed4608c

Browse files
committed
Check more environment variables
1 parent 668f1e6 commit ed4608c

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

tests/base.bats

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ function setup() {
3939
refute_output --partial "Uncaught error:"
4040
}
4141

42-
@test "IDRIS_SHA should be set" {
42+
@test "Check environment variables" {
4343
# make sure IDRIS_SHA is set
4444
# https://bats-core.readthedocs.io/en/stable/writing-tests.html#run-test-other-commands
4545
# expects the cmd to return 0
4646
if [[ $IDRIS_VERSION != "latest" ]]; then
47-
skip "IDRIS_VERSION is not latest"
47+
# For versions that are not latest, IDRIS_VERSION should be set
48+
docker run $DOCKER_IMAGE bash -c "if [[ -z \$IDRIS_VERSION ]]; then exit 1; else exit 0; fi"
49+
else
50+
# For latest, IDRIS_SHA should be set
51+
docker run $DOCKER_IMAGE bash -c "if [[ -z \$IDRIS_SHA ]]; then exit 1; else exit 0; fi"
4852
fi
49-
50-
docker run $DOCKER_IMAGE bash -c "if [[ -z \$IDRIS_SHA ]]; then exit 1; else exit 0; fi"
5153
}

tests/consumer-idris.bats

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,17 @@ function setup() {
3636
# the ENTRYPOINT is already the `idris2` command, so we just `docker run` without any other stuff
3737
run docker run $DOCKER_IMAGE
3838
refute_output --partial "Uncaught error:"
39+
}
40+
41+
@test "Check environment variables" {
42+
# make sure IDRIS_SHA is set
43+
# https://bats-core.readthedocs.io/en/stable/writing-tests.html#run-test-other-commands
44+
# expects the cmd to return 0
45+
if [[ $IDRIS_VERSION != "latest" ]]; then
46+
# For versions that are not latest, IDRIS_VERSION should be set
47+
docker run $DOCKER_IMAGE bash -c "if [[ -z \$IDRIS_VERSION ]]; then exit 1; else exit 0; fi"
48+
else
49+
# For latest, IDRIS_SHA should be set
50+
docker run $DOCKER_IMAGE bash -c "if [[ -z \$IDRIS_SHA ]]; then exit 1; else exit 0; fi"
51+
fi
3952
}

tests/devcontainer-idris.bats

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,17 @@ function setup() {
3535

3636
run docker run $DOCKER_IMAGE idris2
3737
refute_output --partial "Uncaught error:"
38+
}
39+
40+
@test "Check environment variables" {
41+
# make sure IDRIS_SHA is set
42+
# https://bats-core.readthedocs.io/en/stable/writing-tests.html#run-test-other-commands
43+
# expects the cmd to return 0
44+
if [[ $IDRIS_VERSION != "latest" ]]; then
45+
# For versions that are not latest, IDRIS_VERSION should be set
46+
docker run $DOCKER_IMAGE bash -c "if [[ -z \$IDRIS_LSP_VERSION ]]; then exit 1; else exit 0; fi"
47+
else
48+
# For latest, IDRIS_SHA should be set
49+
docker run $DOCKER_IMAGE bash -c "if [[ -z \$IDRIS_LSP_SHA ]]; then exit 1; else exit 0; fi"
50+
fi
3851
}

0 commit comments

Comments
 (0)