Skip to content

tests: cover documented recipe claims that had no test#19

Merged
zspitzer merged 5 commits intomasterfrom
test-coverage-gaps
Apr 20, 2026
Merged

tests: cover documented recipe claims that had no test#19
zspitzer merged 5 commits intomasterfrom
test-coverage-gaps

Conversation

@zspitzer
Copy link
Copy Markdown
Member

Summary

  • Audits the doc/claims → test-coverage gap spotted in docs/recipes/websocket-extension.md; adds integration tests for every gap except JWT/Example-Listener patterns (deferred — different scope).
  • Adds tests/README.md documenting the two-tier structure (extension tests vs integration tests) and the cross-repo relationship with extension-websocket-client.
  • Splits test-config-override into a matrix over env-var (LUCEE_WEBSOCKET_CONFIG) and jvm-arg (-Dlucee.websocket.config=) — only the env-var path was previously exercised.

New integration tests

  • test-session-access + SessionAccessListener — exercises wsClient.getSession() accessors (getId / getUserProperties / getRequestParameterMap), multi-tab per-connection identity, and handshake cookie/form scope isolation. Parked in CI pending LDEV-6277 — the getSession() accessor isn't exposed on WSClient; re-enable once the Java fix lands.
  • test-onfirstopen-rearm + RearmListener — asserts onFirstOpen re-fires after the channel drains (documented re-arm behaviour).
  • test-onopen-async + OnOpenAsyncListener — asserts onOpenAsync runs on a different thread than onOpen.
  • test-request-timeout + LongOnFirstOpenListener — asserts requestTimeout kills long-running work inside onFirstOpen (the documented warning against while-loops there).

Incidental workflow tweaks

  • Widened the event-log glob from /tmp/ws-*-events.log/tmp/ws-*.log so new test listeners get their logs dumped on failure.
  • Artifact names include the matrix mode for the config-override job.

Test plan

  • All 10 integration tests pass on Lucee 6.2 (javax) and 7.0 (jakarta)
  • Both test-config-override matrix jobs (env-var + jvm-arg) pass
  • test-websocket-info, test-idle-timeout, existing integration suite still green
  • test-session-access parked, with pointer to LDEV-6277 for re-enable

Adds integration tests for gaps spotted against docs/recipes/websocket-extension.md:

- test-session-access: getSession().getId/getUserProperties/getRequestParameterMap;
  multi-tab (per-connection session ids, per-connection userProperties isolation);
  handshake isolation (cookie + form scopes empty in listener)
- test-onfirstopen-rearm: onFirstOpen fires again after onLastClose drains the channel
- test-onopen-async: onOpenAsync runs on a different thread than onOpen
- test-request-timeout: requestTimeout kills long-running work inside onFirstOpen

Also splits test-config-override into a matrix covering both the env-var
(LUCEE_WEBSOCKET_CONFIG) and JVM arg (-Dlucee.websocket.config=) override paths —
only the env-var path was previously exercised.

CI log-dump glob widened from /tmp/ws-*-events.log to /tmp/ws-*.log so newly
added event logs get dumped on failure.
The async onLastClose thread races the sample window. The real claim is
that onFirstOpen fires twice; onLastClose existence is already covered
by test-lifecycle-callbacks.
@zspitzer zspitzer merged commit cd33cf1 into master Apr 20, 2026
15 checks passed
@zspitzer zspitzer deleted the test-coverage-gaps branch April 20, 2026 13:03
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.

1 participant