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:07:46 +0900
commitf60558a328e1803d385756f2f6e24bf385e79041 (patch)
tree5c5bcbdec12654e58bd3f9ea5648749c3fd5dc8b
parent39125d24668cd717cfb3b22c2d164f2630518a4c (diff)
downloadbuildstream-f60558a328e1803d385756f2f6e24bf385e79041.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 162635a05..d998ffdd8 100644
--- a/tests/artifactcache/expiry.py
+++ b/tests/artifactcache/expiry.py
@@ -93,6 +93,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)
@@ -220,6 +221,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.