diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-10 08:51:56 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-10 15:01:57 +0100 |
commit | b1efd03619f6c88acaf4f0106d2192a4a1cf8460 (patch) | |
tree | 49c6cfe805ed2f55565ee5f42934929c2caa41da /mesonbuild/mtest.py | |
parent | 6c40b134df49ae8dea373cd5c75a1348c15397e1 (diff) | |
download | meson-b1efd03619f6c88acaf4f0106d2192a4a1cf8460.zip meson-b1efd03619f6c88acaf4f0106d2192a4a1cf8460.tar.gz meson-b1efd03619f6c88acaf4f0106d2192a4a1cf8460.tar.bz2 |
mtest: include classname in <testcase> JUnit element
It looks like GitLab ignores the suite name and actually uses
the classname. Adjust the output accordingly.
Fixes: #8316
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/mtest.py')
-rw-r--r-- | mesonbuild/mtest.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index 2b5eb65..6b3eb6f 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -789,7 +789,9 @@ class JunitBuilder(TestLogger): ) for subtest in test.results: - testcase = et.SubElement(suite, 'testcase', name=str(subtest)) + # Both name and classname are required. Use the suite name as + # the class name, so that e.g. GitLab groups testcases correctly. + testcase = et.SubElement(suite, 'testcase', name=str(subtest), classname=suitename) if subtest.result is TestResult.SKIP: et.SubElement(testcase, 'skipped') elif subtest.result is TestResult.ERROR: @@ -823,7 +825,7 @@ class JunitBuilder(TestLogger): suite.attrib['tests'] = str(int(suite.attrib['tests']) + 1) testcase = et.SubElement(suite, 'testcase', name=test.name, - time=str(test.duration)) + classname=test.project, time=str(test.duration)) if test.res is TestResult.SKIP: et.SubElement(testcase, 'skipped') suite.attrib['skipped'] = str(int(suite.attrib['skipped']) + 1) |