summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-05-15 19:49:18 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-05-15 19:49:18 -0400
commit01bd6cfd1783f2c598b10939e0a59a489e720cf7 (patch)
treea6196149a08f4b29d4dc9145b0d77c7dbfe4c788
parent5870f1c90ade6c600b714f819aa5dd5db16e80e4 (diff)
downloadgtk+-01bd6cfd1783f2c598b10939e0a59a489e720cf7.tar.gz
ci: Add the backend to the reports
We want the test names in the junit xml to be unique across all the tests in a job, so we need to include the backend in the test name. And we also want to see the used backend in the html report.
-rwxr-xr-x.gitlab-ci/meson-html-report.py7
-rwxr-xr-x.gitlab-ci/meson-junit-report.py9
-rwxr-xr-x.gitlab-ci/run-tests.sh2
3 files changed, 14 insertions, 4 deletions
diff --git a/.gitlab-ci/meson-html-report.py b/.gitlab-ci/meson-html-report.py
index d670f41362..2d67553fe5 100755
--- a/.gitlab-ci/meson-html-report.py
+++ b/.gitlab-ci/meson-html-report.py
@@ -138,12 +138,13 @@ ul.images li {
</head>
<body>
<header>
- <h1>{{ report.project_name }}/{{ report.branch_name }} :: Test Reports</h1>
+ <h1>{{ report.project_name }}/{{ report.backend }}/{{ report.branch_name }} :: Test Reports</h1>
</header>
<article>
<section>
<div class="report-meta">
+ <p><strong>Backend:</strong> {{ report.backend }}</p>
<p><strong>Branch:</strong> {{ report.branch_name }}</p>
<p><strong>Date:</strong> <time datetime="{{ report.date.isoformat() }}">{{ report.locale_date }}</time></p>
{% if report.job_id %}<p><strong>Job ID:</strong> {{ report.job_id }}</p>{% endif %}
@@ -259,6 +260,9 @@ aparser = argparse.ArgumentParser(description='Turns a Meson test log into an HT
aparser.add_argument('--project-name', metavar='NAME',
help='The project name',
default='Unknown')
+aparser.add_argument('--backend', metavar='NAME',
+ help='The used backend',
+ default='unknown')
aparser.add_argument('--job-id', metavar='ID',
help='The job ID for the report',
default=None)
@@ -319,6 +323,7 @@ report = {}
report['date'] = datetime.datetime.utcnow()
report['locale_date'] = report['date'].strftime("%c")
report['project_name'] = args.project_name
+report['backend'] = args.backend
report['job_id'] = args.job_id
report['branch_name'] = args.branch
report['total_successes'] = 0
diff --git a/.gitlab-ci/meson-junit-report.py b/.gitlab-ci/meson-junit-report.py
index dd0b13897c..532305cdca 100755
--- a/.gitlab-ci/meson-junit-report.py
+++ b/.gitlab-ci/meson-junit-report.py
@@ -19,6 +19,9 @@ aparser = argparse.ArgumentParser(description='Turns a Meson test log into a JUn
aparser.add_argument('--project-name', metavar='NAME',
help='The project name',
default='unknown')
+aparser.add_argument('--backend', metavar='NAME',
+ help='The used backend',
+ default='unknown')
aparser.add_argument('--job-id', metavar='ID',
help='The job ID for the report',
default='Unknown')
@@ -92,18 +95,18 @@ for name, units in suites.items():
for unit in successes:
testcase = ET.SubElement(testsuite, 'testcase')
testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
- testcase.set('name', unit['name'])
+ testcase.set('name', '{}/{}'.format(args.backend, unit['name']))
testcase.set('time', str(unit['duration']))
for unit in failures:
testcase = ET.SubElement(testsuite, 'testcase')
testcase.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
- testcase.set('name', unit['name'])
+ testcase.set('name', '{}/{}'.format(args.backend, unit['name']))
testcase.set('time', str(unit['duration']))
failure = ET.SubElement(testcase, 'failure')
failure.set('classname', '{}/{}'.format(args.project_name, unit['suite']))
- failure.set('name', unit['name'])
+ testcase.set('name', '{}/{}'.format(args.backend, unit['name']))
failure.set('type', 'error')
failure.text = unit['stdout']
diff --git a/.gitlab-ci/run-tests.sh b/.gitlab-ci/run-tests.sh
index e259ec5bd2..b8c61cecb7 100755
--- a/.gitlab-ci/run-tests.sh
+++ b/.gitlab-ci/run-tests.sh
@@ -61,11 +61,13 @@ cd ${builddir}
$srcdir/.gitlab-ci/meson-junit-report.py \
--project-name=gtk \
+ --backend=${backend} \
--job-id="${CI_JOB_NAME}" \
--output=report-${backend}.xml \
meson-logs/testlog-${backend}.json
$srcdir/.gitlab-ci/meson-html-report.py \
--project-name=gtk \
+ --backend=${backend} \
--job-id="${CI_JOB_NAME}" \
--reftest-output-dir="testsuite/reftests/output/${backend}" \
--output=report-${backend}.html \