Skip to content

Organize SDK tests and enforce 98% source coverage - #2034

Merged
HAYDEN-OAI merged 1 commit into
mainfrom
dev/hayden/openai-node-test-coverage
Jul 30, 2026
Merged

Organize SDK tests and enforce 98% source coverage#2034
HAYDEN-OAI merged 1 commit into
mainfrom
dev/hayden/openai-node-test-coverage

Conversation

@HAYDEN-OAI

@HAYDEN-OAI HAYDEN-OAI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Separate Stainless-generated API contract tests from handwritten unit tests with dedicated test:unit, test:generated, and test:coverage commands.
  • Add focused coverage for streaming, response accumulation, WebSocket adapters and reconnects, authentication, pagination, uploads, platform detection, resource exports, and generated helper methods.
  • Measure every executable SDK source file with V8 coverage, excluding only vendored and type-only files, and enforce 98% statements/lines, 90% branches, and 93% functions in the required CI test-matrix check.

Validation

  • Full coverage suite: 1,980 tests passed; 1 existing test skipped.
  • Coverage: 98.83% statements/lines, 90.72% branches, and 93.50% functions.
  • ./node_modules/.bin/tsc --noEmit --pretty false
  • ./node_modules/.bin/eslint .
  • ./node_modules/.bin/prettier --check .
  • node --experimental-strip-types scripts/check-node-version-policy.ts

Related Linear issues

@openai-sdks

openai-sdks Bot commented Jul 30, 2026

Copy link
Copy Markdown

OkTest Summary

237/237 SDK tests passed in 8.912s for Node SDK PR #2034.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 108ms
tests/chat-completions-create.test.ts ✅ Passed 114ms
tests/chat-completions-stream.test.ts ✅ Passed 193ms
tests/files-content-binary.test.ts ✅ Passed 112ms
tests/files-create-multipart.test.ts ✅ Passed 137ms
tests/files-list-pagination.test.ts ✅ Passed 114ms
tests/initialize-config.test.ts ✅ Passed 87ms
tests/instance-isolation.test.ts ✅ Passed 104ms
tests/models-list.test.ts ✅ Passed 113ms
tests/responses-background-lifecycle.test.ts ✅ Passed 172ms
tests/responses-body-method-errors.test.ts ✅ Passed 320ms
tests/responses-cancel-timeout.test.ts ✅ Passed 204ms
tests/responses-cancel.test.ts ✅ Passed 171ms
tests/responses-compact-retries.test.ts ✅ Passed 118ms
tests/responses-compact.test.ts ✅ Passed 173ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 97ms
tests/responses-create-advanced.test.ts ✅ Passed 135ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.088s
tests/responses-create-errors.test.ts ✅ Passed 166ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 149ms
tests/responses-create-retries.test.ts ✅ Passed 204ms
tests/responses-create-stream-failures.test.ts ✅ Passed 139ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.141s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.142s
tests/responses-create-stream.test.ts ✅ Passed 61ms
tests/responses-create-terminal-states.test.ts ✅ Passed 174ms
tests/responses-create-timeout.test.ts ✅ Passed 198ms
tests/responses-create.test.ts ✅ Passed 110ms
tests/responses-delete.test.ts ✅ Passed 99ms
tests/responses-input-items-errors.test.ts ✅ Passed 170ms
tests/responses-input-items-list.test.ts ✅ Passed 149ms
tests/responses-input-items-options.test.ts ✅ Passed 78ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 217ms
tests/responses-input-tokens-count.test.ts ✅ Passed 139ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.711s
tests/responses-not-found-errors.test.ts ✅ Passed 252ms
tests/responses-parse.test.ts ✅ Passed 167ms
tests/responses-retrieve-retries.test.ts ✅ Passed 574ms
tests/responses-retrieve.test.ts ✅ Passed 154ms
tests/responses-stored-method-errors.test.ts ✅ Passed 408ms
tests/retry-behavior.test.ts ✅ Passed 2.911s
tests/sdk-error-shape.test.ts ✅ Passed 227ms

View OkTest run #30571188819

SDK merge (d44d12b89f5b) · head (69bc9a164fe2) · base (d77cf24d9f38) · OkTest (91635c6a2723)

@jbeckwith-oai jbeckwith-oai 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.

Thermo-nuclear review clean. Verified the exact head (69bc9a1), suite partitioning, coverage gate wiring, source/test structure, and green CI coverage (98.83% statements/lines, 90.72% branches, 93.5% functions; 1,980 tests).

@HAYDEN-OAI
HAYDEN-OAI enabled auto-merge (squash) July 30, 2026 20:42
@HAYDEN-OAI
HAYDEN-OAI disabled auto-merge July 30, 2026 20:43
@HAYDEN-OAI
HAYDEN-OAI merged commit 0130377 into main Jul 30, 2026
36 checks passed
@HAYDEN-OAI
HAYDEN-OAI deleted the dev/hayden/openai-node-test-coverage branch July 30, 2026 20:43
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