Skip to content

Run integration tests in CI and fix the openig-war IT suite#165

Open
vharseko wants to merge 3 commits into
OpenIdentityPlatform:masterfrom
vharseko:ci-run-integration-tests
Open

Run integration tests in CI and fix the openig-war IT suite#165
vharseko wants to merge 3 commits into
OpenIdentityPlatform:masterfrom
vharseko:ci-run-integration-tests

Conversation

@vharseko

Copy link
Copy Markdown
Member

Problem

CI (build.yml) ran mvn package, whose lifecycle stops before the integration-test/verify phases. As a result the failsafe integration tests never executed in CI:

When actually executed, the openig-war IT suite was red (3 of 4 failing), and openig-war wasn't even configured to fail the build on IT failures.

Changes

  • build.yml: mvn packagemvn verify so failsafe runs on every push/PR.
  • openig-war/pom.xml: add <goal>verify</goal> to the failsafe execution — previously only integration-test was bound, so IT failures were silently swallowed.
  • pom.xml: mirror surefire's --add-opens argLine onto the failsafe plugin. Without it, on JDK 17+ RestAssured/Groovy cannot construct AssertionError and a genuine assertion failure surfaces as a confusing GroovyRuntimeException.
  • war IT fixtures (IT_MockRoute.java, petstore-mock.json, 01-find-pet.json): the shared petstore spec declares base path /v2.1, but the mock/custom routes used /v2, so the mock handler never matched an operation → 404. Aligned request paths and route conditions to /v2.1 (unescaped dot in the JSON conditions — an escaped \. fails to compile in the EL string literal and the route is silently rejected).

No product code changed — only the CI goal, build config, and test fixtures.

Verification

Full mvn verify (the new CI command) — BUILD SUCCESS, all 16 modules green:

  • openig-war failsafe: 4 tests, 0 failures (failsafe:verify now enforces)
  • openig-doc failsafe: 10 tests, 0 failures

Enforcement confirmed both ways: with the fixtures still broken the build failed at failsafe:verify @ openig-war; after the fix it passes.

Note (out of scope)

Six @Test(enabled=false) methods in openig-core (RequestResolverTest, GroovyScriptableFilterTest, JsonValuesTest) remain disabled — enabling them requires implementing the corresponding functionality, not just flipping the flag.

Switch the CI build from `mvn package` to `mvn verify` so the failsafe
integration tests actually execute. `package` stops before the
integration-test/verify phases, so IT_MockRoute/IT_SwaggerRoute (openig-war)
and the openig-doc Sample tests never ran in CI.

Make openig-war enforce IT results: its failsafe execution only bound
`integration-test`, so failures were silently swallowed - add the `verify`
goal. Mirror surefire's `--add-opens` argLine onto the failsafe plugin so
RestAssured assertion failures report cleanly on JDK 17+ instead of a
GroovyRuntimeException.

Fix the war IT fixtures: the shared petstore spec declares base path
`/v2.1` but the mock/custom routes used `/v2`, so the mock handler never
matched an operation (404). Align the request paths and route conditions to
`/v2.1`, using an unescaped dot in the route JSON conditions (an escaped
`\.` fails to compile in the EL string literal and the route is silently
rejected).
@vharseko vharseko requested a review from maximthomas July 15, 2026 08:14
@vharseko vharseko added ci Build, CI/CD, and GitHub Actions changes tests Adds or updates tests java Pull requests that update Java code labels Jul 15, 2026
IT_MockRoute and IT_SwaggerRoute substitute an absolute spec-file path into
the route JSON and an EL `read('...')` expression. On Windows the path uses
backslashes (C:\..., D:\...), which are invalid JSON/EL escapes, so the route
JSON fails to parse and the route never loads (routeAvailable times out).
Normalise the injected paths to forward slashes, which OpenIG's read()/File
accepts on every OS (no-op on Linux/macOS).
@vharseko vharseko force-pushed the ci-run-integration-tests branch from 70b0b4e to dde1fdc Compare July 15, 2026 09:43
The auto-built OpenAPI route embeds specFile.getAbsolutePath() into an EL
`${read('...')}` string literal for the validator and mock-handler config.
On Windows the absolute path uses the '\' separator, which the EL parser
treats as an (invalid) escape sequence, so the generated route fails to parse
and never loads. Normalise the platform separator to '/', which read()/File
accept on every OS (no-op on Linux/macOS).
@vharseko vharseko force-pushed the ci-run-integration-tests branch from dde1fdc to 63791d6 Compare July 15, 2026 09:57

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Build, CI/CD, and GitHub Actions changes java Pull requests that update Java code tests Adds or updates tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants