Valentin David pushed to branch valentindavid/fix_included_junction_track at BuildStream / buildstream
Commits:
-
d63adc13
by Valentin David at 2018-08-09T22:07:30Z
2 changed files:
Changes:
... | ... | @@ -268,7 +268,7 @@ class Stream(): |
268 | 268 |
cross_junctions=False):
|
269 | 269 |
|
270 | 270 |
_, elements = \
|
271 |
- self._load(targets, targets,
|
|
271 |
+ self._load([], targets,
|
|
272 | 272 |
selection=selection, track_selection=selection,
|
273 | 273 |
except_targets=except_targets,
|
274 | 274 |
track_except_targets=except_targets,
|
... | ... | @@ -869,7 +869,7 @@ class Stream(): |
869 | 869 |
#
|
870 | 870 |
# This can happen with `bst build --track`
|
871 | 871 |
#
|
872 |
- if not self._pipeline.targets_include(elements, track_elements):
|
|
872 |
+ if targets and not self._pipeline.targets_include(elements, track_elements):
|
|
873 | 873 |
raise StreamError("Specified tracking targets that are not "
|
874 | 874 |
"within the scope of primary targets")
|
875 | 875 |
|
... | ... | @@ -905,6 +905,10 @@ class Stream(): |
905 | 905 |
for element in track_selected:
|
906 | 906 |
element._schedule_tracking()
|
907 | 907 |
|
908 |
+ if not targets:
|
|
909 |
+ self._pipeline.resolve_elements(track_selected)
|
|
910 |
+ return [], track_selected
|
|
911 |
+ |
|
908 | 912 |
# ArtifactCache.setup_remotes expects all projects to be fully loaded
|
909 | 913 |
for project in self._context.get_projects():
|
910 | 914 |
project.ensure_fully_loaded()
|
... | ... | @@ -612,3 +612,25 @@ def test_track_include_junction(cli, tmpdir, datafiles, ref_storage, kind): |
612 | 612 |
# Assert that we are now buildable because the source is
|
613 | 613 |
# now cached.
|
614 | 614 |
assert cli.get_element_state(project, element_name) == 'buildable'
|
615 |
+ |
|
616 |
+ |
|
617 |
+@pytest.mark.datafiles(DATA_DIR)
|
|
618 |
+@pytest.mark.parametrize("ref_storage", [('inline'), ('project.refs')])
|
|
619 |
+@pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS])
|
|
620 |
+def test_track_junction_included(cli, tmpdir, datafiles, ref_storage, kind):
|
|
621 |
+ project = os.path.join(datafiles.dirname, datafiles.basename)
|
|
622 |
+ element_path = os.path.join(project, 'elements')
|
|
623 |
+ subproject_path = os.path.join(project, 'files', 'sub-project')
|
|
624 |
+ sub_element_path = os.path.join(subproject_path, 'elements')
|
|
625 |
+ junction_path = os.path.join(element_path, 'junction.bst')
|
|
626 |
+ |
|
627 |
+ configure_project(project, {
|
|
628 |
+ 'ref-storage': ref_storage,
|
|
629 |
+ '(@)': ['junction.bst:test.yml']
|
|
630 |
+ })
|
|
631 |
+ |
|
632 |
+ generate_junction(str(tmpdir.join('junction_repo')),
|
|
633 |
+ subproject_path, junction_path, store_ref=False)
|
|
634 |
+ |
|
635 |
+ result = cli.run(project=project, args=['track', 'junction.bst'])
|
|
636 |
+ result.assert_success()
|