Skip to content

test(node-integration-tests): Type-check test suites in CI#22054

Merged
mydea merged 1 commit into
feat/required-streamed-span-attributesfrom
test/node-integration-suite-type-check
Jul 8, 2026
Merged

test(node-integration-tests): Type-check test suites in CI#22054
mydea merged 1 commit into
feat/required-streamed-span-attributesfrom
test/node-integration-suite-type-check

Conversation

@mydea

@mydea mydea commented Jul 8, 2026

Copy link
Copy Markdown
Member

The suites/** test files in node-integration-tests were never type-checked, so type errors only ever surfaced in the editor — never in CI. This adds a CI gate that type-checks the suites and fixes the ~2000 latent errors it surfaced.

Root cause

  • yarn type-check runs a bare tsc, whose tsconfig.json only includes utils/** and src/** — not suites/**.
  • yarn test (vitest) transpiles with esbuild, which strips types without checking them.

With nothing exercising the suite types, errors accumulated silently.

Changes

  • Add type-check:src / type-check:test scripts (both --noEmit, so a bare run can't scatter .js next to sources) and run yarn type-check for the package in the Lint CI job.
  • Relax noUncheckedIndexedAccess for test code — indexing into span attributes/arrays that are known to exist at that point shouldn't require ! everywhere — and exclude the Prisma CLI config, whose runtime shape intentionally differs from @prisma/config's exported types.
  • Give createTestServer an explicit return type so chained .get() calls infer their headers callback parameter (previously only the first .get() was typed).
  • Add a getStringAttributeValue helper to narrow union-typed span attribute values in the AI tracing assertions (includes / startsWith / match / length).
  • Fix the vitest reporter config to the valid nested-tuple form.

All changes are type-level / test-scoped and runtime-transparent.


Stacked on top of #22052, which makes attributes required on SerializedStreamedSpan — merge that one first.

@mydea mydea requested a review from a team as a code owner July 8, 2026 09:00
@mydea mydea requested review from JPeer264 and andreiborza and removed request for a team July 8, 2026 09:00

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about the other integration test suites we have?

@mydea

mydea commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

What about the other integration test suites we have?

we can look at those in a follow up I'd say! node-core is going away so would not bother with this, but makes sense to do the same for bun, deno and cloudflare I suppose :)

@mydea mydea force-pushed the test/node-integration-suite-type-check branch from 4ae9281 to 2e57e43 Compare July 8, 2026 09:05
@mydea mydea deleted the branch feat/required-streamed-span-attributes July 8, 2026 09:05
@mydea mydea closed this Jul 8, 2026
@mydea mydea reopened this Jul 8, 2026
@mydea mydea changed the base branch from feat/streamed-span-required-attributes to feat/required-streamed-span-attributes July 8, 2026 09:06
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.59 kB - -
@sentry/browser - with treeshaking flags 26.03 kB - -
@sentry/browser (incl. Tracing) 46.27 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.03 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.03 kB - -
@sentry/browser (incl. Tracing, Replay) 85.56 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.17 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.26 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.91 kB - -
@sentry/browser (incl. Feedback) 44.76 kB - -
@sentry/browser (incl. sendFeedback) 32.38 kB - -
@sentry/browser (incl. FeedbackAsync) 37.51 kB - -
@sentry/browser (incl. Metrics) 28.67 kB - -
@sentry/browser (incl. Logs) 28.91 kB - -
@sentry/browser (incl. Metrics & Logs) 29.59 kB - -
@sentry/react 29.38 kB - -
@sentry/react (incl. Tracing) 48.53 kB - -
@sentry/vue 33.03 kB - -
@sentry/vue (incl. Tracing) 48.16 kB - -
@sentry/svelte 27.61 kB - -
CDN Bundle 30 kB - -
CDN Bundle (incl. Tracing) 48.26 kB - -
CDN Bundle (incl. Logs, Metrics) 31.57 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.57 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.81 kB - -
CDN Bundle (incl. Tracing, Replay) 85.73 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.04 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.55 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.83 kB - -
CDN Bundle - uncompressed 89.35 kB - -
CDN Bundle (incl. Tracing) - uncompressed 145.99 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.96 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.75 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.16 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.12 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.86 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.81 kB - -
@sentry/nextjs (client) 50.94 kB - -
@sentry/sveltekit (client) 46.68 kB - -
@sentry/core/server 78.38 kB - -
@sentry/core/browser 64.74 kB - -
@sentry/node-core 62.72 kB -0.01% -1 B 🔽
@sentry/node 124.6 kB - -
@sentry/node (incl. diagnostics channel injection) 132.88 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB - -
@sentry/node/light 50.72 kB - -
@sentry/node - without tracing 74.05 kB - -
@sentry/aws-serverless 85.5 kB - -
@sentry/cloudflare (withSentry) - minified 181.68 kB - -
@sentry/cloudflare (withSentry) 449.39 kB - -

View base workflow run

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I second what @andreiborza meant, but follow up is fine as well

@mydea mydea force-pushed the feat/required-streamed-span-attributes branch from 509ce9d to 9f80421 Compare July 8, 2026 11:34
The `suites/**` test files were never type-checked: `yarn type-check` runs a
bare `tsc` (whose config only includes `utils/**` + `src/**`) and vitest
transpiles with esbuild, so type errors only ever showed up in the editor. This
adds a CI gate that type-checks the suites and fixes the latent errors it
surfaced.

- Add `type-check:src` / `type-check:test` scripts (both `--noEmit`) and run
  `yarn type-check` for the package in the Lint CI job.
- Relax `noUncheckedIndexedAccess` for test code and exclude the Prisma CLI
  config (its runtime shape intentionally differs from `@prisma/config`'s types).
- Give `createTestServer` an explicit return type so chained `.get()` calls
  infer their `headers` callback parameter.
- Add a `getStringAttributeValue` helper to narrow union-typed span attribute
  values in the AI tracing assertions.
- Fix the vitest reporter config to the valid nested-tuple form.

Relies on `attributes` being required on `SerializedStreamedSpan` (see the
change this is stacked on).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea mydea force-pushed the test/node-integration-suite-type-check branch from 2e57e43 to 3ceac73 Compare July 8, 2026 11:36
@mydea mydea merged commit 0e42a84 into develop Jul 8, 2026
260 checks passed
@mydea mydea deleted the test/node-integration-suite-type-check branch July 8, 2026 12:47
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.

4 participants