From deafd08377345248cc1cd15bfd34cfacd58ef567 Mon Sep 17 00:00:00 2001 From: Matthieu Baerts Date: Tue, 31 Aug 2021 17:54:39 +0200 Subject: [PATCH] junit: add 'Skip marking build as unstable on test failure' param This new option has been added in JUnit v1.51 https://github.com/jenkinsci/junit-plugin/releases/tag/junit-1.51 The user can decide not to mark a build as unstable on test failure. Signed-off-by: Matthieu Baerts Change-Id: I960ed98cf4b0f8f632546492f6dbb6d1aa0055c9 --- jenkins_jobs/modules/publishers.py | 3 +++ tests/publishers/fixtures/junit001.xml | 1 + tests/publishers/fixtures/junit002.xml | 1 + tests/publishers/fixtures/junit002.yaml | 1 + 4 files changed, 6 insertions(+) diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 7363cee46..6923a06fb 100755 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -1580,6 +1580,8 @@ def junit(registry, xml_parent, data): (default false) :arg bool skip-publishing-checks: Do not publish issues to SCM provider platforms (default false) + :arg bool skip-marking-build-unstable: Do not mark build as unstable on + test failure (default false) :arg bool test-stability: Add historical information about test results stability (default false). Requires the Jenkins :jenkins-plugins:`Test stability Plugin @@ -1615,6 +1617,7 @@ def junit(registry, xml_parent, data): ("health-scale-factor", "healthScaleFactor", "1.0"), ("allow-empty-results", "allowEmptyResults", False), ("skip-publishing-checks", "skipPublishingChecks", False), + ("skip-marking-build-unstable", "skipMarkingBuildUnstable", False), ] helpers.convert_mapping_to_xml(junitresult, data, mapping, fail_required=True) diff --git a/tests/publishers/fixtures/junit001.xml b/tests/publishers/fixtures/junit001.xml index e4d77bc23..681a223f1 100644 --- a/tests/publishers/fixtures/junit001.xml +++ b/tests/publishers/fixtures/junit001.xml @@ -7,6 +7,7 @@ 1.0 false false + false diff --git a/tests/publishers/fixtures/junit002.xml b/tests/publishers/fixtures/junit002.xml index 0478fe46f..764fd5051 100644 --- a/tests/publishers/fixtures/junit002.xml +++ b/tests/publishers/fixtures/junit002.xml @@ -7,6 +7,7 @@ 2.0 true true + true diff --git a/tests/publishers/fixtures/junit002.yaml b/tests/publishers/fixtures/junit002.yaml index 269fdd648..30f938bd8 100644 --- a/tests/publishers/fixtures/junit002.yaml +++ b/tests/publishers/fixtures/junit002.yaml @@ -5,6 +5,7 @@ publishers: health-scale-factor: 2.0 allow-empty-results: true skip-publishing-checks: true + skip-marking-build-unstable: true test-stability: true claim-build: true measurement-plots: true