Skip to content

test(agent): cover an injected agent handler and pin the engine to the telemetry fix - #14

Merged
rennf93 merged 2 commits into
masterfrom
test/injected-agent-wiring
Oct 13, 2026
Merged

rennf93 merged 2 commits into
masterfrom
test/injected-agent-wiring

Conversation

@rennf93

@rennf93 rennf93 commented Oct 13, 2026

Copy link
Copy Markdown
Member

ktor-guard's code already accepts an injected agent handler, but through the engine it never worked. guard-core-jvm only added an agent to its telemetry composite when it was a HandlerAgentSink, which guard-agent-jvm's GuardAgentTelemetry is not. The agent was therefore never started and received no events. That is fixed in Guard-Core/guard-core-jvm#48 (merged as 9067b7b).

This PR:

  • Moves the pinned engine ref to 9067b7b (CI, CodeQL, release workflow, settings and docs).
  • Adds InjectedAgentWiringTest:
    • The degrade path without a handler.
    • An injected GuardAgentTelemetry-shaped handler is started, receives events and metrics (metrics via sendMetric), and is stopped on shutdown().
      Against the old pin, the second test fails with expected: <1> but was: <0>.

Local gate: ./gradlew build passes (37 tests, 0 failures) against guard-core-jvm 9067b7b. Nothing is released.

@rennf93 rennf93 added the no-issue Chore or dependency PR that does not need an issue label Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for opening your first pull request on ktor-guard!

Quick checklist before review (most of these are enforced by CI, but worth a glance):

  • The PR body says Closes #N for an open issue (the issue-link check enforces it); chores take the no-issue label
  • ./gradlew spotlessCheck detekt is clean
  • ./gradlew build passes
  • No blanket @Suppress in non-test code

See README.md for the adapter status. Welcome aboard - a maintainer will review shortly.

@github-actions github-actions Bot added documentation Docs site, README, CHANGELOG, license files ci GitHub Actions and pre-commit labels Oct 13, 2026
@rennf93 rennf93 self-assigned this Oct 13, 2026
@rennf93
rennf93 merged commit 5ce2eec into master Oct 13, 2026
9 checks passed
@rennf93
rennf93 deleted the test/injected-agent-wiring branch October 13, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci GitHub Actions and pre-commit documentation Docs site, README, CHANGELOG, license files no-issue Chore or dependency PR that does not need an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant