diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-17 19:17:22 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-20 18:29:14 +0900 |
commit | 150c7441279513249c10d10f12f06a0a5d8ab768 (patch) | |
tree | c71f92ccce41986664a1d16d38696dff67897cb2 | |
parent | 0f6b75dc7e7508c2806c92326d725ff4a777362e (diff) | |
download | buildstream-150c7441279513249c10d10f12f06a0a5d8ab768.tar.gz |
tests/frontend/track.py: Testing that this works with project.refs
Only added condition to the simplest case here, the other cases
are mostly testing that track commands get the correct selection
of elements when using `--deps all` and `--except` arguments.
-rw-r--r-- | tests/frontend/track.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/frontend/track.py b/tests/frontend/track.py index aa8cff6d1..138616fbf 100644 --- a/tests/frontend/track.py +++ b/tests/frontend/track.py @@ -24,14 +24,25 @@ def generate_element(repo, element_path, dep_name=None): _yaml.dump(element, element_path) +def configure_project(path, config): + config['name'] = 'test' + config['element-path'] = 'elements' + _yaml.dump(config, os.path.join(path, 'project.conf')) + + @pytest.mark.datafiles(DATA_DIR) +@pytest.mark.parametrize("ref_storage", [('inline'), ('project.refs')]) @pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS]) -def test_track(cli, tmpdir, datafiles, kind): +def test_track(cli, tmpdir, datafiles, ref_storage, kind): project = os.path.join(datafiles.dirname, datafiles.basename) dev_files_path = os.path.join(project, 'files', 'dev-files') element_path = os.path.join(project, 'elements') element_name = 'track-test-{}.bst'.format(kind) + configure_project(project, { + 'ref-storage': ref_storage + }) + # Create our repo object of the given source type with # the dev files, and then collect the initial ref. # @@ -59,6 +70,12 @@ def test_track(cli, tmpdir, datafiles, kind): # now cached. assert cli.get_element_state(project, element_name) == 'buildable' + # Assert there was a project.refs created, depending on the configuration + if ref_storage == 'project.refs': + assert os.path.exists(os.path.join(project, 'project.refs')) + else: + assert not os.path.exists(os.path.join(project, 'project.refs')) + @pytest.mark.datafiles(DATA_DIR) @pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS]) |