This is an automated email from the ASF dual-hosted git repository. khmarbaise pushed a commit to branch TEST_TO_FIX_MCOMPILER-192 in repository https://gitbox.apache.org/repos/asf/maven-compiler-plugin.git
commit 4e054a02e78f8130a8499d9e92425b84fa734866 Author: Karl Heinz Marbaise <[email protected]> AuthorDate: Sun Mar 25 20:48:53 2018 +0200 Trying to fix MCOMPILER-192 with different checking of the log output cause the output is different for different platforms and OS's. --- Jenkinsfile | 2 +- src/it/MCOMPILER-192/pom.xml | 3 +++ src/it/MCOMPILER-192/verify.groovy | 26 +++++++++++++++++++++++--- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 09ac70f..244b345 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,4 +17,4 @@ * under the License. */ -asfMavenTlpStdBuild() +asfMavenTlpStdBuild( [ 'failFast' : false ] ) diff --git a/src/it/MCOMPILER-192/pom.xml b/src/it/MCOMPILER-192/pom.xml index 6cb5c74..2e38b5a 100644 --- a/src/it/MCOMPILER-192/pom.xml +++ b/src/it/MCOMPILER-192/pom.xml @@ -29,6 +29,9 @@ under the License. <version>1.0</version> <packaging>jar</packaging> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> <build> <plugins> <plugin> diff --git a/src/it/MCOMPILER-192/verify.groovy b/src/it/MCOMPILER-192/verify.groovy index b6785e2..2c74a9c 100644 --- a/src/it/MCOMPILER-192/verify.groovy +++ b/src/it/MCOMPILER-192/verify.groovy @@ -19,10 +19,30 @@ */ def logFile = new File( basedir, 'build.log' ) assert logFile.exists() -content = logFile.text +def content = logFile.getText('UTF-8') + +def jenkins = System.getenv ( 'JENKINS_URL' ); + +println "Jenkins: ${jenkins}" + +def causedByExpected = content.contains ( 'Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure' ) +def twoFilesBeingCompiled = content.contains ( '[INFO] Compiling 2 source files to ' ) +def checkResult = content.contains ( '[INFO] BUILD FAILURE' ) +def compilationFailure1 = content.contains( '[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:') + +// This is the message on JDK 7 / Windows +// [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.1-SNAPSHOT:compile (default-compile) on project blah: Compilation failure +// This is the message on JKD 8 / Linux +// [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.1-SNAPSHOT:compile (default-compile) on project blah: Compilation failure -> [Help 1] + +def compilationFailure2 = content.contains( ':compile (default-compile) on project blah: Compilation failure') + +println "Jenkins: causedByExpected:${causedByExpected} twoFilesBeingCompiled:${twoFilesBeingCompiled} checkResult: ${checkResult} compilationFailure1: ${compilationFailure1} compilationFailure2: ${compilationFailure2}" + +def finalResult = twoFilesBeingCompiled && checkResult && causedByExpected && compilationFailure1 && compilationFailure2 // Disable for Jenkins. Once fixed, this test will fail again. In that case remove the JENKINS_URL again. -if( !content.contains( 'Usage: javac <options> <source files>' ) ^ System.getenv( 'JENKINS_URL') != null ){ - throw new RuntimeException( "log not containing Usage: javac <options> <source files> but <startLog>" + content + "</startLog>") +if ( !finalResult ) { + throw new RuntimeException( "log does not contain expected result to be failed but <startLog>" + content + "</startLog>") } -- To stop receiving notification emails like this one, please contact [email protected].
