summaryrefslogtreecommitdiff
path: root/tests/sources/git.py
diff options
context:
space:
mode:
authorWilliam Salmon <will.salmon@codethink.co.uk>2018-08-14 09:57:15 +0100
committerWilliam Salmon <will.salmon@codethink.co.uk>2018-08-17 10:48:01 +0100
commit9b6fac5ada7c2541da5666fa63160a7cea3dbe67 (patch)
tree5047089944b57d9c4b0ef620c42cf6a714c3a884 /tests/sources/git.py
parentc102b92fe4a3f1c71a77629a57a9838b83ee19b8 (diff)
downloadbuildstream-9b6fac5ada7c2541da5666fa63160a7cea3dbe67.tar.gz
Add Error to git and ostree sources configure
Raise a error at configure time if the track and ref properties are not present in the sources. This is to address https://gitlab.com/BuildStream/buildstream/issues/471 that documented unhelpful behaviour when tracking git sources. However the issue was also identified in ostree.
Diffstat (limited to 'tests/sources/git.py')
-rw-r--r--tests/sources/git.py41
1 files changed, 24 insertions, 17 deletions
diff --git a/tests/sources/git.py b/tests/sources/git.py
index ef18e3ce3..781d6d4d1 100644
--- a/tests/sources/git.py
+++ b/tests/sources/git.py
@@ -1,3 +1,25 @@
+#
+# 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
@@ -383,21 +405,6 @@ def test_submodule_track_no_ref_or_track(cli, tmpdir, datafiles):
_yaml.dump(element, os.path.join(project, 'target.bst'))
# Track will encounter an inconsistent submodule without any ref
- result = cli.run(project=project, args=['track', 'target.bst'])
- result.assert_main_error(ErrorDomain.STREAM, None)
- result.assert_task_error(ErrorDomain.SOURCE, 'track-attempt-no-track')
-
- # Assert that we are just fine without it, and emit a warning to the user.
- assert "FAILURE git source at" in result.stderr
- assert "Without a tracking branch ref can not be updated. Please " + \
- "provide a ref or a track." in result.stderr
-
- # Track will encounter an inconsistent submodule without any ref
- result = cli.run(project=project, args=['build', 'target.bst'])
- result.assert_main_error(ErrorDomain.PIPELINE, 'inconsistent-pipeline')
+ 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)
-
- # Assert that we are just fine without it, and emit a warning to the user.
- assert "Exact versions are missing for the following elements" in result.stderr
- assert "is missing ref and track." in result.stderr
- assert "Then track these elements with `bst track`" in result.stderr