diff options
author | Josh Smith <qinusty@gmail.com> | 2018-09-07 16:27:39 +0100 |
---|---|---|
committer | Josh Smith <qinusty@gmail.com> | 2018-09-19 13:26:24 +0100 |
commit | 93ab82d522d92066fa94cdc74e2e4ca0d20e2377 (patch) | |
tree | 4dff1c8cba9052f8def69f297c8802dcad4d947f | |
parent | 8a378557facfb20ba97991ca81413308264e5904 (diff) | |
download | buildstream-93ab82d522d92066fa94cdc74e2e4ca0d20e2377.tar.gz |
tests.py: Test skip on push
Adds a test to ensure that BuildStream alerts the user of a skipped push
when the remote already has the artifact cached.
-rw-r--r-- | tests/frontend/push.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/frontend/push.py b/tests/frontend/push.py index 6ee301e6d..61259c521 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -362,3 +362,26 @@ def test_push_cross_junction(cli, tmpdir, datafiles): cache_key = cli.get_element_key(project, 'junction.bst:import-etc.bst') assert share.has_artifact('subtest', 'import-etc.bst', cache_key) + + +@pytest.mark.datafiles(DATA_DIR) +def test_push_already_cached(caplog, cli, tmpdir, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + caplog.set_level(1) + + with create_artifact_share(os.path.join(str(tmpdir), 'artifactshare')) as share: + + cli.configure({ + 'artifacts': {'url': share.repo, 'push': True} + }) + result = cli.run(project=project, args=['build', 'target.bst']) + + result.assert_success() + assert "SKIPPED Push" not in result.stderr + + result = cli.run(project=project, args=['push', 'target.bst']) + + result.assert_success() + assert not result.get_pushed_elements(), "No elements should have been pushed since the cache was populated" + assert "INFO Remote ({}) already has ".format(share.repo) in result.stderr + assert "SKIPPED Push" in result.stderr |