Skip to content

feat: integration test metrics#57

Merged
jamespfaulkner merged 1 commit into
mainfrom
feat/integration-test-metrics
Jun 26, 2026
Merged

feat: integration test metrics#57
jamespfaulkner merged 1 commit into
mainfrom
feat/integration-test-metrics

Conversation

@jamespfaulkner

Copy link
Copy Markdown
Contributor

Summary

  • New integration testsApiaryGlueSyncMetricsIntegrationTest gains four tests that verify GlueSync counters are exported via the actuator metrics and Prometheus endpoints, that counters increment
    correctly on events, and that failure counters fire when the Glue API is unreachable.
  • Reliable test synchronisationDroneFlyIntegrationTest.typical() now waits for the Kafka consumer to commit its offset (via AdminClient) before asserting listener state, replacing the previous
    polling on DummyListener.getNumEvents() which could race with dispatch. A springMetricsIncrease guard also confirms the fetch metric incremented first.
  • Thread safety fixDummyListener.notifyList changed from ArrayList to CopyOnWriteArrayList; the runner thread writes and the test thread reads/clears without synchronisation.
  • Structural cleanup — support classes (DummyListener, DroneFlyIntegrationTestUtils, SpringMetricsUtils, AsyncApplicationRunner, AsyncRunnerConfig) moved to a .support sub-package.
    DroneFly no longer implements ApplicationContextAware or holds a static ApplicationContext field, which prevented proper isolation between @SpringBootTest contexts. AsyncApplicationRunner logs
    failures instead of silently swallowing them.
  • Build hygiene.editorconfig added, .sdkmanrc updated to JDK 21 (matching maven.compiler.release=21), apiary.extensions.version pinned to stable 8.2.0.

Test plan

  • DroneFlyIntegrationTest#typical — passes locally (verified)
  • Full drone-fly-integration-tests module — mvn test -pl drone-fly-integration-tests
  • Confirm no compilation errors in drone-fly-app after ApplicationContextAware removal

…vements

- Add SpringMetricsUtils and GlueSync metrics integration tests
- Move integration test support classes into .support sub-package
- Replace race-prone await on DummyListener with Kafka fetch metric
  guard + awaitOffsetCommitted via AdminClient for reliable sync
- DummyListener: ArrayList → CopyOnWriteArrayList (JMM data race fix)
- DroneFly: remove ApplicationContextAware and static context field
  to prevent Spring test context clobbering
- AsyncApplicationRunner: log runner failures instead of swallowing
- DroneFlyIntegrationTest: remove dead records/container infrastructure
- SpringMetricsUtils.metricValue: replace manual URI string-building
  with UriComponentsBuilder (fixes trailing & and silent tag-skip)
- Add .editorconfig, update .sdkmanrc to JDK 21
- Pin apiary.extensions.version to stable 8.2.0 (was SNAPSHOT)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jamespfaulkner jamespfaulkner marked this pull request as ready for review June 25, 2026 14:14
@jamespfaulkner jamespfaulkner requested a review from a team as a code owner June 25, 2026 14:14
@jamespfaulkner jamespfaulkner merged commit 5e66713 into main Jun 26, 2026
1 check passed
@jamespfaulkner jamespfaulkner deleted the feat/integration-test-metrics branch June 26, 2026 09:47
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