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:29:15 +0900 |
commit | 93083ac889872cbb36b2ff33af5ef1df71cf52aa (patch) | |
tree | 104260e8d1a5a4e10dc87ccb28427e63f914e2fb /tests/frontend | |
parent | b17a5e071a5abc76f57aae1f7ab7194f55b40360 (diff) | |
download | buildstream-93083ac889872cbb36b2ff33af5ef1df71cf52aa.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 | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/frontend/buildtrack.py b/tests/frontend/buildtrack.py index 3f0a3adbe..cd726cd71 100644 --- a/tests/frontend/buildtrack.py +++ b/tests/frontend/buildtrack.py @@ -30,6 +30,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 @@ -47,7 +48,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 = os.path.join(datafiles.dirname, datafiles.basename) dev_files_path = os.path.join(project, 'files', 'dev-files') @@ -59,6 +60,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': [ @@ -115,8 +123,13 @@ def test_build_track(cli, datafiles, tmpdir, ref_storage, args += ['0.bst'] result = cli.run(project=project, silent=True, args=args) - tracked_elements = result.get_tracked_elements() + result.assert_success() + + # 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 |