summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Mellen <andrew_mellen@icloud.com>2018-04-25 11:20:42 -0400
committerAndrew Mellen <andrew_mellen@icloud.com>2018-04-25 11:20:47 -0400
commitc3c2802d4fc166c7e81d8953b226a68c2252ff77 (patch)
treeb07345ec254b60fd7f9d8096e8fe5f5417353ec5
parentf95db7c756383e461ca49e4f5a9028370331c55e (diff)
Add Slack 2.2 new settings
The slack plugin added the "includeFailedTests" and "notifyRegression" options. This review adds those two options, along with unit tests for them. Change-Id: I256933d3d25c09c72c688928e9068fe66f23055b
Notes
Notes (review): Code-Review+1: Ken Dreyer <ktdreyer@ktdreyer.com> Code-Review+2: Sorin Sbarnea <ssbarnea@redhat.com> Workflow+1: Thanh Ha <zxiiro@gmail.com> Code-Review+2: Thanh Ha <zxiiro@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 30 Apr 2018 21:37:49 +0000 Reviewed-on: https://review.openstack.org/564251 Project: openstack-infra/jenkins-job-builder Branch: refs/heads/master
-rw-r--r--jenkins_jobs/modules/publishers.py8
-rw-r--r--tests/publishers/fixtures/slack003.xml2
-rw-r--r--tests/publishers/fixtures/slack004.xml2
-rw-r--r--tests/publishers/fixtures/slack004.yaml2
4 files changed, 14 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py
index 1e29452..a2f7722 100644
--- a/jenkins_jobs/modules/publishers.py
+++ b/jenkins_jobs/modules/publishers.py
@@ -6635,6 +6635,12 @@ def slack(registry, xml_parent, data):
6635 :arg bool notify-repeated-failure: Send notification when job fails 6635 :arg bool notify-repeated-failure: Send notification when job fails
6636 successively (previous build was also a failure) (>=2.0). 6636 successively (previous build was also a failure) (>=2.0).
6637 (default false) 6637 (default false)
6638 :arg bool notify-regression: Send notification when number of failed tests
6639 increased or the failed tests are different than previous build
6640 (>=2.2). (default false)
6641 :arg bool include-failed-tests: includes all failed tests when some tests
6642 failed. does nothing if no failed tests were found (>=2.2).
6643 (default false)
6638 :arg bool include-test-summary: Include the test summary (>=2.0). 6644 :arg bool include-test-summary: Include the test summary (>=2.0).
6639 (default false) 6645 (default false)
6640 :arg str commit-info-choice: What commit information to include into 6646 :arg str commit-info-choice: What commit information to include into
@@ -6699,8 +6705,10 @@ def slack(registry, xml_parent, data):
6699 ('notify-unstable', 'notifyUnstable', False), 6705 ('notify-unstable', 'notifyUnstable', False),
6700 ('notify-failure', 'notifyFailure', False), 6706 ('notify-failure', 'notifyFailure', False),
6701 ('notify-back-to-normal', 'notifyBackToNormal', False), 6707 ('notify-back-to-normal', 'notifyBackToNormal', False),
6708 ('notify-regression', 'notifyRegression', False),
6702 ('notify-repeated-failure', 'notifyRepeatedFailure', False), 6709 ('notify-repeated-failure', 'notifyRepeatedFailure', False),
6703 ('include-test-summary', 'includeTestSummary', False), 6710 ('include-test-summary', 'includeTestSummary', False),
6711 ('include-failed-tests', 'includeFailedTests', False),
6704 ('commit-info-choice', 'commitInfoChoice', 'NONE'), 6712 ('commit-info-choice', 'commitInfoChoice', 'NONE'),
6705 ('include-custom-message', 'includeCustomMessage', False), 6713 ('include-custom-message', 'includeCustomMessage', False),
6706 ('custom-message', 'customMessage', ''), 6714 ('custom-message', 'customMessage', ''),
diff --git a/tests/publishers/fixtures/slack003.xml b/tests/publishers/fixtures/slack003.xml
index 518a377..026be44 100644
--- a/tests/publishers/fixtures/slack003.xml
+++ b/tests/publishers/fixtures/slack003.xml
@@ -14,8 +14,10 @@
14 <notifyUnstable>false</notifyUnstable> 14 <notifyUnstable>false</notifyUnstable>
15 <notifyFailure>false</notifyFailure> 15 <notifyFailure>false</notifyFailure>
16 <notifyBackToNormal>false</notifyBackToNormal> 16 <notifyBackToNormal>false</notifyBackToNormal>
17 <notifyRegression>false</notifyRegression>
17 <notifyRepeatedFailure>false</notifyRepeatedFailure> 18 <notifyRepeatedFailure>false</notifyRepeatedFailure>
18 <includeTestSummary>false</includeTestSummary> 19 <includeTestSummary>false</includeTestSummary>
20 <includeFailedTests>false</includeFailedTests>
19 <commitInfoChoice>NONE</commitInfoChoice> 21 <commitInfoChoice>NONE</commitInfoChoice>
20 <includeCustomMessage>false</includeCustomMessage> 22 <includeCustomMessage>false</includeCustomMessage>
21 <customMessage/> 23 <customMessage/>
diff --git a/tests/publishers/fixtures/slack004.xml b/tests/publishers/fixtures/slack004.xml
index 13b23b5..73eb8b6 100644
--- a/tests/publishers/fixtures/slack004.xml
+++ b/tests/publishers/fixtures/slack004.xml
@@ -14,8 +14,10 @@
14 <notifyUnstable>true</notifyUnstable> 14 <notifyUnstable>true</notifyUnstable>
15 <notifyFailure>true</notifyFailure> 15 <notifyFailure>true</notifyFailure>
16 <notifyBackToNormal>true</notifyBackToNormal> 16 <notifyBackToNormal>true</notifyBackToNormal>
17 <notifyRegression>true</notifyRegression>
17 <notifyRepeatedFailure>true</notifyRepeatedFailure> 18 <notifyRepeatedFailure>true</notifyRepeatedFailure>
18 <includeTestSummary>true</includeTestSummary> 19 <includeTestSummary>true</includeTestSummary>
20 <includeFailedTests>true</includeFailedTests>
19 <commitInfoChoice>AUTHORS_AND_TITLES</commitInfoChoice> 21 <commitInfoChoice>AUTHORS_AND_TITLES</commitInfoChoice>
20 <includeCustomMessage>true</includeCustomMessage> 22 <includeCustomMessage>true</includeCustomMessage>
21 <customMessage>A custom message.</customMessage> 23 <customMessage>A custom message.</customMessage>
diff --git a/tests/publishers/fixtures/slack004.yaml b/tests/publishers/fixtures/slack004.yaml
index bb7d8e6..bf4d9e1 100644
--- a/tests/publishers/fixtures/slack004.yaml
+++ b/tests/publishers/fixtures/slack004.yaml
@@ -13,7 +13,9 @@ publishers:
13 notify-failure: True 13 notify-failure: True
14 notify-back-to-normal: True 14 notify-back-to-normal: True
15 notify-repeated-failure: True 15 notify-repeated-failure: True
16 notify-regression: True
16 include-test-summary: True 17 include-test-summary: True
18 include-failed-tests: True
17 commit-info-choice: 'AUTHORS_AND_TITLES' 19 commit-info-choice: 'AUTHORS_AND_TITLES'
18 include-custom-message: True 20 include-custom-message: True
19 custom-message: 'A custom message.' 21 custom-message: 'A custom message.'