summaryrefslogtreecommitdiff
path: root/tests/frontend/overlaps.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/frontend/overlaps.py')
-rw-r--r--tests/frontend/overlaps.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/frontend/overlaps.py b/tests/frontend/overlaps.py
index ad2211dde..1ea6d157c 100644
--- a/tests/frontend/overlaps.py
+++ b/tests/frontend/overlaps.py
@@ -2,7 +2,7 @@ import os
import pytest
from tests.testutils.runcli import cli
from tests.testutils import generate_junction
-from buildstream._exceptions import ErrorDomain
+from buildstream._exceptions import ErrorDomain, LoadErrorReason
from buildstream import _yaml
from buildstream.plugin import CoreWarnings
@@ -80,6 +80,26 @@ def test_overlaps_whitelist_on_overlapper(cli, datafiles):
@pytest.mark.datafiles(DATA_DIR)
+def test_overlaps_whitelist_undefined_variable(cli, datafiles):
+ project_dir = str(datafiles)
+ gen_project(project_dir, False)
+ result = cli.run(project=project_dir, silent=True, args=["build", "collect-whitelisted-undefined.bst"])
+
+ # Assert that we get the expected undefined variable error,
+ # and that it has the provenance we expect from whitelist-undefined.bst
+ #
+ # FIXME: In BuildStream 1, we only encounter this error later when extracting
+ # the variables from an artifact, and we lose the provenance.
+ #
+ # This is not a huge problem in light of the coming of BuildStream 2 and
+ # is probably not worth too much attention, but it is worth noting that
+ # this is an imperfect error message delivered at a late stage.
+ #
+ result.assert_main_error(ErrorDomain.STREAM, None)
+ assert "public.yaml [line 3 column 4]" in result.stderr
+
+
+@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("use_fatal_warnings", [True, False])
def test_overlaps_script(cli, datafiles, use_fatal_warnings):
# Test overlaps with script element to test