Skip to content

fix: testkit default Host, Pekko's addHeader order, honest response headers, bounded matchers - #93

Merged
luksow merged 3 commits into
masterfrom
testkit-fidelity
Oct 18, 2026
Merged

luksow merged 3 commits into
masterfrom
testkit-fidelity

Conversation

@luksow

@luksow luksow commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Testkit fidelity, as Pekko's testkit (T1–T4):

  • Default host: ~> adds Host: example.com to a request that names no host (implicit DefaultHostInfo to change it), so host(...) and extractHost work in tests. Pekko's testkit uses the same host but rewrites the URI to an absolute one instead; stir keeps the URI as given because stir's server hands routes the URI as received, so tests stay faithful to production (documented as a difference).
  • addHeader prepends and addHeaders appends, as Pekko, instead of replacing; a later addHeader is still what a typed lookup finds. The entity headers (Content-Type, Content-Length, Transfer-Encoding), which Pekko keeps in the entity, still replace, so the common "override the body's content type" pattern keeps working.
  • response no longer gains a Transfer-Encoding: chunked the route never sent.
  • Bounded matchers: evaluateTo, haveFailedWith and the marshalling helpers fail after marshallingTimeout (1 s, as Pekko, overridable) instead of hanging.

⚠️ Users' tests that assert every request header or a logged request line will now see Host: example.com (our own logging spec needed that update); flagged in migration.md. Binary compatible with 0.7.0 (the old implicit injectIntoRoute stays as a deprecated plain method).


Part of the 0.7.1 stack (audit 2 minor items). Stacked: merge in order #1 → #10; each PR is based on the previous one, so none of them conflicts on docs/migration.md. Every PR: test written first and seen failing, full local verify (Scala 3 + 2.13 tests, JS/Native compile, docs, MiMa against 0.7.0), independent review with its findings fixed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HBTSjzt7V6GBL6i5bqnYea

luksow and others added 3 commits October 18, 2026 19:20
…rs, bounded matchers, as Pekko's testkit

- ~> adds Host: example.com to a request that names no host (DefaultHostInfo
  to change it), so host(...) and extractHost work in tests; the URI stays as
  given, as stir's server hands routes the URI as received.
- addHeader / addHeaders add after a header of the same name instead of
  replacing it; the entity headers (Content-Type, Content-Length,
  Transfer-Encoding), which Pekko keeps in the entity, still replace.
- response no longer gains a Transfer-Encoding: chunked the route never sent.
- evaluateTo, haveFailedWith and the marshalling helpers fail after
  marshallingTimeout (1 s, overridable) instead of hanging the suite.

The old implicit injectIntoRoute stays as a plain method for binary
compatibility.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBTSjzt7V6GBL6i5bqnYea
…unparseable Host; the default host is a Host header, not Pekko's URI rewrite

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBTSjzt7V6GBL6i5bqnYea
…ecs2 timeout tests; note the override for an own marshallingTimeout

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBTSjzt7V6GBL6i5bqnYea
@luksow
luksow force-pushed the websocket-upgrade-checks branch from 659ed02 to db2fb80 Compare October 18, 2026 19:28
Base automatically changed from websocket-upgrade-checks to master October 18, 2026 20:05
@luksow
luksow merged commit 043f184 into master Oct 18, 2026
22 of 31 checks passed
@luksow
luksow deleted the testkit-fidelity branch October 18, 2026 20:06
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