diff options
author | Martin Blanchard <martin.blanchard@codethink.co.uk> | 2018-07-30 13:36:15 +0100 |
---|---|---|
committer | Valentin David <valentin.david@gmail.com> | 2018-08-14 07:12:45 +0000 |
commit | 3088aca2b869c791442cca57fe5feb810a09a070 (patch) | |
tree | 74ecd85e40025e22e6337667d8b236b1b9fc54d4 /tests/frontend | |
parent | cbdeba7b8052cbfce68f53a1a7eb231ce854945f (diff) | |
download | buildstream-3088aca2b869c791442cca57fe5feb810a09a070.tar.gz |
element.py: Raise an exception on unbuilt element checkout
Trying to checkout an element that has no cached artifacts should be and
handled failure. See BuildStream/buildstream#447.
Diffstat (limited to 'tests/frontend')
-rw-r--r-- | tests/frontend/buildcheckout.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index b9d833f24..d0f52d6a7 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -97,6 +97,16 @@ def test_build_checkout_deps(datafiles, cli, deps): @pytest.mark.datafiles(DATA_DIR) +def test_build_checkout_unbuilt(datafiles, cli): + project = os.path.join(datafiles.dirname, datafiles.basename) + checkout = os.path.join(cli.directory, 'checkout') + + # Check that checking out an unbuilt element fails nicely + result = cli.run(project=project, args=['checkout', 'target.bst', checkout]) + result.assert_main_error(ErrorDomain.STREAM, "uncached-checkout-attempt") + + +@pytest.mark.datafiles(DATA_DIR) def test_build_checkout_tarball(datafiles, cli): project = os.path.join(datafiles.dirname, datafiles.basename) checkout = os.path.join(cli.directory, 'checkout.tar') |