-
Notifications
You must be signed in to change notification settings - Fork 3
fix tests on localhost #469
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
Conversation
✅ Deploy Preview for pvm-debugger ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe changes standardize test data attributes from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✨ Finishing touches
Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/memory-range.spec.ts (1)
9-10: Consider replacing fixed waits with explicit state checks.While the 2-second waits work for localhost, explicit waits for observable program states (like checking for initialization status or first instruction visibility) would be more reliable and potentially faster, similar to the approach in
tests/run-program.spec.ts(lines 15-17).Example: Wait for observable state instead of fixed timeout
- // Wait for program to load and initialize - await page.waitForTimeout(2000); + // Wait for program to initialize by checking for visible instructions + await expect(page.locator('a:has-text("STORE_U16")')).toBeVisible({ timeout: 5000 });Alternatively, wait for a specific program status or memory initialization indicator if available.
Also applies to: 31-32, 51-52, 73-74
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
playwright.config.tssrc/components/Instructions/InstructionItem.tsxsrc/components/MemoryPreview/MemoryInfinite.tsxsrc/components/Registers/index.tsxtests/memory-range.spec.tstests/run-program.spec.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.spec.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.spec.{ts,tsx}: Unit specs should use the*.spec.ts(x)suffix and stay beside their modules
Match test file names to the unit under test (e.g.,store/pvmSlice.spec.ts)
Files:
tests/run-program.spec.tstests/memory-range.spec.ts
tests/**/*.spec.ts
📄 CodeRabbit inference engine (AGENTS.md)
tests/**/*.spec.ts: Playwright specs intests/should script critical journeys such as uploading WASM or stepping instructions
Reuse fixtures fromtests/utilsfor deterministic Playwright inputs
Files:
tests/run-program.spec.tstests/memory-range.spec.ts
src/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/components/**/*.{ts,tsx}: Keep reusable UI components insrc/components/
Write TypeScript-first functional components
Files:
src/components/Instructions/InstructionItem.tsxsrc/components/MemoryPreview/MemoryInfinite.tsxsrc/components/Registers/index.tsx
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,tsx}: Use two-space indentation in TypeScript files
Use descriptive filenames in kebab-case (e.g.,memory-range-panel.tsx)
Validate external inputs with Zod when parsing user data
Files:
src/components/Instructions/InstructionItem.tsxsrc/components/MemoryPreview/MemoryInfinite.tsxsrc/components/Registers/index.tsx
src/**/*.{css,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Favor Tailwind utilities from
globals.cssbefore adding new CSS files
Files:
src/components/Instructions/InstructionItem.tsxsrc/components/MemoryPreview/MemoryInfinite.tsxsrc/components/Registers/index.tsx
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: UI tweaks should update the affected Playwright expectations
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: Applies to tests/**/*.spec.ts : Reuse fixtures from `tests/utils` for deterministic Playwright inputs
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: Applies to tests/**/*.spec.ts : Playwright specs in `tests/` should script critical journeys such as uploading WASM or stepping instructions
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: Applies to src/**/*.spec.{ts,tsx} : Vitest with Testing Library is configured through `src/test-setup.ts`; assert observable behavior
📚 Learning: 2025-11-24T22:06:57.521Z
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: Applies to tests/**/*.spec.ts : Playwright specs in `tests/` should script critical journeys such as uploading WASM or stepping instructions
Applied to files:
tests/run-program.spec.tsplaywright.config.tstests/memory-range.spec.ts
📚 Learning: 2025-11-24T22:06:57.521Z
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: UI tweaks should update the affected Playwright expectations
Applied to files:
tests/run-program.spec.tssrc/components/Instructions/InstructionItem.tsxsrc/components/MemoryPreview/MemoryInfinite.tsxsrc/components/Registers/index.tsxtests/memory-range.spec.ts
📚 Learning: 2025-11-24T22:06:57.521Z
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: Applies to src/**/*.spec.{ts,tsx} : Vitest with Testing Library is configured through `src/test-setup.ts`; assert observable behavior
Applied to files:
tests/run-program.spec.tsplaywright.config.tstests/memory-range.spec.ts
📚 Learning: 2025-11-24T22:06:57.521Z
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: Applies to tests/**/*.spec.ts : Reuse fixtures from `tests/utils` for deterministic Playwright inputs
Applied to files:
tests/run-program.spec.tsplaywright.config.tstests/memory-range.spec.ts
📚 Learning: 2025-11-24T22:06:57.521Z
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: Applies to src/**/*.spec.{ts,tsx} : Cover success and failure paths for reducers, hooks, and components that manage debugger state
Applied to files:
tests/run-program.spec.tssrc/components/Registers/index.tsxtests/memory-range.spec.ts
📚 Learning: 2025-11-24T22:06:57.521Z
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: Use `npm run dev` to start Vite with hot reload across workers
Applied to files:
playwright.config.ts
📚 Learning: 2025-11-24T22:06:57.521Z
Learnt from: CR
Repo: FluffyLabs/pvm-debugger PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T22:06:57.521Z
Learning: Applies to **/*.spec.{ts,tsx} : Unit specs should use the `*.spec.ts(x)` suffix and stay beside their modules
Applied to files:
tests/memory-range.spec.ts
🧬 Code graph analysis (1)
src/components/MemoryPreview/MemoryInfinite.tsx (1)
src/components/ui/tooltip.tsx (1)
TooltipTrigger(30-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (6)
playwright.config.ts (1)
74-79: LGTM! webServer configuration enables automated localhost testing.The configuration correctly builds the app and starts a preview server before tests. The 120-second timeout and conditional server reuse logic are appropriate for CI and local development.
src/components/Registers/index.tsx (1)
188-188: LGTM! Standardized test attribute.The change from
test-idtodata-testidaligns with standard testing conventions and matches the selector updates intests/run-program.spec.ts.src/components/Instructions/InstructionItem.tsx (1)
131-131: LGTM! Standardized test attribute.Consistent with the test attribute standardization across other components in this PR.
src/components/MemoryPreview/MemoryInfinite.tsx (1)
76-76: LGTM! Standardized test attributes on memory cells.Both changes align with the test selector updates in
tests/memory-range.spec.tsthat now usegetByTestId("memory-cell").Also applies to: 92-92
tests/run-program.spec.ts (1)
15-17: LGTM! Excellent improvement to test reliability.Replacing the fixed sleep with an explicit wait for the "HALT" status makes the test more reliable and faster. The 15-second timeout provides sufficient time for program execution while failing fast if something goes wrong.
tests/memory-range.spec.ts (1)
17-18: LGTM! Standardized test selectors.The change to
getByTestId("memory-cell")correctly aligns with the component updates insrc/components/MemoryPreview/MemoryInfinite.tsx.Also applies to: 22-23
No description provided.