aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2020-08-07 14:24:54 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-08 09:17:35 +0100
commit3801b126eb52cd46efe417111afcd27f05d8f72b (patch)
tree9c053930b1bea7a1110aa73728edbadc32548bf5
parent6426c952b5ade48ea94fb647efc464e603989b97 (diff)
downloadopenembedded-core-contrib-3801b126eb52cd46efe417111afcd27f05d8f72b.tar.gz
openembedded-core-contrib-3801b126eb52cd46efe417111afcd27f05d8f72b.tar.bz2
openembedded-core-contrib-3801b126eb52cd46efe417111afcd27f05d8f72b.zip
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. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.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 00b7d0bb12e..d50690ab37f 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -195,6 +195,20 @@ class OETestResult(_TestResult):
report['log'] = log
if duration:
report['duration'] = duration
+
+ alltags = []
+ # pull tags from the case class
+ if hasattr(case, "__oeqa_testtags"):
+ alltags.extend(getattr(case, "__oeqa_testtags"))
+ # pull tags from the method itself
+ test_name = case._testMethodName
+ if hasattr(case, test_name):
+ method = getattr(case, test_name)
+ if hasattr(method, "__oeqa_testtags"):
+ alltags.extend(getattr(method, "__oeqa_testtags"))
+ if alltags:
+ report['oetags'] = alltags
+
if dump_streams and case.id() in self.logged_output:
(stdout, stderr) = self.logged_output[case.id()]
report['stdout'] = stdout