diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-05-08 15:31:05 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2019-05-09 17:20:03 +0900 |
commit | 854ba3a141f0351520640bb4ac79a0a2a7260ef4 (patch) | |
tree | c80bd79c7e42930cf5c8812c23a8b63c88a05a12 /tests/frontend | |
parent | 70183d8274898701f4102a1581262807ca89f9ee (diff) | |
download | buildstream-854ba3a141f0351520640bb4ac79a0a2a7260ef4.tar.gz |
tests/frontend/buildtrack.py: Extending tests to ensure we build after tracking
This adds a check to test_build_track() to ensure that the target
is cached as a result of building with tracking of selected elements.
Diffstat (limited to 'tests/frontend')
-rw-r--r-- | tests/frontend/buildtrack.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/frontend/buildtrack.py b/tests/frontend/buildtrack.py index 404882beb..d12481c6a 100644 --- a/tests/frontend/buildtrack.py +++ b/tests/frontend/buildtrack.py @@ -34,6 +34,7 @@ def create_element(repo, name, path, dependencies, ref=None): @pytest.mark.datafiles(os.path.join(DATA_DIR)) +@pytest.mark.parametrize("strict", [True, False], ids=["strict", "no-strict"]) @pytest.mark.parametrize("ref_storage", [('inline'), ('project.refs')]) @pytest.mark.parametrize("track_targets,exceptions,tracked", [ # Test with no exceptions @@ -51,7 +52,7 @@ def create_element(repo, name, path, dependencies, ref=None): (['3.bst'], ['2.bst', '3.bst'], []), (['2.bst', '3.bst'], ['2.bst', '3.bst'], []) ]) -def test_build_track(cli, datafiles, tmpdir, ref_storage, +def test_build_track(cli, datafiles, tmpdir, ref_storage, strict, track_targets, exceptions, tracked): project = str(datafiles) dev_files_path = os.path.join(project, 'files', 'dev-files') @@ -63,6 +64,13 @@ def test_build_track(cli, datafiles, tmpdir, ref_storage, configure_project(project, { 'ref-storage': ref_storage }) + cli.configure({ + 'projects': { + 'test': { + 'strict': strict + } + } + }) create_elements = { '0.bst': [ @@ -120,8 +128,12 @@ def test_build_track(cli, datafiles, tmpdir, ref_storage, result = cli.run(project=project, silent=True, args=args) result.assert_success() - tracked_elements = result.get_tracked_elements() + # Assert that the main target 0.bst is cached + assert cli.get_element_state(project, '0.bst') == 'cached' + + # Assert that we tracked exactly the elements we expected to + tracked_elements = result.get_tracked_elements() assert set(tracked_elements) == set(tracked) # Delete element sources |