Recently, we have ported our build pipeline from jenkins build to Github Actions. We build our application WAR using mvn clean deploy -U -B -s settings.xml
Our artifact repositry is Jfrog and we have different users creds to be used in both jenkins app build and Github actions build pipeline.
The weird problem is that we saw the number of classes getting compiled are significant less in Github Actions build as compared to jenkins which results in failure of test cases later.
Here are the logs from maven:
Jenkins:
[INFO] --- gmavenplus-plugin:1.3:compile (default) @ myapp-service ---
[INFO] No sources specified for compilation. Skipping.
[INFO]
[INFO] --- build-helper-maven-plugin:3.2.0:add-test-source (add-integration-test-sources) @ myapp-service ---
[INFO] Test Source directory: C:DBuildCIjavasrctest-integrationgroovy added.
[INFO] Test Source directory: C:DBuildCIjavasrctest-integrationjava added.
[INFO]
[INFO] --- gmavenplus-plugin:1.3:testGenerateStubs (default) @ myapp-service ---
[INFO] Using Groovy 3.0.12 to perform testGenerateStubs.
[INFO] Generated 0 stubs.
[INFO]
[INFO] --- build-helper-maven-plugin:3.2.0:add-test-resource (add-integration-test-resources) @ myapp-service ---
[INFO]
[INFO] --- maven-resources-plugin:3.3.1:testResources (default-testResources) @ myapp-service ---
[INFO] Copying 86 resources from srctestresources to targettest-classes
[INFO] Copying 251 resources from srctest-integrationresources to targettest-classes
[INFO]
[INFO] --- maven-compiler-plugin:3.11.0:testCompile (default-testCompile) @ myapp-service ---
[INFO] Changes detected - recompiling the module! :dependency
[INFO] Compiling 452 source files with javac [debug release 17] to targettest-classes
GitHub Actions:
[INFO] Test Source directory: /java/src/test-integration/java added.
[INFO]
[INFO] --- gmavenplus-plugin:1.3:testGenerateStubs (default) @ myapp-service ---
[INFO] No sources specified for stub generation. Skipping.
[INFO]
[INFO] --- build-helper-maven-plugin:3.2.0:add-test-resource (add-integration-test-resources) @ myapp-service ---
[INFO]
[INFO] --- maven-resources-plugin:3.3.1:testResources (default-testResources) @ myapp-service ---
[INFO] Copying 86 resources from src/test/resources to target/test-classes
[INFO] Copying 251 resources from src/test-integration/resources to target/test-classes
[INFO]
[INFO] --- maven-compiler-plugin:3.11.0:testCompile (default-testCompile) @ myapp-service ---
[INFO] Changes detected - recompiling the module! :dependency
[INFO] Compiling 199 source files with javac [debug release 17] to target/test-classes
[INFO] -------------------------------------------------------------
Error: COMPILATION ERROR :
[INFO] -------------------------------------------------------------
Error: /java/src/test-integration/java/com/service/core/repository/mongodb/AbstractMongoIntegrationTest.java:[16,35] cannot find symbol
symbol: class IntegrationTestDataUtility
location: package com.service.util
Error: /java/src/test-integration/java/com/service/core/repository/mongodb/AbstractMongoIntegrationTest.java:[71,19] cannot find symbol
symbol: class IntegrationTestDataUtility
location: class com.service.core.repository.mongodb.AbstractMongoIntegrationTest
[INFO] 2 errors
IntegrationTestDataUtility is a groovy class. I am thinking that the error is because the number of classes compiled are 199 which is less than actual 452 so many are not present at runtime during integration tests execution. My local machine during code build is also showing 452 classes and 199 is the only difference we found when compared Jenkins Vs Github actions logs.
Would appreciate if someone can tell why the difference in number of classes being compiled .
5