summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
diff options
context:
space:
mode:
authorAlexis Lothoré <alexis.lothore@bootlin.com>2023-10-10 11:30:13 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-11 09:43:45 +0100
commit3c531686820ca9baeb6394cf75df8d27b5d8a731 (patch)
tree79948f585dbf5e162ef90627eaa3d95969ec0cbe /meta/lib/oeqa/utils
parent800665612aab3d0f18aacd7dc4fe4e0111ff5b2d (diff)
downloadpoky-3c531686820ca9baeb6394cf75df8d27b5d8a731.tar.gz
oeqa/utils/gitarchive: ensure tag matches regex before getting its fields
Whenever we ask gitarchive to retrieve test results for specific revisions, we first do a "large" search in get_tags, which uses glob patterns with git ls-remote, and then we filter received tags with a regex to parse the tags fields. Currently gitarchive assumes that all tags returned by get_tags will match the regex. This assumption is wrong (for example searching "master-next" in get_tags may return some tags like "abelloni/master-next), and leads then to exception when we try to retrieve tags fields: Traceback (most recent call last): File "/home/pokybuild/yocto-worker/a-full/build/scripts/resulttool", line 78, in <module> sys.exit(main()) ^^^^^^ File "/home/pokybuild/yocto-worker/a-full/build/scripts/resulttool", line 72, in main ret = args.func(args, logger) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pokybuild/yocto-worker/a-full/build/scripts/lib/resulttool/regression.py", line 315, in regression_git revs2 = gitarchive.get_test_revs(logger, repo, tag_name, branch=args.branch2) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pokybuild/yocto-worker/a-full/build/meta/lib/oeqa/utils/gitarchive.py", line 246, in get_test_revs fields, runs = get_test_runs(log, repo, tag_name, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pokybuild/yocto-worker/a-full/build/meta/lib/oeqa/utils/gitarchive.py", line 238, in get_test_runs groups = m.groupdict() Fix this exception by merely skipping those additionals tags which won't match the regex (From OE-Core rev: 8b5ace47372e958db9e4abb23378947fb02f6fc2) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r--meta/lib/oeqa/utils/gitarchive.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/gitarchive.py b/meta/lib/oeqa/utils/gitarchive.py
index 2fe48cdcac..10cb267dfa 100644
--- a/meta/lib/oeqa/utils/gitarchive.py
+++ b/meta/lib/oeqa/utils/gitarchive.py
@@ -235,6 +235,8 @@ def get_test_runs(log, repo, tag_name, **kwargs):
235 revs = [] 235 revs = []
236 for tag in tags: 236 for tag in tags:
237 m = tag_re.match(tag) 237 m = tag_re.match(tag)
238 if not m:
239 continue
238 groups = m.groupdict() 240 groups = m.groupdict()
239 revs.append([groups[f] for f in undef_fields] + [tag]) 241 revs.append([groups[f] for f in undef_fields] + [tag])
240 242