diff options
author | Benjamin Schubert <contact@benschubert.me> | 2019-07-31 13:52:01 +0100 |
---|---|---|
committer | Benjamin Schubert <contact@benschubert.me> | 2019-07-31 13:52:01 +0100 |
commit | 52f140d388a731d48aa0ea32e07c9840e9f73286 (patch) | |
tree | fb07395aa7f31d8f1b0f6e99aa21d33905d5f602 | |
parent | a3a5459aba0ede821c568d31e09e02eb29f4e2b0 (diff) | |
download | buildstream-52f140d388a731d48aa0ea32e07c9840e9f73286.tar.gz |
tests: Ensure that pushing an artifact that wasn't built fails sensiblybschubert/reproduce-unbuilt-artifact-push
-rw-r--r-- | tests/frontend/push.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/frontend/push.py b/tests/frontend/push.py index 93b7425b2..1302c4a8c 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -486,3 +486,29 @@ def test_push_no_strict(caplog, cli, tmpdir, datafiles, buildtrees): args += ['artifact', 'push', '--deps', 'all', 'target.bst'] result = cli.run(project=project, args=args) result.assert_success() + + +# Tests that `bst artifact push` fails sensibly when the target was not built. +# +@pytest.mark.datafiles(DATA_DIR) +def test_push_not_built(cli, tmpdir, datafiles): + project = str(datafiles) + + with create_artifact_share(os.path.join(str(tmpdir), 'artifactshare')) as share: + # Assert that we are not cached locally + assert cli.get_element_state(project, 'target.bst') == 'waiting' + + # Configure artifact share + cli.configure({ + 'artifacts': { + 'url': share.repo, + 'push': True, + } + }) + + # Now try bst artifact push all the deps + result = cli.run(project=project, args=[ + 'artifact', 'push', 'target.bst', + '--deps', 'all' + ]) + result.assert_success() |