1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00

Merge pull request #223 from marcusholl/pr/fixDoNotFailInCaseCommitHistoryDoesNotContainChangeDocumentId

Do not fail immediatly in case commit history does not contain a chan…
This commit is contained in:
Marcus Holl 2018-07-23 09:46:53 +02:00 committed by GitHub
commit 339226f304
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -103,8 +103,9 @@ class CheckChangeInDevelopmentTest extends BasePiperTest {
@Test
public void changeDocumentIdRetrievalFailsTest() {
thrown.expect(AbortException)
thrown.expectMessage('Something went wrong')
thrown.expect(IllegalArgumentException)
thrown.expectMessage("No changeDocumentId provided. Neither via parameter 'changeDocumentId' nor via " +
"label 'ChangeDocument\\s?:' in commit range [from: origin/master, to: HEAD].")
ChangeManagement cm = new ChangeManagement(nullScript, null) {

View File

@ -65,7 +65,7 @@ def call(parameters = [:]) {
echo "[INFO] ChangeDocumentId '${changeId}' retrieved from commit history"
}
} catch(ChangeManagementException ex) {
throw new AbortException(ex.getMessage())
echo "[WARN] Cannot retrieve changeDocumentId from commit history: ${ex.getMessage()}."
}
}