summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/gitarchivetests.py
diff options
context:
space:
mode:
authorAlexis Lothoré <alexis.lothore@bootlin.com>2023-08-23 12:35:20 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-23 22:33:39 +0100
commitdb6ace80a0c094748b0e8be6db9d3931be535a8c (patch)
tree1d71c9486a4c4fbb5c1b4a884a0f128752fd4b4a /meta/lib/oeqa/selftest/cases/gitarchivetests.py
parent3c1ee6d8b0f9d73148109522ce36daff0ad77f8b (diff)
downloadpoky-db6ace80a0c094748b0e8be6db9d3931be535a8c.tar.gz
oeqa/utils/gitarchive: fall back to local tags when listing existing tags
e9cff55e73cc has switched tag listing from bare "git tag" to "git ls-remote" to make sure not to miss remote tags which are not fetched locally. This mechanism first checks for configured remote repository, next for possibly passed url, and then fails if none worked. However there are still cases where no remote repository is configured and no url is provided (for instance: buildperf tests use an empty git directory to store tests). Fix those cases by putting back the old behavior (local tags check) as last resort, with at least a warning for future diagnostics if we still encounter tagging issues Fixes: e9cff55e73cc ("oeqa/utils/gitarchive: fix tag computation when creating archive") (From OE-Core rev: 34e1f845687d2f7169f5d6c1bb54e1a7ab5412c4) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/gitarchivetests.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/gitarchivetests.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gitarchivetests.py b/meta/lib/oeqa/selftest/cases/gitarchivetests.py
index e19fd4f280..71382089c1 100644
--- a/meta/lib/oeqa/selftest/cases/gitarchivetests.py
+++ b/meta/lib/oeqa/selftest/cases/gitarchivetests.py
@@ -115,13 +115,15 @@ class GitArchiveTests(OESelftestTestCase):
115 self.assertIn("yocto-4.2", tags) 115 self.assertIn("yocto-4.2", tags)
116 delete_fake_repository(path) 116 delete_fake_repository(path)
117 117
118 def test_get_tags_without_valid_remote_neither_url(self): 118 def test_get_tags_with_only_local_tag(self):
119 url = 'git://git.yoctoproject.org/poky' 119 fake_tags_list=["main/10-g0f7d5df/0", "main/10-g0f7d5df/1", "foo/20-g2468f5d/0"]
120 path, git_obj = create_fake_repository(False, None, False) 120 path, git_obj = create_fake_repository(True, fake_tags_list, False)
121 121
122 """Test for some well established tags (released tags)""" 122 """No remote is configured and no url is passed: get_tags must fall
123 with self.assertRaises(GitError): 123 back to local tags
124 tags = ga.get_tags(git_obj, self.log, pattern="yocto-*") 124 """
125 tags = ga.get_tags(git_obj, self.log)
126 self.assertCountEqual(tags, fake_tags_list)
125 delete_fake_repository(path) 127 delete_fake_repository(path)
126 128
127 def test_get_tags_without_valid_remote_and_wrong_url(self): 129 def test_get_tags_without_valid_remote_and_wrong_url(self):