Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when two coded tests are linked to the same test issue #826

Merged
merged 2 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
- Fix Traceability matrix null ([#818](https://github.com/opendevstack/ods-jenkins-shared-library/pull/818)
- Problems with temporal folder in tests ([#819](https://github.com/opendevstack/ods-jenkins-shared-library/pull/819)
- Improve Wiremok logs ([#809](https://github.com/opendevstack/ods-jenkins-shared-library/pull/809)
- Improve error message when two coded tests are linked to the same test issue ([#826](https://github.com/opendevstack/ods-jenkins-shared-library/pull/826))

## [3.0] - 2020-08-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 @@ -260,7 +260,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 @@ -295,7 +295,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 @@ -574,7 +574,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