Skip to content

Commit

Permalink
backport: Improve error message when two coded tests are linked to th…
Browse files Browse the repository at this point in the history
…e same test issue (#835)

* Change error message for tests with more than one implementation

Co-authored-by: zxBCN Farre_Basurte,Juan_Antonio (IT EDS) EXTERNAL <juan_antonio.farre_basurte.ext@boehringer-ingelheim.com>

(cherry picked from commit a2c3323)
  • Loading branch information
Juan Farré committed Jan 27, 2022
1 parent 34c31c6 commit c58b6d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
- Improve error message when two coded tests are linked to the same test issue ([#835](https://github.com/opendevstack/ods-jenkins-shared-library/pull/835))
- Fix RM: *found unexecuted Jira tests* error during promote2Production when functional test only runs on D and QA ([#832](https://github.com/opendevstack/ods-jenkins-shared-library/pull/832))

## [4.0] - 2021-05-11
Expand Down
4 changes: 2 additions & 2 deletions src/org/ods/orchestration/usecase/JiraUseCase.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class JiraUseCase {
void matchTestIssuesAgainstTestResults(List testIssues, Map testResults,
Closure matchedHandler, Closure unmatchedHandler = null,
boolean checkDuplicateTestResults = true) {
def duplicateKeysErrorMessage = "Error: found duplicated Jira tests. Check tests with key: "
def duplicateKeysErrorMessage = "Error: the following test cases are implemented multiple times each: "
def duplicatesKeys = []

def result = [
Expand Down Expand Up @@ -293,7 +293,7 @@ class JiraUseCase {
}

if (checkDuplicateTestResults && duplicatesKeys) {
throw new IllegalStateException(duplicateKeysErrorMessage + duplicatesKeys);
throw new IllegalStateException("${duplicateKeysErrorMessage}${duplicatesKeys.join(', ')}.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ class JiraUseCaseSpec extends SpecHelper {

then:
def e = thrown(IllegalStateException)
e.message == 'Error: found duplicated Jira tests. Check tests with key: [JIRA-1, JIRA-2]'
e.message == 'Error: the following test cases are implemented multiple times each: JIRA-1, JIRA-2.'
}

def "match Jira test issues against test results having duplicate test results with flag check duplicate to false"() {
Expand Down

0 comments on commit c58b6d9

Please sign in to comment.