Skip to content

Conversation

@rajsite
Copy link
Member

@rajsite rajsite commented Dec 12, 2025

Pull Request

🤨 Rationale

Uses vite instead of webpack for running karma tests. Has the following benefits:

  • Fast enough to target .ts source files so can avoid needing to build manually first
  • Starts running tests almost immediately (2-3 seconds) instead of waiting for tdd, i.e. a components build followed by a full webpack build (30-40 seconds)
  • Improves workflow of focus a specific set of tests and run tests
  • Reduces times on nimble-component:test on CI by about 10-15s (net impact on full CI is minimal due to concurrency)

👩‍💻 Implementation

🧪 Testing

Try it yourself, pretty amazing.

  • Sync repo and npm install
  • npm run build-components
  • Focus a test (i.e. fdescribe), for example in nimble-components (note that means source has changed since build)
  • npm run test-chrome, should run against the latest source quickly and finish

Local run and CI

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@rajsite rajsite changed the title Vite test Switch to karma vite Dec 12, 2025
@rajsite rajsite marked this pull request as ready for review December 12, 2025 03:28
@rajsite rajsite requested a review from jattasNI as a code owner December 12, 2025 03:28
@rajsite rajsite changed the title Switch to karma vite Switch to karma-vite Dec 13, 2025
@rajsite
Copy link
Member Author

rajsite commented Dec 13, 2025

@jattasNI this may be a more controversial bypass as it's a nights and weekends change that adds a new dependency but it's a pretty well-scoped change that doesn't impact package output and simplifies workflows. Bypassing but can handle feedback in follow-up (though will address feedback as nights and weekends updates, somewhat adding to the controversialness a bit).

@rajsite rajsite merged commit fc03c70 into main Dec 13, 2025
11 checks passed
@rajsite rajsite deleted the vite-test branch December 13, 2025 22:30
@jattasNI
Copy link
Contributor

I did some local verification from main today. The workflows I tried look good, can still both run headless and debug tests and it is indeed super quick now.

My only feedback is not about this PR. This was the first time I tried local test run workflows since we added the retry capability. I suspect it might be slightly annoying / unnecessary to be retrying failed tests during the local debug workflow. Maybe we want a separate config for that case, or at least docs saying how to turn it off. But that's super low priority feedback, more theoretical. Can address if someone actively doing development complains.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants