summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-09-14 17:31:35 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-09-14 21:11:31 +0900
commitfe98e5cb5120db42bba40d3aecc593e8198e0254 (patch)
tree088a6284dadc3af4fb4910226dd98a3f4a6c3781
parentabc5e3758192c4794919d7a1b92f56d6606400ac (diff)
downloadbuildstream-fe98e5cb5120db42bba40d3aecc593e8198e0254.tar.gz
tests/artifactcache/expiry.py: Assert the expected errors
These tests were not checking that we fail for the expected reasons. Added `res.assert_task_error(ErrorDomain.ARTIFACT, 'cache-too-full')` where we expect to fail because the cache is too full.
-rw-r--r--tests/artifactcache/expiry.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/artifactcache/expiry.py b/tests/artifactcache/expiry.py
index 1e8fbb7ca..7d39f2ea5 100644
--- a/tests/artifactcache/expiry.py
+++ b/tests/artifactcache/expiry.py
@@ -74,6 +74,7 @@ def test_artifact_too_large(cli, datafiles, tmpdir, size):
create_element_size('target.bst', project, element_path, [], size)
res = cli.run(project=project, args=['build', 'target.bst'])
res.assert_main_error(ErrorDomain.STREAM, None)
+ res.assert_task_error(ErrorDomain.ARTIFACT, 'cache-too-full')
@pytest.mark.datafiles(DATA_DIR)
@@ -199,6 +200,7 @@ def test_never_delete_required(cli, datafiles, tmpdir):
# cache. Since all elements are required, the build should fail.
res = cli.run(project=project, args=['build', 'target.bst'])
res.assert_main_error(ErrorDomain.STREAM, None)
+ res.assert_task_error(ErrorDomain.ARTIFACT, 'cache-too-full')
# Only the first artifact fits in the cache, but we expect
# that the first *two* artifacts will be cached.