-
Notifications
You must be signed in to change notification settings - Fork 12
bun test #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/bun
Are you sure you want to change the base?
bun test #389
Conversation
|
Coverage Report
📁 File Coverage (13 files)
|
ed7ab3a to
9bb1375
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the CLI test suite from Vitest to Bun's built-in test runner. The migration includes updating test imports, refactoring the temporary directory handling pattern, adding integration test setup for Docker images, and updating the CI workflow for Bun-based coverage reporting.
Key changes:
- Replaced Vitest with Bun test runner across all test files
- Refactored temporary directory fixture pattern from Vitest's
test.extendto a helper function approach - Added
setupIntegrationTests()function to ensure Docker images are available before tests run
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| bun.lock | Updated tinyexec version and removed vitest-related dependencies |
| apps/cli/package.json | Removed vitest dependency and updated test script to use bun test |
| apps/cli/tests/unit/config.test.ts | Updated imports from vitest to bun:test |
| apps/cli/tests/integration/exec/*.test.ts | Updated imports and added beforeAll hook for integration test setup |
| apps/cli/tests/integration/config.ts | Added Docker image setup utilities for integration tests |
| apps/cli/tests/integration/builder/tmpdirTest.ts | Refactored from Vitest fixture pattern to helper function pattern |
| apps/cli/tests/integration/builder/*.test.ts | Updated imports, added beforeAll hooks, and migrated from tmpdirTest fixture to setupTempDir helper |
| .github/workflows/cli.yaml | Updated test command and coverage reporting to use Bun-native tools |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request migrates the
apps/cliintegration and unit tests from Vitest to Bun's native test runner, and updates the test infrastructure to improve reliability and maintainability. It also updates the test Docker image handling to ensure required images are available before running integration tests, and modernizes the coverage reporting in the CI workflow.Test runner migration and improvements:
Replaced all usage of Vitest in integration and unit tests with Bun's test runner, updating imports and test APIs accordingly across all test files. (
apps/cli/tests/integration/builder/directory.test.ts,apps/cli/tests/integration/builder/docker.test.ts,apps/cli/tests/integration/builder/empty.test.ts,apps/cli/tests/integration/builder/none.test.ts,apps/cli/tests/integration/builder/tar.test.ts,apps/cli/tests/integration/exec/cartesi-machine.test.ts,apps/cli/tests/integration/exec/genext2fs.test.ts,apps/cli/tests/integration/exec/mksquashfs.test.ts,apps/cli/tests/unit/config.test.ts) [1] [2] [3] [4] [5] [6] [7] [8] [9]Removed the
vitestdependency frompackage.jsonand updated the test script to usebun testinstead. (apps/cli/package.json) [1] [2]Test infrastructure and Docker image handling:
Added a global setup function,
setupIntegrationTests, to ensure required Docker images are present before running integration tests, improving test reliability and developer experience. (apps/cli/tests/integration/config.ts)Updated all integration tests to call
setupIntegrationTestsin abeforeAllhook, ensuring Docker images are prepared before any tests run. (apps/cli/tests/integration/builder/directory.test.ts,apps/cli/tests/integration/builder/docker.test.ts,apps/cli/tests/integration/builder/empty.test.ts,apps/cli/tests/integration/builder/none.test.ts,apps/cli/tests/integration/builder/tar.test.ts,apps/cli/tests/integration/exec/cartesi-machine.test.ts,apps/cli/tests/integration/exec/genext2fs.test.ts,apps/cli/tests/integration/exec/mksquashfs.test.ts) [1] [2] [3] [4] [5] [6] [7] [8]Updated the test SDK image constant to use values from the main config, ensuring consistency across environments. (
apps/cli/tests/integration/config.ts)Temporary directory management for tests:
tmpdirTestVitest fixture with a newsetupTempDirhelper for managing temporary directories in Bun tests, and updated all affected tests to use this new approach. (apps/cli/tests/integration/builder/tmpdirTest.ts, and all integration test files) [1] [2] [3] [4] [5] [6]CI workflow and coverage reporting:
.github/workflows/cli.yaml)