Skip to content

test: set Content-Type in empty-array round-trip trace RBAC tests - #942

Merged
pavolloffay merged 1 commit into
observatorium:mainfrom
IshwarKanse:fix-trace-rbac-tests-content-type
Oct 22, 2026
Merged

pavolloffay merged 1 commit into
observatorium:mainfrom
IshwarKanse:fix-trace-rbac-tests-content-type

Conversation

@IshwarKanse

Copy link
Copy Markdown
Contributor

Problem

main's test job has been red since #934 was merged (d17ce87):

--- FAIL: TestSearchResponseEmptyTracesPreserved
--- FAIL: TestTraceByIDResponseEmptyResourceSpansPreserved
    unsupported content type: ""

This is a semantic conflict between two PRs that each passed CI on their own:

Fix

Set Content-Type: application/json in both tests, the same default the makeResponse helper in this file already uses. Test-only change. The assertions still go through the JSON unmarshaler, so the empty-array round-trip they protect is still covered, and #937's stricter content-type handling is unchanged.

Verification

  • go test -race -short on all unit packages (e2e excluded, as in make test-unit) passes.
  • go vet and gofmt are clean.
  • Before the change, the two tests fail on main (0b8e429) with the error above.

The test-e2e failure on the d17ce87 push (TestMetricsReadAndWrite/OIDC_redirect_protection) is unrelated: #934 doesn't touch the metrics path, and test-e2e is green on the next main push (0b8e429).

🤖 Generated with Claude Code

TestSearchResponseEmptyTracesPreserved and
TestTraceByIDResponseEmptyResourceSpansPreserved (added in observatorium#934) build
their http.Response with an empty header and relied on unmarshal()
falling back to JSON for a missing Content-Type.

observatorium#937 made unmarshal()/marshal() return "unsupported content type" for
anything other than protobuf or JSON. observatorium#934's CI ran against a base from
before observatorium#937, so the tests passed on the PR but fail on main since the
merge (d17ce87).

Set Content-Type: application/json in both tests, matching what the
makeResponse helper in this file already does. The assertions still go
through the JSON unmarshaler, so the empty-array round-trip they exist
to protect is still covered.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pavolloffay
pavolloffay merged commit 9eb32eb into observatorium:main Oct 22, 2026
5 checks passed
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