Skip to content

Clean up TypeScript test validators and run regression tests in CI #463

Open

Description

@robgruen

Summary

Address two pre-existing TypeScript test-infrastructure gaps surfaced while reviewing #461:

  1. Test-created validators are not closed, allowing native compiler processes to accumulate during a test run.
  2. The Node.js CI workflow builds the project but does not execute npm test.

This issue tracks both improvements separately from the standard-library helper changes in #461. It is not a report of a correctness regression in those declarations.

Validator lifecycle

The shared test helper creates a validator for each test without registering teardown. With TypeScript 7, each validator owns a native compiler process; calling close() releases it.

Observed behavior

Validation at commit 5547207293c9f787b6fc3f3a6f729d9d977bd472 on Windows, Node.js 24.19.0, and TypeScript 7.0.2:

  • Library and test compilation succeeded.
  • The unmodified validator suite finished with 8 passing and 17 failing tests. Failures included out of memory allocating heap arena map, Error: spawn UNKNOWN, and SyncRpcChannel: timed out connecting to named pipe.
  • Re-running the same suite with temporary per-test teardown that closed each created validator produced 25 passing tests and 0 failures, without changing the validator implementation or test assertions.

The resource failures are environment-dependent. The fixture pattern predates #461, but that PR adds another 13 validator instances, making explicit cleanup increasingly important.

Reproduction

From the TypeScript package directory at the reviewed commit, using PowerShell:

npm ci --ignore-scripts
npm run build
npx --no-install tsc -p test
node --test --test-reporter=spec .\out\validate.test.js

Compare with a run that registers cleanup for each validator through test teardown, such as t.after(() => validator.close()). Cleanup must also run when an assertion fails.

CI coverage

The Node.js CI workflow runs npm ci and npm run build-all, but does not run npm test. Consequently, the existing regression suite and the new tests in #461 are not automatically enforced by this workflow.

At the time of review, the referenced Node.js CI run reported action_required. That status, and the successful CLA check on the PR, are not evidence of successful build or test execution. The missing test step remains a separate workflow gap.

Requested changes

  • Ensure test-created TypeScript validators are closed during test teardown, preferably through the shared fixture so existing and new tests benefit.
  • Add npm test to the Node.js CI workflow for each supported Node version, retaining the existing library/example build coverage.
  • Keep the regression tests runnable offline without live model services or credentials.

Acceptance criteria

  • Test-created validators are explicitly closed, including when assertions fail, rather than retaining all compiler processes until the test process exits.
  • The focused validator suite passes without temporary cleanup instrumentation.
  • npm test and npm run build-all pass across the workflow's supported Node.js matrix.
  • CI logs show actual regression-test execution, and a failing test fails the job.

Related: #461, #452.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions