diff --git a/resources/default_pipeline_environment.yml b/resources/default_pipeline_environment.yml index 16b9bef52..bca2f73c7 100644 --- a/resources/default_pipeline_environment.yml +++ b/resources/default_pipeline_environment.yml @@ -363,6 +363,7 @@ steps: transportRequestCreate: developmentSystemId: null transportRequestUploadFile: + failOnWarning: true transportRequestRelease: uiVeri5ExecuteTests: failOnError: false diff --git a/src/com/sap/piper/cm/ChangeManagement.groovy b/src/com/sap/piper/cm/ChangeManagement.groovy index 02cec03d1..fde2dde9f 100644 --- a/src/com/sap/piper/cm/ChangeManagement.groovy +++ b/src/com/sap/piper/cm/ChangeManagement.groovy @@ -206,7 +206,8 @@ public class ChangeManagement implements Serializable { String applicationDescription, String abapPackage, String codePage, - boolean acceptUnixStyleEndOfLine) { + boolean acceptUnixStyleEndOfLine, + boolean failOnWarning) { def args = [ ABAP_DEVELOPMENT_INSTANCE: developmentInstance, @@ -217,6 +218,7 @@ public class ChangeManagement implements Serializable { ZIP_FILE_URL: filePath, CODE_PAGE: codePage, ABAP_ACCEPT_UNIX_STYLE_EOL: acceptUnixStyleEndOfLine ? 'X' : '-', + FAIL_UPLOAD_ON_WARNING: Boolean.toString(failOnWarning), ] int rc = executeWithCredentials( diff --git a/test/groovy/TransportRequestCreateTest.groovy b/test/groovy/TransportRequestCreateTest.groovy index 740b5258c..6a6d9f3b6 100644 --- a/test/groovy/TransportRequestCreateTest.groovy +++ b/test/groovy/TransportRequestCreateTest.groovy @@ -161,8 +161,7 @@ public class TransportRequestCreateTest extends BasePiperTest { String description, String endpoint, String credentialsId, - String clientOpts -) { + String clientOpts) { result.transportType = transportType result.targetSystemId = targetSystemId result.description = description diff --git a/test/groovy/TransportRequestUploadFileTest.groovy b/test/groovy/TransportRequestUploadFileTest.groovy index 6540ea4c5..4612c47a5 100644 --- a/test/groovy/TransportRequestUploadFileTest.groovy +++ b/test/groovy/TransportRequestUploadFileTest.groovy @@ -236,7 +236,8 @@ public class TransportRequestUploadFileTest extends BasePiperTest { String applicationDescription, String abapPackage, String codePage, - boolean acceptUnixStyleLineEndings) { + boolean acceptUnixStyleLineEndings, + boolean failUploadOnWarning) { cmUtilsReceivedParams = [ docker: docker, @@ -250,7 +251,9 @@ public class TransportRequestUploadFileTest extends BasePiperTest { applicationDescription: applicationDescription, abapPackage: abapPackage, codePage: codePage, - acceptUnixStyleLineEndings: acceptUnixStyleLineEndings] + acceptUnixStyleLineEndings: acceptUnixStyleLineEndings, + failUploadOnWarning: failUploadOnWarning, + ] } } @@ -290,6 +293,7 @@ public class TransportRequestUploadFileTest extends BasePiperTest { abapPackage:'XYZ', codePage: 'UTF-9', acceptUnixStyleLineEndings: true, + failUploadOnWarning: true, ] } @@ -313,7 +317,8 @@ public class TransportRequestUploadFileTest extends BasePiperTest { String applicationDescription, String abapPackage, String codePage, - boolean acceptUnixStyleLineEndings) { + boolean acceptUnixStyleLineEndings, + boolean failOnUploadWarning) { throw new ChangeManagementException('upload failed') } } diff --git a/test/groovy/com/sap/piper/cm/ChangeManagementTest.groovy b/test/groovy/com/sap/piper/cm/ChangeManagementTest.groovy index b82cc21fc..46dc30bfb 100644 --- a/test/groovy/com/sap/piper/cm/ChangeManagementTest.groovy +++ b/test/groovy/com/sap/piper/cm/ChangeManagementTest.groovy @@ -287,6 +287,7 @@ public void testGetCommandLineWithCMClientOpts() { 'XYZ', // abapPackage 'UTF-9', //codePage true, // accept unix style EOL + true, //failUploadOnWarning ) @@ -306,6 +307,7 @@ public void testGetCommandLineWithCMClientOpts() { ABAP_DEVELOPMENT_PASSWORD: 'password', CODE_PAGE: 'UTF-9', ABAP_ACCEPT_UNIX_STYLE_EOL: 'X', + FAIL_UPLOAD_ON_WARNING: 'true', ] assertThat(script.shell, contains('cts uploadToABAP:002')) @@ -332,6 +334,7 @@ public void testGetCommandLineWithCMClientOpts() { 'XYZ', // abapPackage 'UTF-9', // codePage true, // accept unix style EOL + true, // failUploadOnWarning ) } diff --git a/vars/transportRequestUploadFile.groovy b/vars/transportRequestUploadFile.groovy index ccc44b722..fe3a79ec8 100644 --- a/vars/transportRequestUploadFile.groovy +++ b/vars/transportRequestUploadFile.groovy @@ -80,6 +80,7 @@ void call(parameters = [:]) { .withMandatoryProperty('abapPackage', null, { backendType == BackendType.RFC }) .withMandatoryProperty('applicationId', null, {backendType == BackendType.SOLMAN}) .withMandatoryProperty('applicationName', null, {backendType == BackendType.RFC}) + .withMandatoryProperty('failOnWarning', null, {backendType == BackendType.RFC}) new Utils().pushToSWA([ step: STEP_NAME, @@ -156,7 +157,10 @@ void call(parameters = [:]) { configuration.applicationDescription, configuration.abapPackage, configuration.codePage, - configuration.acceptUnixStyleLineEndings) + configuration.acceptUnixStyleLineEndings, + configuration.failOnWarning, + ) + break }