diff options
author | Tristan van Berkom <tristan@codethink.co.uk> | 2020-11-11 19:16:55 +0900 |
---|---|---|
committer | Tristan van Berkom <tristan@codethink.co.uk> | 2020-11-19 15:41:28 +0900 |
commit | 6fd3b0b9467c9baa83aa959237ce8c8acc7c0d6a (patch) | |
tree | 62e0d3f70b980a7af255e6d77903e9f64684f11c /tests | |
parent | f6ee38f5b61073b27b94f0fecb8258dc942f5ddd (diff) | |
download | buildstream-6fd3b0b9467c9baa83aa959237ce8c8acc7c0d6a.tar.gz |
_stream.py: Only optionally try to glob for artifact names
The patch does the following things:
* Ensure that we only ever try to match artifacts to user provided
glob patterns if we are performing a command which tries to load
artifacts.
* Stops being selective about glob patterns, if the user provides
a pattern which does not end in ".bst", we still try to match it
against elements.
* Provide a warning when the provided globs did not match anything,
previously this code only provided this warning if artifacts were
not matched to globs, but not elements.
* tests/frontend/artifact_delete.py, tests/frontend/push.py,
tests/frontend/buildcheckout.py:
Fixed tests to to not try to determine success by examining the
wording of a user facing message, use the machine readable errors
instead.
Fixes #959
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frontend/artifact_delete.py | 4 | ||||
-rw-r--r-- | tests/frontend/buildcheckout.py | 2 | ||||
-rw-r--r-- | tests/frontend/push.py | 4 |
3 files changed, 3 insertions, 7 deletions
diff --git a/tests/frontend/artifact_delete.py b/tests/frontend/artifact_delete.py index 2651f567e..7b26a7644 100644 --- a/tests/frontend/artifact_delete.py +++ b/tests/frontend/artifact_delete.py @@ -256,6 +256,4 @@ def test_artifact_delete_artifact_with_deps_all_fails(cli, tmpdir, datafiles): # Try to delete the artifact with all of its dependencies result = cli.run(project=project, args=["artifact", "delete", "--deps", "all", artifact]) - result.assert_main_error(ErrorDomain.STREAM, None) - - assert "Error: '--deps all' is not supported for artifact refs" in result.stderr + result.assert_main_error(ErrorDomain.STREAM, "deps-not-supported") diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index 5afa5216d..709259397 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -451,7 +451,7 @@ def test_build_checkout_runtime_deps_using_ref_fails(datafiles, cli): checkout_args = ["artifact", "checkout", "--directory", checkout, "--deps", "run", "test/checkout-deps/" + key] result = cli.run(project=project, args=checkout_args) - result.assert_main_error(ErrorDomain.STREAM, None) + result.assert_main_error(ErrorDomain.STREAM, "deps-not-supported") @pytest.mark.datafiles(DATA_DIR) diff --git a/tests/frontend/push.py b/tests/frontend/push.py index 4b10b5bcd..31b0b7ec3 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -335,9 +335,7 @@ def test_push_artifacts_all_deps_fails(cli, tmpdir, datafiles): # Now try bst artifact push all the deps result = cli.run(project=project, args=["artifact", "push", "--deps", "all", artifact_ref]) - result.assert_main_error(ErrorDomain.STREAM, None) - - assert "Error: '--deps all' is not supported for artifact refs" in result.stderr + result.assert_main_error(ErrorDomain.STREAM, "deps-not-supported") # Tests that `bst build` won't push artifacts to the cache it just pulled from. |