Skip to content

fix: serve external $ref fixtures from a local HTTP server in tests#103

Merged
SebastianDT1 merged 1 commit into
developfrom
fix/offline-external-ref-tests
May 5, 2026
Merged

fix: serve external $ref fixtures from a local HTTP server in tests#103
SebastianDT1 merged 1 commit into
developfrom
fix/offline-external-ref-tests

Conversation

@rafael-goterris
Copy link
Copy Markdown
Contributor

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

Several external $ref tests resolve their references against https://raw.githubusercontent.com/apiaddicts/sonaropenapi-rules/.... This forces the test suite to make outbound HTTPS calls to GitHub during mvn test, which fails in restricted or offline environments (corporate networks, CI runners without egress, air-gapped setups) and also makes the tests dependent on the availability of GitHub and on the contents of the master branch at test time.

Affected tests: OAR031 (v2 and v3), OAR094, OAR068, OAR086.

What is the new behavior?

  • Added a new test utility ExternalRefHttpServer that starts a lightweight in-process HTTP server on http://localhost:18089, serving the YAML files under src/test/resources/externalRef/.
  • BaseCheckTest.beforeClass starts the server once for the test suite, so all checks resolving external $refs do it against localhost` instead of the public internet.
  • Updated the affected fixtures (OAR031 v2/v3, OAR094, OAR068, OAR086) to point to http://localhost:18089/<file>.yaml instead of the raw.githubusercontent.com URLs.
  • Bumped version to 1.3.6 in pom.xml and added the corresponding entry to CHANGELOG.md.

Other information

  • The fixture files under src/test/resources/externalRef/ are unchanged; only the URLs that reference them have been switched to localhost.
  • The HTTP server binds to 127.0.0.1 only and is shut down via a JVM shutdown hook, so it does not leak between builds.
  • No production code is modified — changes are scoped to the test suite, the version bump and the changelog.

@SebastianDT1 SebastianDT1 merged commit dcf9412 into develop May 5, 2026
@SebastianDT1 SebastianDT1 deleted the fix/offline-external-ref-tests branch May 5, 2026 17:48
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.

2 participants