Skip to content

Commit 39e13f6

Browse files
authored
Add testscript tests for config env vars (#643)
## Summary TSIA ## How was it tested? ``` go test ./testscripts/testscripts_test.go ```
1 parent 35752b3 commit 39e13f6

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

testscripts/run/env.test.txt

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exec devbox init
1+
# Tests related to setting the environment for devbox run.
22

33
# Random vars should not leak into the run environment
44
env FOO=bar
@@ -24,4 +24,24 @@ env DEVBOX_FOO=baz
2424
exec devbox run echo '$DEVBOX_FOO'
2525
stdout 'baz'
2626

27-
# TODO: test order/overwriting of variables
27+
# Vars defined in devbox.json are passed through
28+
env DEVBOX_FEATURE_ENV_CONFIG=1
29+
exec devbox run echo '$CONFIG_VAR1'
30+
stdout 'abc'
31+
32+
# Vars defined in devbox.json that reference another variable are set
33+
env DEVBOX_FEATURE_ENV_CONFIG=1
34+
env DEVBOX_FOO=baz
35+
exec devbox run echo '$CONFIG_VAR2'
36+
stdout 'baz'
37+
38+
# TODO: test order/overwriting of variables
39+
40+
-- devbox.json --
41+
{
42+
"packages": [],
43+
"env": {
44+
"CONFIG_VAR1": "abc",
45+
"CONFIG_VAR2": "$DEVBOX_FOO"
46+
}
47+
}

0 commit comments

Comments
 (0)