diff options
-rw-r--r-- | shell/test/EXPRESSIONS | 9 | ||||
-rw-r--r-- | shell/test/RULES | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/shell/test/EXPRESSIONS b/shell/test/EXPRESSIONS index 2a99876..6d163f3 100644 --- a/shell/test/EXPRESSIONS +++ b/shell/test/EXPRESSIONS @@ -1,5 +1,5 @@ { "test-action": - { "vars": ["name", "test.sh", "ATTEMPT"] + { "vars": ["name", "test.sh", "ATTEMPT", "TEST_ENV"] , "imports": { "artifacts_list": ["./", "../..", "field_artifacts_list"] , "runfiles_list": ["./", "../..", "field_runfiles_list"] @@ -103,6 +103,9 @@ , "$1": [["./runner"], {"type": "FIELD", "name": "keep"}] } ] + , [ "test_env" + , {"type": "var", "name": "TEST_ENV", "default": {"type": "empty_map"}} + ] ] , "body": { "type": "if" @@ -113,6 +116,7 @@ , "outs": {"type": "var", "name": "outs"} , "inputs": {"type": "var", "name": "inputs"} , "cmd": {"type": "var", "name": "cmd"} + , "env": {"type": "var", "name": "test_env"} , "may_fail": ["test"] , "fail_message": { "type": "join" @@ -124,6 +128,7 @@ , "outs": {"type": "var", "name": "outs"} , "inputs": {"type": "var", "name": "inputs"} , "cmd": {"type": "var", "name": "cmd"} + , "env": {"type": "var", "name": "test_env"} , "may_fail": ["test"] , "no_cache": ["test"] , "fail_message": @@ -141,7 +146,7 @@ } } , "test-result": - { "vars": ["name", "test.sh"] + { "vars": ["name", "test.sh", "TEST_ENV"] , "imports": {"action": "test-action"} , "expression": { "type": "let*" diff --git a/shell/test/RULES b/shell/test/RULES index 74a0b78..c4beec4 100644 --- a/shell/test/RULES +++ b/shell/test/RULES @@ -2,7 +2,7 @@ { "doc": ["Shell test, given by a test script"] , "target_fields": ["deps", "test"] , "string_fields": ["keep", "name"] - , "config_vars": ["RUNS_PER_TEST"] + , "config_vars": ["RUNS_PER_TEST", "TEST_ENV"] , "field_doc": { "test": ["The shell script for the test, launched with sh"] , "name": @@ -24,6 +24,7 @@ [ "The number of times the test should be run in order to detect flakyness." , "If set, no test action will be taken from cache." ] + , "TEST_ENV": ["The environment for executing the test runner."] } , "tainted": ["test"] , "artifacts_doc": |