Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Show changes
Commits on Source (20)
=================
buildstream 1.1.6
=================
o A lot of bug fixes
=================
buildstream 1.1.5
=================
......
......@@ -270,6 +270,9 @@ class App():
else:
self._message(MessageType.FAIL, session_name, elapsed=elapsed)
# Notify session failure
self._notify("{} failed".format(session_name), "{}".format(e))
if self._started:
self._print_summary()
......@@ -287,6 +290,9 @@ class App():
if self._started:
self._print_summary()
# Notify session success
self._notify("{} succeeded".format(session_name), "")
# init_project()
#
# Initialize a new BuildStream project, either with the explicitly passed options,
......@@ -420,6 +426,12 @@ class App():
# Local Functions #
############################################################
# Local function for calling the notify() virtual method
#
def _notify(self, title, text):
if self.interactive:
self.notify(title, text)
# Local message propagator
#
def _message(self, message_type, message, **kwargs):
......@@ -572,8 +584,8 @@ class App():
while choice not in ['continue', 'quit', 'terminate', 'retry']:
click.echo(summary, err=True)
self.notify("BuildStream failure", "{} on element {}"
.format(failure.action_name, element.name))
self._notify("BuildStream failure", "{} on element {}"
.format(failure.action_name, element.name))
try:
choice = click.prompt("Choice:", default='continue', err=True,
......
......@@ -358,10 +358,15 @@ class Pipeline():
inconsistent.append(element)
if inconsistent:
detail = "Exact versions are missing for the following elements\n" + \
"Try tracking these elements first with `bst track`\n\n"
detail = "Exact versions are missing for the following elements:\n\n"
for element in inconsistent:
detail += " " + element._get_full_name() + "\n"
detail += " Element: {} is inconsistent\n".format(element._get_full_name())
for source in element.sources():
if source._get_consistency() == Consistency.INCONSISTENT:
detail += " Source {} is missing ref\n".format(source)
detail += '\n'
detail += "Try tracking these elements first with `bst track`\n"
raise PipelineError("Inconsistent pipeline", detail=detail, reason="inconsistent-pipeline")
#############################################################
......
......@@ -296,6 +296,13 @@ class GitSource(Source):
self.original_url = self.node_get_member(node, str, 'url')
self.mirror = GitMirror(self, '', self.original_url, ref)
self.tracking = self.node_get_member(node, str, 'track', None)
# At this point we now know if the source has a ref and/or a track.
# If it is missing both then we will be unable to track or build.
if self.mirror.ref is None and self.tracking is None:
raise SourceError("{}: Git sources require a ref and/or track".format(self),
reason = "missing-track-and-ref")
self.checkout_submodules = self.node_get_member(node, bool, 'checkout-submodules', True)
self.submodules = []
......@@ -404,8 +411,10 @@ class GitSource(Source):
mirror.stage(directory)
def get_source_fetchers(self):
yield self.mirror
self.refresh_submodules()
return [self.mirror] + self.submodules
for submodule in self.submodules:
yield submodule
###########################################################
# Local Functions #
......
......@@ -71,7 +71,13 @@ class OSTreeSource(Source):
self.ref = self.node_get_member(node, str, 'ref', None)
self.tracking = self.node_get_member(node, str, 'track', None)
self.mirror = os.path.join(self.get_mirror_directory(),
utils.url_directory_name(self.url))
utils.url_directory_name(self.original_url))
# At this point we now know if the source has a ref and/or a track.
# If it is missing both then we will be unable to track or build.
if self.ref is None and self.tracking is None:
raise SourceError("{}: OSTree sources require a ref and/or track".format(self),
reason = "missing-track-and-ref")
# (optional) Not all repos are signed. But if they are, get the gpg key
self.gpg_key_path = None
......@@ -104,10 +110,11 @@ class OSTreeSource(Source):
return None
self.ensure()
remote_name = self.ensure_remote(self.url)
with self.timed_activity("Fetching tracking ref '{}' from origin: {}"
.format(self.tracking, self.url)):
try:
_ostree.fetch(self.repo, ref=self.tracking, progress=self.progress)
_ostree.fetch(self.repo, remote=remote_name, ref=self.tracking, progress=self.progress)
except OSTreeError as e:
raise SourceError("{}: Failed to fetch tracking ref '{}' from origin {}\n\n{}"
.format(self, self.tracking, self.url, e)) from e
......@@ -116,11 +123,12 @@ class OSTreeSource(Source):
def fetch(self):
self.ensure()
remote_name = self.ensure_remote(self.url)
if not _ostree.exists(self.repo, self.ref):
with self.timed_activity("Fetching remote ref: {} from origin: {}"
.format(self.ref, self.url)):
try:
_ostree.fetch(self.repo, ref=self.ref, progress=self.progress)
_ostree.fetch(self.repo, remote=remote_name, ref=self.ref, progress=self.progress)
except OSTreeError as e:
raise SourceError("{}: Failed to fetch ref '{}' from origin: {}\n\n{}"
.format(self, self.ref, self.url, e)) from e
......@@ -171,14 +179,22 @@ class OSTreeSource(Source):
self.status("Creating local mirror for {}".format(self.url))
self.repo = _ostree.ensure(self.mirror, True)
gpg_key = None
if self.gpg_key_path:
gpg_key = 'file://' + self.gpg_key_path
try:
_ostree.configure_remote(self.repo, "origin", self.url, key_url=gpg_key)
except OSTreeError as e:
raise SourceError("{}: Failed to configure origin {}\n\n{}".format(self, self.url, e)) from e
def ensure_remote(self, url):
if self.original_url == self.url:
remote_name = 'origin'
else:
remote_name = utils.url_directory_name(url)
gpg_key = None
if self.gpg_key_path:
gpg_key = 'file://' + self.gpg_key_path
try:
_ostree.configure_remote(self.repo, remote_name, url, key_url=gpg_key)
except OSTreeError as e:
raise SourceError("{}: Failed to configure origin {}\n\n{}".format(self, self.url, e)) from e
return remote_name
def progress(self, percent, message):
self.status(message)
......
......@@ -10,4 +10,4 @@ element-path: elements
# Define some aliases for the tarballs we download
aliases:
alpine: https://gnome7.codethink.co.uk/tarballs/
gnu: https://ftp.gnu.org/gnu/automake/
gnu: http://ftpmirror.gnu.org/gnu/automake/
......@@ -261,7 +261,7 @@ setup(name='BuildStream',
'ruamel.yaml < 0.15.52',
'pluginbase',
'Click',
'blessings',
'blessings >= 1.6',
'jinja2 >= 2.10',
'protobuf >= 3.5',
'grpcio >= 1.10',
......
......@@ -139,6 +139,67 @@ def test_mirror_fetch(cli, tmpdir, datafiles, kind):
result.assert_success()
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS])
def test_mirror_fetch_upstream_absent(cli, tmpdir, datafiles, kind):
if kind == 'ostree':
# FIXME: Mirroring fallback fails with ostree
pytest.skip("Bug #538 - ostree mirror fallback breaks assertion")
bin_files_path = os.path.join(str(datafiles), 'files', 'bin-files', 'usr')
dev_files_path = os.path.join(str(datafiles), 'files', 'dev-files', 'usr')
upstream_repodir = os.path.join(str(tmpdir), 'upstream')
mirror_repodir = os.path.join(str(tmpdir), 'mirror')
project_dir = os.path.join(str(tmpdir), 'project')
os.makedirs(project_dir)
element_dir = os.path.join(project_dir, 'elements')
# Create repo objects of the upstream and mirror
upstream_repo = create_repo(kind, upstream_repodir)
ref = upstream_repo.create(dev_files_path)
mirror_repo = upstream_repo.copy(mirror_repodir)
element = {
'kind': 'import',
'sources': [
upstream_repo.source_config(ref=ref)
]
}
element_name = 'test.bst'
element_path = os.path.join(element_dir, element_name)
full_repo = element['sources'][0]['url']
upstream_map, repo_name = os.path.split(full_repo)
alias = 'foo-' + kind
aliased_repo = alias + ':' + repo_name
element['sources'][0]['url'] = aliased_repo
full_mirror = mirror_repo.source_config()['url']
mirror_map, _ = os.path.split(full_mirror)
os.makedirs(element_dir)
_yaml.dump(element, element_path)
project = {
'name': 'test',
'element-path': 'elements',
'aliases': {
alias: 'http://www.example.com/'
},
'mirrors': [
{
'name': 'middle-earth',
'aliases': {
alias: [mirror_map + "/"],
},
},
]
}
project_file = os.path.join(project_dir, 'project.conf')
_yaml.dump(project, project_file)
result = cli.run(project=project_dir, args=['fetch', element_name])
result.assert_success()
@pytest.mark.datafiles(DATA_DIR)
def test_mirror_fetch_multi(cli, tmpdir, datafiles):
output_file = os.path.join(str(tmpdir), "output.txt")
......@@ -405,14 +466,6 @@ def test_mirror_track_upstream_absent(cli, tmpdir, datafiles, kind):
@pytest.mark.datafiles(DATA_DIR)
@pytest.mark.parametrize("kind", [(kind) for kind in ALL_REPO_KINDS])
def test_mirror_from_includes(cli, tmpdir, datafiles, kind):
if kind == 'git':
# FIXME: Mirroring fallback does not work with git because it tries to
# fetch submodules on upstream.
pytest.skip("Bug #537 - Mirror fallback does not work for git")
if kind == 'ostree':
# FIXME: Mirroring fallback fails with ostree
pytest.skip("Bug #538 - ostree mirror fallback breaks assertion")
bin_files_path = os.path.join(str(datafiles), 'files', 'bin-files', 'usr')
upstream_repodir = os.path.join(str(tmpdir), 'upstream')
mirror_repodir = os.path.join(str(tmpdir), 'mirror')
......@@ -559,3 +612,276 @@ def test_mirror_junction_from_includes(cli, tmpdir, datafiles, kind):
os.rename('{}.bak'.format(upstream_repo.repo), upstream_repo.repo)
result = cli.run(project=project_dir, args=['fetch', element_name])
result.assert_success()
@pytest.mark.datafiles(DATA_DIR)
def test_mirror_git_submodule_fetch(cli, tmpdir, datafiles):
# Test that it behaves as expected with submodules, both defined in config
# and discovered when fetching.
foo_file = os.path.join(str(datafiles), 'files', 'foo')
bar_file = os.path.join(str(datafiles), 'files', 'bar')
bin_files_path = os.path.join(str(datafiles), 'files', 'bin-files', 'usr')
dev_files_path = os.path.join(str(datafiles), 'files', 'dev-files', 'usr')
mirror_dir = os.path.join(str(datafiles), 'mirror')
defined_subrepo = create_repo('git', str(tmpdir), 'defined_subrepo')
defined_mirror_ref = defined_subrepo.create(bin_files_path)
defined_mirror = defined_subrepo.copy(mirror_dir)
defined_subref = defined_subrepo.add_file(foo_file)
found_subrepo = create_repo('git', str(tmpdir), 'found_subrepo')
found_subref = found_subrepo.create(dev_files_path)
main_repo = create_repo('git', str(tmpdir))
main_mirror_ref = main_repo.create(bin_files_path)
main_repo.add_submodule('defined', 'file://' + defined_subrepo.repo)
main_repo.add_submodule('found', 'file://' + found_subrepo.repo)
main_mirror = main_repo.copy(mirror_dir)
main_ref = main_repo.add_file(bar_file)
project_dir = os.path.join(str(tmpdir), 'project')
os.makedirs(project_dir)
element_dir = os.path.join(project_dir, 'elements')
os.makedirs(element_dir)
element = {
'kind': 'import',
'sources': [
main_repo.source_config(ref=main_mirror_ref)
]
}
element_name = 'test.bst'
element_path = os.path.join(element_dir, element_name)
# Alias the main repo
full_repo = element['sources'][0]['url']
_, repo_name = os.path.split(full_repo)
alias = 'foo'
aliased_repo = alias + ':' + repo_name
element['sources'][0]['url'] = aliased_repo
# Hide the found subrepo
del element['sources'][0]['submodules']['found']
# Alias the defined subrepo
subrepo = element['sources'][0]['submodules']['defined']['url']
_, repo_name = os.path.split(subrepo)
aliased_repo = alias + ':' + repo_name
element['sources'][0]['submodules']['defined']['url'] = aliased_repo
_yaml.dump(element, element_path)
full_mirror = main_mirror.source_config()['url']
mirror_map, _ = os.path.split(full_mirror)
project = {
'name': 'test',
'element-path': 'elements',
'aliases': {
alias: 'http://www.example.com/'
},
'mirrors': [
{
'name': 'middle-earth',
'aliases': {
alias: [mirror_map + "/"],
},
},
]
}
project_file = os.path.join(project_dir, 'project.conf')
_yaml.dump(project, project_file)
result = cli.run(project=project_dir, args=['fetch', element_name])
result.assert_success()
@pytest.mark.datafiles(DATA_DIR)
def test_mirror_fallback_git_only_submodules(cli, tmpdir, datafiles):
# Main repo has no mirror or alias.
# One submodule is overridden to use a mirror.
# There is another submodules not overriden.
# Upstream for overriden submodule is down.
#
# We expect:
# - overriden submodule is fetched from mirror.
# - other submodule is fetched.
bin_files_path = os.path.join(str(datafiles), 'files', 'bin-files', 'usr')
dev_files_path = os.path.join(str(datafiles), 'files', 'dev-files', 'usr')
upstream_bin_repodir = os.path.join(str(tmpdir), 'bin-upstream')
mirror_bin_repodir = os.path.join(str(tmpdir), 'bin-mirror')
upstream_bin_repo = create_repo('git', upstream_bin_repodir)
upstream_bin_repo.create(bin_files_path)
mirror_bin_repo = upstream_bin_repo.copy(mirror_bin_repodir)
dev_repodir = os.path.join(str(tmpdir), 'dev-upstream')
dev_repo = create_repo('git', dev_repodir)
dev_repo.create(dev_files_path)
main_files = os.path.join(str(tmpdir), 'main-files')
os.makedirs(main_files)
with open(os.path.join(main_files, 'README'), 'w') as f:
f.write("TEST\n")
main_repodir = os.path.join(str(tmpdir), 'main-upstream')
main_repo = create_repo('git', main_repodir)
main_repo.create(main_files)
upstream_url = 'file://{}'.format(upstream_bin_repo.repo)
main_repo.add_submodule('bin', url=upstream_url)
main_repo.add_submodule('dev', url='file://{}'.format(dev_repo.repo))
# Unlist 'dev'.
del main_repo.submodules['dev']
main_ref = main_repo.latest_commit()
upstream_map, repo_name = os.path.split(upstream_url)
alias = 'foo'
aliased_repo = '{}:{}'.format(alias, repo_name)
main_repo.submodules['bin']['url'] = aliased_repo
full_mirror = mirror_bin_repo.source_config()['url']
mirror_map, _ = os.path.split(full_mirror)
project_dir = os.path.join(str(tmpdir), 'project')
os.makedirs(project_dir)
element_dir = os.path.join(project_dir, 'elements')
element = {
'kind': 'import',
'sources': [
main_repo.source_config(ref=main_ref, checkout_submodules=True)
]
}
element_name = 'test.bst'
element_path = os.path.join(element_dir, element_name)
os.makedirs(element_dir)
_yaml.dump(element, element_path)
project = {
'name': 'test',
'element-path': 'elements',
'aliases': {
alias: upstream_map + "/"
},
'mirrors': [
{
'name': 'middle-earth',
'aliases': {
alias: [mirror_map + "/"],
}
}
]
}
project_file = os.path.join(project_dir, 'project.conf')
_yaml.dump(project, project_file)
# Now make the upstream unavailable.
os.rename(upstream_bin_repo.repo, '{}.bak'.format(upstream_bin_repo.repo))
result = cli.run(project=project_dir, args=['fetch', element_name])
result.assert_success()
result = cli.run(project=project_dir, args=['build', element_name])
result.assert_success()
checkout = os.path.join(str(tmpdir), 'checkout')
result = cli.run(project=project_dir, args=['checkout', element_name, checkout])
result.assert_success()
assert os.path.exists(os.path.join(checkout, 'bin', 'bin', 'hello'))
assert os.path.exists(os.path.join(checkout, 'dev', 'include', 'pony.h'))
@pytest.mark.datafiles(DATA_DIR)
def test_mirror_fallback_git_with_submodules(cli, tmpdir, datafiles):
# Main repo has mirror. But does not list submodules.
#
# We expect:
# - we will fetch submodules anyway
bin_files_path = os.path.join(str(datafiles), 'files', 'bin-files', 'usr')
dev_files_path = os.path.join(str(datafiles), 'files', 'dev-files', 'usr')
bin_repodir = os.path.join(str(tmpdir), 'bin-repo')
bin_repo = create_repo('git', bin_repodir)
bin_repo.create(bin_files_path)
dev_repodir = os.path.join(str(tmpdir), 'dev-repo')
dev_repo = create_repo('git', dev_repodir)
dev_repo.create(dev_files_path)
main_files = os.path.join(str(tmpdir), 'main-files')
os.makedirs(main_files)
with open(os.path.join(main_files, 'README'), 'w') as f:
f.write("TEST\n")
upstream_main_repodir = os.path.join(str(tmpdir), 'main-upstream')
upstream_main_repo = create_repo('git', upstream_main_repodir)
upstream_main_repo.create(main_files)
upstream_main_repo.add_submodule('bin', url='file://{}'.format(bin_repo.repo))
upstream_main_repo.add_submodule('dev', url='file://{}'.format(dev_repo.repo))
# Unlist submodules.
del upstream_main_repo.submodules['bin']
del upstream_main_repo.submodules['dev']
upstream_main_ref = upstream_main_repo.latest_commit()
mirror_main_repodir = os.path.join(str(tmpdir), 'main-mirror')
mirror_main_repo = upstream_main_repo.copy(mirror_main_repodir)
upstream_url = mirror_main_repo.source_config()['url']
upstream_map, repo_name = os.path.split(upstream_url)
alias = 'foo'
aliased_repo = '{}:{}'.format(alias, repo_name)
full_mirror = mirror_main_repo.source_config()['url']
mirror_map, _ = os.path.split(full_mirror)
project_dir = os.path.join(str(tmpdir), 'project')
os.makedirs(project_dir)
element_dir = os.path.join(project_dir, 'elements')
element = {
'kind': 'import',
'sources': [
upstream_main_repo.source_config(ref=upstream_main_ref, checkout_submodules=True)
]
}
element['sources'][0]['url'] = aliased_repo
element_name = 'test.bst'
element_path = os.path.join(element_dir, element_name)
os.makedirs(element_dir)
_yaml.dump(element, element_path)
project = {
'name': 'test',
'element-path': 'elements',
'aliases': {
alias: upstream_map + "/"
},
'mirrors': [
{
'name': 'middle-earth',
'aliases': {
alias: [mirror_map + "/"],
}
}
]
}
project_file = os.path.join(project_dir, 'project.conf')
_yaml.dump(project, project_file)
# Now make the upstream unavailable.
os.rename(upstream_main_repo.repo, '{}.bak'.format(upstream_main_repo.repo))
result = cli.run(project=project_dir, args=['fetch', element_name])
result.assert_success()
result = cli.run(project=project_dir, args=['build', element_name])
result.assert_success()
checkout = os.path.join(str(tmpdir), 'checkout')
result = cli.run(project=project_dir, args=['checkout', element_name, checkout])
result.assert_success()
assert os.path.exists(os.path.join(checkout, 'bin', 'bin', 'hello'))
assert os.path.exists(os.path.join(checkout, 'dev', 'include', 'pony.h'))
#
# Copyright (C) 2018 Codethink Limited
# Copyright (C) 2018 Bloomberg Finance LP
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
#
# Authors: Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
# Jonathan Maw <jonathan.maw@codethink.co.uk>
# William Salmon <will.salmon@codethink.co.uk>
#
import os
import pytest
......@@ -359,3 +381,30 @@ def test_submodule_track_ignore_inconsistent(cli, tmpdir, datafiles):
# Assert that we are just fine without it, and emit a warning to the user.
assert "Ignoring inconsistent submodule" in result.stderr
@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'template'))
def test_submodule_track_no_ref_or_track(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
# Create the repo from 'repofiles' subdir
repo = create_repo('git', str(tmpdir))
ref = repo.create(os.path.join(project, 'repofiles'))
# Write out our test target
gitsource = repo.source_config(ref=None)
gitsource.pop('track')
element = {
'kind': 'import',
'sources': [
gitsource
]
}
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Track will encounter an inconsistent submodule without any ref
result = cli.run(project=project, args=['show', 'target.bst'])
result.assert_main_error(ErrorDomain.SOURCE, "missing-track-and-ref")
result.assert_task_error(None, None)
#
# Copyright (C) 2018 Bloomberg Finance LP
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
#
# Authors: William Salmon <will.salmon@codethink.co.uk>
#
import os
import pytest
from buildstream._exceptions import ErrorDomain
from buildstream import _yaml
from tests.testutils import cli, create_repo
DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'ostree',
)
@pytest.mark.datafiles(os.path.join(DATA_DIR, 'template'))
def test_submodule_track_no_ref_or_track(cli, tmpdir, datafiles):
project = os.path.join(datafiles.dirname, datafiles.basename)
# Create the repo from 'repofiles' subdir
repo = create_repo('ostree', str(tmpdir))
ref = repo.create(os.path.join(project, 'repofiles'))
# Write out our test target
ostreesource = repo.source_config(ref=None)
ostreesource.pop('track')
element = {
'kind': 'import',
'sources': [
ostreesource
]
}
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Track will encounter an inconsistent submodule without any ref
result = cli.run(project=project, args=['show', 'target.bst'])
result.assert_main_error(ErrorDomain.SOURCE, "missing-track-and-ref")
result.assert_task_error(None, None)
# Basic project
name: foo