test: remove simulator matrix - #326
Conversation
📝 WalkthroughWalkthroughThe iOS simulator tests now run once in a shared suite. Per-version setup and execution were removed. Teardown logging remains. The screenshot test still references the removed ChangesiOS simulator test consolidation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/simulator.spec.ts`:
- Around line 51-61: Update the screenshotPath construction in the “should take
screenshot” test to remove the deleted iosVersion reference, while preserving
the timestamp-based unique filename and existing screenshot verification flow.
- Around line 327-333: Update the removal assertion in the “should remove the
test directory from the app container” test to compare against the actual
basename of remoteDir, rather than the plain “mobilecli-test” prefix. Derive the
expected directory name from remoteDir using the existing path utilities, then
assert names does not contain that exact basename after fsRm.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 77da3240-d8e6-44d1-a75a-480997ce49a7
📒 Files selected for processing (1)
test/simulator.spec.ts
| test('should take screenshot', async () => { | ||
| test.skip(!simulatorId, 'simulator not found'); | ||
|
|
||
| const screenshotPath = `/tmp/screenshot-ios${iosVersion}-${Date.now()}.png`; | ||
|
|
||
| takeScreenshot(simulatorId, screenshotPath); | ||
| verifyScreenshotFileWasCreated(screenshotPath); | ||
| verifyScreenshotFileHasValidContent(screenshotPath); | ||
|
|
||
| // console.log(`Screenshot saved at: ${screenshotPath}`); | ||
| }); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Remove the reference to the deleted iosVersion binding.
The version loop was removed, so iosVersion is no longer declared. Line 54 fails to compile under TypeScript and would throw a ReferenceError at runtime.
🐛 Proposed fix
- const screenshotPath = `/tmp/screenshot-ios${iosVersion}-${Date.now()}.png`;
+ const screenshotPath = `/tmp/screenshot-ios-${Date.now()}.png`;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| test('should take screenshot', async () => { | |
| test.skip(!simulatorId, 'simulator not found'); | |
| const screenshotPath = `/tmp/screenshot-ios${iosVersion}-${Date.now()}.png`; | |
| takeScreenshot(simulatorId, screenshotPath); | |
| verifyScreenshotFileWasCreated(screenshotPath); | |
| verifyScreenshotFileHasValidContent(screenshotPath); | |
| // console.log(`Screenshot saved at: ${screenshotPath}`); | |
| }); | |
| test('should take screenshot', async () => { | |
| test.skip(!simulatorId, 'simulator not found'); | |
| const screenshotPath = `/tmp/screenshot-ios-${Date.now()}.png`; | |
| takeScreenshot(simulatorId, screenshotPath); | |
| verifyScreenshotFileWasCreated(screenshotPath); | |
| verifyScreenshotFileHasValidContent(screenshotPath); | |
| // console.log(`Screenshot saved at: ${screenshotPath}`); | |
| }); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/simulator.spec.ts` around lines 51 - 61, Update the screenshotPath
construction in the “should take screenshot” test to remove the deleted
iosVersion reference, while preserving the timestamp-based unique filename and
existing screenshot verification flow.
| test('should remove the test directory from the app container', async () => { | ||
| test.skip(!simulatorId, 'simulator not found'); | ||
| fsRm(simulatorId, remoteDir, true); | ||
| const entries = fsList(simulatorId, `${containerPath}/Documents`); | ||
| const names = entries.map((e: any) => e.name); | ||
| expect(names).not.toContain('mobilecli-test'); | ||
| }); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Strengthen the removal assertion.
remoteDir ends with a timestamp, so its basename is mobilecli-test-<timestamp>. expect(names).not.toContain('mobilecli-test') compares array elements for equality, so the plain string mobilecli-test never matches. The assertion passes even if fsRm leaves the directory in place. Assert on the actual basename instead.
♻️ Proposed fix
fsRm(simulatorId, remoteDir, true);
const entries = fsList(simulatorId, `${containerPath}/Documents`);
const names = entries.map((e: any) => e.name);
- expect(names).not.toContain('mobilecli-test');
+ expect(names).not.toContain(path.basename(remoteDir));📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| test('should remove the test directory from the app container', async () => { | |
| test.skip(!simulatorId, 'simulator not found'); | |
| fsRm(simulatorId, remoteDir, true); | |
| const entries = fsList(simulatorId, `${containerPath}/Documents`); | |
| const names = entries.map((e: any) => e.name); | |
| expect(names).not.toContain('mobilecli-test'); | |
| }); | |
| test('should remove the test directory from the app container', async () => { | |
| test.skip(!simulatorId, 'simulator not found'); | |
| fsRm(simulatorId, remoteDir, true); | |
| const entries = fsList(simulatorId, `${containerPath}/Documents`); | |
| const names = entries.map((e: any) => e.name); | |
| expect(names).not.toContain(path.basename(remoteDir)); | |
| }); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/simulator.spec.ts` around lines 327 - 333, Update the removal assertion
in the “should remove the test directory from the app container” test to compare
against the actual basename of remoteDir, rather than the plain “mobilecli-test”
prefix. Derive the expected directory name from remoteDir using the existing
path utilities, then assert names does not contain that exact basename after
fsRm.
Summary by CodeRabbit