Skip to content

chore(test-utils): Separate tape tests from vitest and clean up CI#10061

Merged
chrisgervang merged 20 commits intomasterfrom
chr/test-utils-vitest-entry
Apr 7, 2026
Merged

chore(test-utils): Separate tape tests from vitest and clean up CI#10061
chrisgervang merged 20 commits intomasterfrom
chr/test-utils-vitest-entry

Conversation

@chrisgervang
Copy link
Copy Markdown
Collaborator

@chrisgervang chrisgervang commented Mar 4, 2026

Summary

  • Rename tape-compat.spec.tstape-compat.tape.spec.ts to distinguish tape-based tests from vitest tests
  • Add global *.tape.spec.ts exclude in vitest.config.ts so tape tests are never picked up by vitest projects
  • Update .ocularrc.js to reference the renamed file
  • Remove redundant test/smoke/vitest-entry.spec.ts (covered by 88 existing test files importing @deck.gl/test-utils/vitest)

Test plan

  • CI test-node job passes
  • yarn test-tape-compat still runs the tape backward compat smoke test
  • yarn test-ci runs all vitest projects without picking up tape tests

🤖 Generated with Claude Code


Note

Medium Risk
Test discovery and CI behavior changes by globally excluding **/*.tape.spec.ts from Vitest; misnaming or glob mistakes could cause tests to be skipped or not executed in CI.

Overview
Separates the legacy tape-based smoke test from the Vitest test suite by renaming the tape compat spec to tape-compat.tape.spec.ts and updating .ocularrc.js to point at the new entry.

Updates vitest.config.ts to globally exclude **/*.tape.spec.ts across all Vitest projects, preventing tape tests from being picked up during yarn test-ci runs, and removes the now-redundant test/smoke/vitest-entry.spec.ts.

Reviewed by Cursor Bugbot for commit d4f1725. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread modules/test-utils/src/lifecycle-test.ts
Comment thread modules/test-utils/package.json
Comment thread modules/test-utils/src/vitest.ts Outdated
@chrisgervang chrisgervang force-pushed the chr/test-utils-vitest-entry branch from 74d609a to 5e771d7 Compare March 4, 2026 04:44
Comment thread modules/test-utils/src/lifecycle-test.ts Outdated
@chrisgervang
Copy link
Copy Markdown
Collaborator Author

Re: Cursor Bugbot comment about missing ./tape export - this is intentional. The default . entry already re-exports from tape.ts with backward compatibility (default spy factory from @probe.gl/test-utils). A separate ./tape export is unnecessary since:

  • @deck.gl/test-utils → tape behavior (backward compat, uses makeSpy by default)
  • @deck.gl/test-utils/vitest → vitest behavior (uses vi.spyOn by default)

Existing tape/probe.gl users continue using the default import with no changes needed.

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 4, 2026

Coverage Status

coverage: 81.435%. remained the same — chr/test-utils-vitest-entry into master

Comment thread modules/test-utils/src/lifecycle-test.ts
Comment thread modules/test-utils/src/tape.ts
Comment thread modules/test-utils/src/lifecycle-test.ts Outdated
Comment thread modules/test-utils/package.json
@chrisgervang chrisgervang force-pushed the chr/test-utils-vitest-entry branch from e5db479 to 14d2cd8 Compare March 4, 2026 21:38
Comment thread test/smoke/tape-compat.ts
@chrisgervang chrisgervang force-pushed the chr/test-utils-vitest-entry branch from c6b6e8c to 63446d4 Compare March 4, 2026 22:52
Comment thread modules/test-utils/src/lifecycle-test.ts
chrisgervang and others added 10 commits March 9, 2026 11:07
- Add @deck.gl/test-utils/vitest entry point with vi.spyOn as default spy factory
- Add @deck.gl/test-utils/tape entry point with probe.gl makeSpy default (with deprecation warning)
- Extract SpyFactory abstraction in lifecycle-test.ts for spy provider flexibility
- Add tape-compat and vitest-entry smoke tests to verify both paths work
- Update package.json exports to support both entry points
- Add vitest 4.0.18 as optional peer dependency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The eslint-plugin-import namespace rule fails parsing vite module internals.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The index.ts was exporting directly from lifecycle-test.ts which requires
createSpy, breaking existing tests. Now exports from tape.ts which provides
a default spy factory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Restore JSDoc comments that were stripped from lifecycle-test.ts
- Add 'called' property to Spy type for TypeScript compatibility with probe.gl spies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Restore original lifecycle-test.ts and reapply minimal SpyFactory
abstraction changes to avoid unintended formatting modifications.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…py cleanup

- Remove vitest-specific restoreSpy from core lifecycle-test.ts
- Add ResetSpy type and resetSpy option to TestLayerOptions
- tape.ts: default resetSpy calls spy.reset() (preserves original behavior)
- vitest.ts: default resetSpy calls spy.mockRestore()

This keeps the core library framework-agnostic by letting each entry
point define its own spy cleanup behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both createSpy and resetSpy now warn users to explicitly pass them,
guiding migration to framework-specific spy handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Avoids triggering deprecation warning during CI by explicitly
passing resetSpy alongside createSpy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tions

Add cleanupAfterLayerTestsAsync() that yields to the event loop before
destroying WebGL resources. This prevents "getProgramInfoLog" errors from
luma.gl's async shader error reporting trying to access already-destroyed
WebGLProgram handles.

Also removes unused imports from setup-gl.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chrisgervang chrisgervang force-pushed the chr/test-utils-vitest-entry branch from 9211999 to c337c4e Compare March 9, 2026 18:07
- Use master versions for all dependencies
- Keep shared getResourceCountDelta() helper to avoid duplication
- Include timeout duration in test-runner error messages
- Remove redundant tape-compat.ts (covered by master's tape-compat.spec.ts)
- Accept master's full vitest.config.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread .ocularrc.js Outdated
Comment thread .github/workflows/test.yml Outdated
Comment thread .github/workflows/test.yml Outdated
chrisgervang and others added 2 commits April 1, 2026 07:59
- Remove duplicate tape-compat CI step and nonexistent test-vitest-smoke script
- Remove duplicate tape-compat entry in .ocularrc.js pointing to deleted file
- Remove vitest-entry smoke test (redundant with 88 existing test files)
- Remove unused tap-spec devDependency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chrisgervang chrisgervang changed the title feat(test-utils): Add vitest entry + tape backward compat chore(test-utils): Clean up CI and remove redundant test artifacts Apr 7, 2026
Comment thread package.json Outdated
Only referenced in codemod fixture inputs (static test data).
Migration RFC explicitly called for its removal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chrisgervang and others added 4 commits April 6, 2026 21:22
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename tape-compat.spec.ts to tape-compat.tape.spec.ts to distinguish
tape-based tests from vitest tests. Add global *.tape.spec.ts exclude
in vitest.config.ts so they're never picked up by vitest projects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chrisgervang chrisgervang changed the title chore(test-utils): Clean up CI and remove redundant test artifacts chore(test-utils): Separate tape tests from vitest and clean up CI Apr 7, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d03f593. Configure here.

Comment thread vitest.config.ts Outdated
Spread configDefaults.exclude to avoid overriding built-in excludes
for node_modules, .git, etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chrisgervang chrisgervang merged commit 7d39ad2 into master Apr 7, 2026
6 checks passed
@chrisgervang chrisgervang deleted the chr/test-utils-vitest-entry branch April 7, 2026 18:04
@chrisgervang chrisgervang added this to the v9.3 milestone Apr 7, 2026
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