re-work integration tests - #162
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #162 +/- ##
=========================================
Coverage 77.30% 77.30%
Complexity 187 187
=========================================
Files 40 40
Lines 608 608
Branches 53 53
=========================================
Hits 470 470
Misses 108 108
Partials 30 30 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR restructures the project’s integration-test setup by extracting shared Testcontainers/JUnit infrastructure into a reusable helper module, introducing a dedicated integration-test suite module, and packaging the web apps as an EAR to be deployed into the Liberty test container.
Changes:
- Add new
integration-tests/helper(shared JUnit/Testcontainers extension utilities) andintegration-tests/suite(actual ITs + resources) modules, activated via therun-itsprofile. - Introduce a new top-level
earmodule and wire it into the reactor for building/deploying both web WARs together. - Add Testcontainers + logging test resources for the new suite module, and add a first HKP
/pks/addintegration test.
Reviewed changes
Copilot reviewed 18 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| web/openpgp-keyserver-protocol/src/it/java/io/github/bmarwell/keyserver/web/pks/AddEndpointIT.java | Adds a placeholder IT class for the PKS add endpoint under the web module. |
| web/openpgp-keyserver-protocol/pom.xml | Adds a run-its profile to include src/it/java as test sources and pull in the IT helper dependency. |
| pom.xml | Adds the new ear module and manages maven-ear-plugin version. |
| integration-tests/suite/src/test/resources/testcontainers.properties | Adds suite-level Testcontainers config (Ryuk disabled). |
| integration-tests/suite/src/test/resources/logback-test.xml | Adds suite-level logback configuration for test output verbosity. |
| integration-tests/suite/src/test/java/io/github/bmarwell/keyserver/it/support/package-info.java | Sets @NullMarked for the suite support package. |
| integration-tests/suite/src/test/java/io/github/bmarwell/keyserver/it/package-info.java | Sets @NullMarked for the suite test package. |
| integration-tests/suite/src/test/java/io/github/bmarwell/keyserver/it/AddKeyIT.java | Adds an end-to-end integration test for POST /pks/add including DB verification. |
| integration-tests/suite/pom.xml | New suite module POM (EAR dependency, failsafe profile, pre-IT setup). |
| integration-tests/src/test/java/io/github/bmarwell/keyserver/it/extension/KeyserverIntegrationTest.java | Removes the old in-module @KeyserverIntegrationTest (moved to helper). |
| integration-tests/src/test/java/io/github/bmarwell/keyserver/it/extension/KeyserverInstance.java | Removes the old in-module KeyserverInstance (moved to helper). |
| integration-tests/src/test/java/io/github/bmarwell/keyserver/it/extension/KeyserverAccess.java | Removes the old in-module KeyserverAccess (moved to helper). |
| integration-tests/src/test/java/io/github/bmarwell/keyserver/it/extension/DatabaseSeed.java | Removes the old in-module @DatabaseSeed (moved/simplified in helper). |
| integration-tests/pom.xml | Converts integration-tests into a profile-activated multi-module aggregator (helper + suite). |
| integration-tests/helper/src/main/java/io/github/bmarwell/keyserver/it/support/TestPgpKeyGenerator.java | Adds runtime OpenPGP key generation for ITs (BouncyCastle-based). |
| integration-tests/helper/src/main/java/io/github/bmarwell/keyserver/it/extension/package-info.java | Sets @NullMarked for helper extension package. |
| integration-tests/helper/src/main/java/io/github/bmarwell/keyserver/it/extension/KeyserverTestImage.java | Centralizes Liberty base image/tag and readiness log regex. |
| integration-tests/helper/src/main/java/io/github/bmarwell/keyserver/it/extension/KeyserverIntegrationTest.java | Reintroduces @KeyserverIntegrationTest in the helper module. |
| integration-tests/helper/src/main/java/io/github/bmarwell/keyserver/it/extension/KeyserverInstance.java | Reintroduces KeyserverInstance record in helper module. |
| integration-tests/helper/src/main/java/io/github/bmarwell/keyserver/it/extension/KeyserverContainerExtension.java | Updates container build/start logic to deploy a single deployable (EAR) and refines holder initialization behavior. |
| integration-tests/helper/src/main/java/io/github/bmarwell/keyserver/it/extension/KeyserverAccess.java | Reintroduces KeyserverAccess interface in helper module. |
| integration-tests/helper/src/main/java/io/github/bmarwell/keyserver/it/extension/DatabaseSeed.java | Reintroduces a simplified @DatabaseSeed annotation in helper module. |
| integration-tests/helper/pom.xml | New helper module POM defining Testcontainers/JUnit/logging/JAX-RS/crypto dependencies and a profile to copy the PostgreSQL driver. |
| ear/src/main/application/META-INF/application.xml | Adds EAR application descriptor defining modules and context-roots. |
| ear/pom.xml | Adds new EAR module packaging the two WARs with maven-ear-plugin. |
Suppressed comments (1)
ear/src/main/application/META-INF/application.xml:19
- The value doesn’t match the WAR filename that Maven produces for the keyserver-web-rest module (default is -.war). If the filename is wrong, the REST web module won’t be deployed from the EAR.
<module>
<web>
<web-uri>io.github.bmarwell.keyserver-keyserver-web-rest-0.1.0-SNAPSHOT.war</web-uri>
<context-root>/api</context-root>
</web>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <keyserver.deployable.path>${project.build.directory}/dependency/keyserver-ear-${project.version}.ear</keyserver.deployable.path> | ||
| <keyserver.server.xml.path>${project.basedir}/src/main/liberty/config/server.xml</keyserver.server.xml.path> | ||
| <keyserver.pgsql.jar.path>${project.build.directory}/libs/postgresql.jar</keyserver.pgsql.jar.path> | ||
| </systemPropertyVariables> |
| import io.github.bmarwell.keyserver.it.extension.KeyserverIntegrationTest; | ||
|
|
||
| @KeyserverIntegrationTest | ||
| public class AddEndpointIT {} |
|
@copilot check if this is still relevant. If so, make sense of the review comments and fix them. Do not "fix" the dependency-scope of jakarta.ws.rs-api: it is a helper where the compile scope makes sense as we use it in tests. |
Addressed the still-relevant review items in commit
I did not change the |
No description provided.