-
Notifications
You must be signed in to change notification settings - Fork 4
test: Add DeepnoteKernelAutoSelector tests #168
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
Signed-off-by: Tomas Kislan <tomas@kislan.sk>
📝 WalkthroughWalkthroughMakes the Possibly related PRs
Suggested reviewers
Pre-merge checks✅ Passed checks (2 passed)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #168 +/- ##
=====================================
Coverage 73% 73%
=====================================
Files 574 574
Lines 46684 46751 +67
Branches 5513 5513
=====================================
+ Hits 34215 34306 +91
+ Misses 10657 10628 -29
- Partials 1812 1817 +5
🚀 New features to boost your workflow:
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
src/notebooks/deepnote/deepnoteKernelAutoSelector.node.ts(1 hunks)src/notebooks/deepnote/deepnoteKernelAutoSelector.node.unit.test.ts(4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{test,spec}.ts
📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)
In unit tests, when a mock is returned from a promise, ensure the mocked instance has an undefined
thenproperty to avoid hanging tests
Files:
src/notebooks/deepnote/deepnoteKernelAutoSelector.node.unit.test.ts
🧬 Code graph analysis (2)
src/notebooks/deepnote/deepnoteKernelAutoSelector.node.unit.test.ts (2)
src/test/vscode-mock.ts (2)
resetVSCodeMocks(60-79)mockedVSCodeNamespaces(17-17)src/kernels/types.ts (1)
IKernel(439-446)
src/notebooks/deepnote/deepnoteKernelAutoSelector.node.ts (1)
src/kernels/types.ts (1)
IKernel(439-446)
⏰ 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: Build & Test
🔇 Additional comments (4)
src/notebooks/deepnote/deepnoteKernelAutoSelector.node.ts (1)
323-323: LGTM: Visibility change enables testing.Making
onKernelStartedpublic allows direct invocation in unit tests without altering behavior.src/notebooks/deepnote/deepnoteKernelAutoSelector.node.unit.test.ts (3)
3-3: LGTM: Test infrastructure setup.Added imports and mock reset support new test suites appropriately.
Also applies to: 24-24, 52-52
307-325: LGTM: Early return path verified.Test correctly ensures
initNotebookRunnerisn't called for non-deepnote notebooks usingverify().never().
327-441: LGTM: Comprehensive coverage of ensureKernelSelected scenarios.Three test cases thoroughly validate:
- Missing environment assignment → returns false
- Missing environment in manager → returns false, removes mapping
- Environment found → returns true, validates all arguments passed to
ensureKernelSelectedWithConfigurationParticularly strong argument verification in the third test case.
| when(mockEnvironmentManager.waitForInitialization()).thenResolve(); | ||
| when(mockEnvironmentManager.listEnvironments()).thenReturn(environments); | ||
|
|
||
| // Mock window.showQuickPick to simulate user selecting the first environment |
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.
nit - these comments are overly verbose
Summary by CodeRabbit
Refactor
Tests