summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2020-08-08 12:40:54 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-12 10:53:47 +0100
commit8ed6b52c6409628d30ced8b5ad7a1df45553c6a7 (patch)
treee89dc4463850041f1b9f23b9e6fec8d20d264b80
parentd89ffa3af434212be6deba225a5a14d07a1aea9a (diff)
downloadpoky-8ed6b52c6409628d30ced8b5ad7a1df45553c6a7.tar.gz
oeqa: write @OETestTag content into json test reports for each case
This allows using these tags for classification and filtering of test results according to various organization-specific criteria, such as teams responsible for the test, internal test ids, feature domains and so on. Test name itself meanwhile can stay short and human-readable. (From OE-Core rev: 3801b126eb52cd46efe417111afcd27f05d8f72b) (From OE-Core rev: 9eaf11657cc8304af5cb75f98decbc64cca37801) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/core/runner.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index 00b7d0bb12..d50690ab37 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -195,6 +195,20 @@ class OETestResult(_TestResult):
195 report['log'] = log 195 report['log'] = log
196 if duration: 196 if duration:
197 report['duration'] = duration 197 report['duration'] = duration
198
199 alltags = []
200 # pull tags from the case class
201 if hasattr(case, "__oeqa_testtags"):
202 alltags.extend(getattr(case, "__oeqa_testtags"))
203 # pull tags from the method itself
204 test_name = case._testMethodName
205 if hasattr(case, test_name):
206 method = getattr(case, test_name)
207 if hasattr(method, "__oeqa_testtags"):
208 alltags.extend(getattr(method, "__oeqa_testtags"))
209 if alltags:
210 report['oetags'] = alltags
211
198 if dump_streams and case.id() in self.logged_output: 212 if dump_streams and case.id() in self.logged_output:
199 (stdout, stderr) = self.logged_output[case.id()] 213 (stdout, stderr) = self.logged_output[case.id()]
200 report['stdout'] = stdout 214 report['stdout'] = stdout