ci: add frontend unit tests to CI workflow#333
Conversation
Split the single integration-test job into two parallel jobs: - backend-unit-tests: runs pytest against tensormap-backend/tests/ - integration-tests: runs pytest against tests/integration/ Both jobs run on PRs to main with separate checkout and setup steps to ensure clean environments.
Add .github/workflows/frontend-tests.yml that runs vitest on PRs to main: - Installs dependencies via npm ci - Runs npm run test:ci (vitest run in CI mode) - Uses consistent node-version=20 and npm caching Also adds 'test:ci' script to package.json for CI-optimized test execution.
PR ReviewSquashYour PR has 2 commits. Please squash into a single commit. How to fixgit fetch origin
git rebase -i origin/main # mark all but first commit as "squash"
git push --force-with-leaseThis comment updates automatically on each push. |
|
Polluted with 10+ unrelated commits. Clean version coming. |
|
Hey @ivantha, I apologize for the confusion with these PRs. The issue was that my local Git state had a polluted index with uncommitted changes from other branches — when I created the branches from what I thought was a clean origin/main, those branches ended up containing 10+ unrelated commits from the stale branch history. Both PRs showed the same 10 commits (augment, export, interpret, compare, tune) because those commits exist in main's merge history. I've since identified this and reset everything to a clean origin/main. I'm going to create fresh PRs with orphan branches — each containing exactly 1 commit with only its relevant files. They will have no shared commits and zero conflicts. Apologies for the noise! |
Summary
The frontend unit tests in
tensormap-frontend/src/(42 tests across 8 test files) were never executed in CI. This PR adds a dedicatedfrontend-tests.ymlworkflow that runs vitest on every PR tomain.Changes
.github/workflows/frontend-tests.yml— runsnpm run test:cion PRs tomaintest:ciscript topackage.json(vitest run --reporter=default) for CI-optimized outputValidation
Risk
Files Changed
tensormap-frontend/package.json— addedtest:ciscript.github/workflows/frontend-tests.yml— new frontend test workflow