summaryrefslogtreecommitdiff
path: root/tests/integration/shell.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-06 21:04:32 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-06 21:20:27 +0900
commitbe6b5564595872c9e6ff54c3d812be1061c0837d (patch)
tree4abbf2b373a26703aec748769e90c0e549194a78 /tests/integration/shell.py
parentf8a71cabb009e04dc8deee8c1244ab75e06420a2 (diff)
downloadbuildstream-be6b5564595872c9e6ff54c3d812be1061c0837d.tar.gz
Removing all traces of `environment-inherit` shell configuration.
This is made redundant by the more complete `environment` configuration, so lets quickly remove the former in this new format version 4.
Diffstat (limited to 'tests/integration/shell.py')
-rw-r--r--tests/integration/shell.py34
1 files changed, 7 insertions, 27 deletions
diff --git a/tests/integration/shell.py b/tests/integration/shell.py
index 49a97a6d0..e2a4740bf 100644
--- a/tests/integration/shell.py
+++ b/tests/integration/shell.py
@@ -65,26 +65,6 @@ def test_executable(cli, tmpdir, datafiles):
assert result.output == "Horseys!\n"
-# Test host environment variable inheritance
-@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
-@pytest.mark.datafiles(DATA_DIR)
-def test_env_inherit(cli, tmpdir, datafiles, animal):
- project = os.path.join(datafiles.dirname, datafiles.basename)
-
- # Set the env var, and expect the same with added newline
- os.environ['ANIMAL'] = animal
- expected = animal + '\n'
-
- result = execute_shell(cli, project, ['/bin/sh', '-c', 'echo ${ANIMAL}'], config={
- 'shell': {
- 'environment-inherit': ['ANIMAL']
- }
- })
-
- assert result.exit_code == 0
- assert result.output == expected
-
-
# Test shell environment variable explicit assignments
@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
@pytest.mark.datafiles(DATA_DIR)
@@ -125,20 +105,20 @@ def test_env_assign_expand_host_environ(cli, tmpdir, datafiles, animal):
assert result.output == expected
-# Test that environment variable inheritance is disabled with --isolate
+# Test that shell environment variable explicit assignments are discarded
+# when running an isolated shell
@pytest.mark.parametrize("animal", [("Horse"), ("Pony")])
@pytest.mark.datafiles(DATA_DIR)
-def test_env_isolated_no_inherit(cli, tmpdir, datafiles, animal):
+def test_env_assign_isolated(cli, tmpdir, datafiles, animal):
project = os.path.join(datafiles.dirname, datafiles.basename)
-
- # Set the env var, but expect that it is not applied
- os.environ['ANIMAL'] = animal
-
result = execute_shell(cli, project, ['/bin/sh', '-c', 'echo ${ANIMAL}'], isolate=True, config={
'shell': {
- 'environment-inherit': ['ANIMAL']
+ 'environment': {
+ 'ANIMAL': animal
+ }
}
})
+
assert result.exit_code == 0
assert result.output == '\n'