Skip to content

re-work integration tests - #162

Merged
bmarwell merged 2 commits into
mainfrom
feat/hybrid-ear-it
Aug 3, 2026
Merged

re-work integration tests#162
bmarwell merged 2 commits into
mainfrom
feat/hybrid-ear-it

Conversation

@bmarwell

@bmarwell bmarwell commented Jun 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

@codecov

codecov Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.30%. Comparing base (d78c669) to head (9a61a53).
⚠️ Report is 81 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and integration-tests/suite (actual ITs + resources) modules, activated via the run-its profile.
  • Introduce a new top-level ear module 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/add integration 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.

Comment thread ear/src/main/application/META-INF/application.xml
Comment on lines +79 to +82
<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>
Comment on lines +8 to +11
import io.github.bmarwell.keyserver.it.extension.KeyserverIntegrationTest;

@KeyserverIntegrationTest
public class AddEndpointIT {}
Comment thread integration-tests/helper/pom.xml
@bmarwell

bmarwell commented Aug 3, 2026

Copy link
Copy Markdown
Owner Author

@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.

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@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 se...

Addressed the still-relevant review items in commit 9a61a53:

  • fixed keyserver.server.xml.path in integration-tests/suite/pom.xml to point to an existing server.xml
  • corrected EAR application.xml WAR names to match the produced artifacts
  • removed the obsolete empty AddEndpointIT class

I did not change the jakarta.ws.rs-api dependency scope.

@bmarwell
bmarwell merged commit 44b9081 into main Aug 3, 2026
4 checks passed
@bmarwell
bmarwell deleted the feat/hybrid-ear-it branch August 3, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants