summaryrefslogtreecommitdiff
path: root/tests/sources/git.py
diff options
context:
space:
mode:
authorBenjamin Schubert <bschubert15@bloomberg.net>2019-12-09 15:02:47 +0000
committerBenjamin Schubert <bschubert15@bloomberg.net>2019-12-09 15:53:12 +0000
commit143b720f3819e366c712654473b6276c06f3b7ee (patch)
tree7f023fc599011c7ad9360e6ecfcdf8719e0824ca /tests/sources/git.py
parent2503f0be0cfe01d5391461f8a11a9c44a10e6af9 (diff)
downloadbuildstream-bschubert/optimize-consistency-new.tar.gz
element.py: Optimize _should_fetch conditionbschubert/optimize-consistency-new
By looking at the flag first, we can avoid expensive checks on whether the element is cached or not.
Diffstat (limited to 'tests/sources/git.py')
-rw-r--r--tests/sources/git.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/sources/git.py b/tests/sources/git.py
index dabeb7899..c60a837b4 100644
--- a/tests/sources/git.py
+++ b/tests/sources/git.py
@@ -451,6 +451,17 @@ def test_unlisted_submodule(cli, tmpdir, datafiles, fail):
result.assert_success()
assert "git:unlisted-submodule" in result.stderr
+ # FIXME: decide what we want to do there
+ # # Now that we've fetched it, `bst show` will discover the unlisted submodule too
+ # result = cli.run(project=project, args=["show", "target.bst"])
+ #
+ # # Assert a warning or an error depending on what we're checking
+ # if fail == "error":
+ # result.assert_main_error(ErrorDomain.PLUGIN, "git:unlisted-submodule")
+ # else:
+ # result.assert_success()
+ # assert "git:unlisted-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"))
@@ -555,6 +566,17 @@ def test_invalid_submodule(cli, tmpdir, datafiles, fail):
result.assert_success()
assert "git:invalid-submodule" in result.stderr
+ # FIXME: decide what we want to do there
+ # # Now that we've fetched it, `bst show` will discover the unlisted submodule too
+ # result = cli.run(project=project, args=["show", "target.bst"])
+ #
+ # # Assert a warning or an error depending on what we're checking
+ # if fail == "error":
+ # result.assert_main_error(ErrorDomain.PLUGIN, "git:invalid-submodule")
+ # else:
+ # result.assert_success()
+ # assert "git:invalid-submodule" in result.stderr
+
@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
@pytest.mark.skipif(HAVE_OLD_GIT, reason="old git rm does not update .gitmodules")