diff options
author | Jürg Billeter <j@bitron.ch> | 2020-04-14 18:19:21 +0200 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2020-04-16 16:48:49 +0000 |
commit | 954ede72dff852488315910d437c13f9ddf6d435 (patch) | |
tree | 81d20ec56dc8f3c1780e8b61f663a0be84385bb0 | |
parent | d36340dbb2949e15484db9e8cd345c118a0b2b24 (diff) | |
download | buildstream-954ede72dff852488315910d437c13f9ddf6d435.tar.gz |
tests/frontend/buildcheckout.py: Add non-strict test
Test that a clean build in non-strict mode produces an artifact matching
the strict cache key.
-rw-r--r-- | tests/frontend/buildcheckout.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index 52cf031ad..a64faeb9d 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -69,6 +69,28 @@ def test_build_checkout(datafiles, cli, strict, hardlinks): @pytest.mark.datafiles(DATA_DIR) +def test_non_strict_build_strict_checkout(datafiles, cli): + project = str(datafiles) + checkout = os.path.join(cli.directory, "checkout") + + # First build it in non-strict mode. + # As this is a clean build from scratch, the result and also the cache keys + # should be identical to a build in strict mode. + result = cli.run(project=project, args=["--no-strict", "build", "target.bst"]) + result.assert_success() + + # Now check it out in strict mode. + # This verifies that the clean build in non-strict mode produced an artifact + # matching the strict cache key. + result = cli.run(project=project, args=["artifact", "checkout", "target.bst", "--directory", checkout]) + result.assert_success() + + # Check that the executable hello file is found in the checkout + filename = os.path.join(checkout, "usr", "bin", "hello") + assert os.path.exists(filename) + + +@pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("strict,hardlinks", [("non-strict", "hardlinks"),]) def test_build_invalid_suffix(datafiles, cli, strict, hardlinks): project = str(datafiles) |