From 804fcf903e3d82010149038d77e38f2e9d3d58cb Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Tue, 23 Jan 2024 15:56:10 -0500 Subject: [PATCH] Update TAP publisher plugin Add support for the following configuration options: - stripSingleParents - flattentTapResult - skipIfBuildNotOk - removeYamlIfCorrupted Signed-off-by: Kienan Stewart Change-Id: I387e5cd46fadb54e478627346dc6b4223bda1fc0 --- jenkins_jobs/modules/publishers.py | 11 +++++++++++ tests/publishers/fixtures/tap-full.xml | 4 ++++ tests/publishers/fixtures/tap-full.yaml | 4 ++++ tests/publishers/fixtures/tap-minimal.xml | 4 ++++ tests/publishers/fixtures/tap001.xml | 4 ++++ 5 files changed, 27 insertions(+) diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 34bad619c..27e5f59f3 100755 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -4282,6 +4282,13 @@ def tap(registry, xml_parent, data): (default true) :arg bool show-only-failures: show only test failures (>=1.17) (default false) + :arg bool strip-single-parents: (>=2.0) (default false) + :arg bool flatten-tap-result: flattent multiple subtest levels into a + single file (>=2.0) (default false) + :arg bool skip-if-built-not-ok: skip publishing TAP results when + build fails (>= 2.0.1) (default false) + :arg bool remove-yaml-if-corrupted: Remove corrupted YAML (>=2.3) + (default false) Full Example: @@ -4310,6 +4317,10 @@ def tap(registry, xml_parent, data): ("plan-required", "planRequired", True), ("verbose", "verbose", True), ("show-only-failures", "showOnlyFailures", False), + ("strip-single-parents", "stripSingleParents", False), + ("flatten-tap-result", "flattenTapResult", False), + ("skip-if-build-not-ok", "skipIfBuildNotOk", False), + ("remove-yaml-if-corrupted", "removeYamlIfCorrupted", False), ] helpers.convert_mapping_to_xml(tap, data, mappings, fail_required=True) diff --git a/tests/publishers/fixtures/tap-full.xml b/tests/publishers/fixtures/tap-full.xml index 7ee7222ca..833f0a020 100644 --- a/tests/publishers/fixtures/tap-full.xml +++ b/tests/publishers/fixtures/tap-full.xml @@ -14,6 +14,10 @@ false false true + true + true + true + true diff --git a/tests/publishers/fixtures/tap-full.yaml b/tests/publishers/fixtures/tap-full.yaml index b86e3ec00..a80db2a37 100644 --- a/tests/publishers/fixtures/tap-full.yaml +++ b/tests/publishers/fixtures/tap-full.yaml @@ -12,3 +12,7 @@ publishers: plan-required: false verbose: false show-only-failures: true + strip-single-parents: true + flatten-tap-result: true + skip-if-build-not-ok: true + remove-yaml-if-corrupted: true diff --git a/tests/publishers/fixtures/tap-minimal.xml b/tests/publishers/fixtures/tap-minimal.xml index d6e1d0936..c724fc091 100644 --- a/tests/publishers/fixtures/tap-minimal.xml +++ b/tests/publishers/fixtures/tap-minimal.xml @@ -14,6 +14,10 @@ true true false + false + false + false + false diff --git a/tests/publishers/fixtures/tap001.xml b/tests/publishers/fixtures/tap001.xml index 390f234ba..36e127d0a 100644 --- a/tests/publishers/fixtures/tap001.xml +++ b/tests/publishers/fixtures/tap001.xml @@ -14,6 +14,10 @@ true true false + false + false + false + false