Skip to content

test(fixtures): accept elapsed_ms in the packed platform consumer check - #500

Merged
barryroodt merged 3 commits into
mainfrom
barryroodt/fix-packed-consumer-elapsed-ms
Oct 29, 2026
Merged

barryroodt merged 3 commits into
mainfrom
barryroodt/fix-packed-consumer-elapsed-ms

Conversation

@barryroodt

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix, test fixture only.

What is the current behavior?

pnpm test:packed-platform-consumer has been failing on main since #483. That PR added elapsed_ms to the input_response observation fact, and the fixture's exact-shape deepEqual on the destructive-SQL resume facts doesn't expect the key, so it throws there. Everything after that line gets skipped for the packaged artifact, including the privacy checks (no PRIVATE_ value and no destructive-SQL requestState token in the recorded observation scopes). CI doesn't run this check, which is why nothing flagged it.

What is the new behavior?

scripts/fixtures/packed-platform-consumer/modern-call.mjs accepts elapsed_ms on that fact the same way it already accepts durationMs on the returned operation fact. The shape check stays exact and the value has to be a finite number >= 0, so a missing elapsed_ms or any other extra key still fails.

Verification

pnpm install --frozen-lockfile
pnpm test:packed-platform-consumer

The script builds both packages itself. With this change it prints [PASS] modern-mcp-call and exits 0. On main it fails at the resume-facts deepStrictEqual, with a diff showing the extra elapsed_ms key.

@barryroodt
barryroodt requested a review from a team as a code owner October 29, 2026 09:20
@coveralls

coveralls commented Oct 29, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 40859234270

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.002%) to 97.62%

Details

  • Coverage increased (+0.002%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 3 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

3 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
packages/mcp-server-supabase/src/transports/local-http-entry.ts 3 97.61%

Coverage Stats

Coverage Status
Relevant Lines: 5769
Covered Lines: 5662
Line Coverage: 98.15%
Relevant Branches: 1122
Covered Branches: 1065
Branch Coverage: 94.92%
Branches in Coverage %: Yes
Coverage Strength: 169.18 hits per line

💛 - Coveralls

barryroodt added a commit that referenced this pull request Oct 29, 2026
…erministic (#501)

## What kind of change does this PR introduce?

Test fix (flaky test). Test-only, one file, no package or changelog
impact.

## What is the current behavior?

`should generate a password with symbols` in
`packages/mcp-server-supabase/src/password.test.ts` is flaky. It failed
the Tests job on #500 and passed on rerun.

The test calls `generatePassword({ symbols: true })` and asserts at
least one symbol. That draws 10 characters uniformly from letters +
symbols, and nothing guarantees a symbol appears. The regex also had
`/-=` inside the character class, which is a range from `/` to `=`, so
digits counted as symbols and a literal `-` didn't. Together that makes
it fail about 1.4% of runs: (53/81)^10, where 53 is the 52 letters plus
`-`.

## What is the new behavior?

The test disables letters, like the existing `with numbers` test already
does, and asserts no character is a letter or digit. It can't fail by
chance any more, and it fails on every run if the symbols option adds
nothing or adds letters or digits instead of symbols.

I fixed the test and left `generatePassword` alone. Its only production
caller is `createProject`, which generates a 16-character `db_pass` from
letters and numbers and never enables symbols. The Management API types
give `db_pass` as a plain string with no character-class rule. So the
options choose which sets to draw from without promising that each set
appears, and changing the generator would change behavior that nothing
depends on.

## Verification

`pnpm --filter @supabase/mcp-server-supabase exec vitest run
src/password.test.ts` passes, and repeat runs stay green. Mutating
`generatePassword` so the symbols option adds nothing, or adds uppercase
letters or digits instead of symbols, fails the test on every run.

@Rodriguespn Rodriguespn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @barryroodt. I was able to reproduced it locally.

A small nit: none of our workflows run test:packed-platform-consumer, which is how #483 got past us. Could we add it as a step in tests.yml after Build libs? Then a change to the public surface would fail the PR that causes it, instead of leaving the privacy assertions skipped on main until someone happens to run the script. Wdyt?

@barryroodt

Copy link
Copy Markdown
Contributor Author

LGTM, thanks @barryroodt. I was able to reproduced it locally.

A small nit: none of our workflows run test:packed-platform-consumer, which is how #483 got past us. Could we add it as a step in tests.yml after Build libs? Then a change to the public surface would fail the PR that causes it, instead of leaving the privacy assertions skipped on main until someone happens to run the script. Wdyt?

Good call, fixed.

@barryroodt
barryroodt merged commit dbed1c8 into main Oct 29, 2026
5 checks passed
barryroodt added a commit that referenced this pull request Oct 30, 2026
## What kind of change does this PR introduce?

CI fix. Two small follow-ups from reviewing the `Packed platform
consumer check` step added in #500.

- The step sets `env: ANTHROPIC_API_KEY: ''`, so the step and its child
processes see an empty key. Prevents possible leak to an env which does
not use the key.
- The fixture pins `@modelcontextprotocol/node` to the same SDK version
constant. This removes the `ERESOLVE`, and the fixture now tests the SDK
set the package is built against.
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.

3 participants