Skip to content

Commit

Permalink
test(cram): expansion bug in the cram stanza (#10202)
Browse files Browse the repository at this point in the history
The expansion is done in the context of the tests rather than the cram
stanza.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Mar 3, 2024
1 parent ec3d22c commit 91f6b39
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/blackbox-tests/test-cases/cram/enabled_if-expansion.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Expansion of enabled_if in the cram stanza

$ cat >dune-project <<EOF
> (lang dune 3.14)
> EOF
We define a test that is disabled by default but can be turned using the FOO
env var.
$ cat >dune <<EOF
> (cram
> (applies_to :whole_subtree)
> (enabled_if %{env:FOO=false}))
> EOF
$ mkdir sub
We set the FOO env var in the sub directory of the test, but this shouldn't
have an effect because environment variable should be expanded where the cram
stanza was defined.
$ cat >sub/dune <<EOF
> (env
> (_
> (env-vars (FOO true))))
> EOF
$ cat >sub/foo.t <<EOF
> $ echo should be disabled
> EOF
$ dune runtest
File "sub/foo.t", line 1, characters 0-0:
Error: Files _build/default/sub/foo.t and _build/default/sub/foo.t.corrected
differ.
[1]

0 comments on commit 91f6b39

Please sign in to comment.