Test/bruno find containing intervals#29525
Conversation
Adds the team-wide master plan and one working document per member, plus the assignment brief and report template. Updates the method-selection doc after a coverage audit that swapped four already-100%-covered functions for untested pure functions (extractHostTimezone, isEqual, findContainingIntervals, isPasswordValid) and kept parseTimeString and subtract for their dead-code findings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Welcome to Cal.diy, @BGrangeiro! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR refactors test coverage for getLuckyUser priority ranking by splitting a complex test case into multiple focused test cases with centralized setup, adds a comprehensive new test suite for interval tree containment search including equivalence partitioning and white-box pruning analysis, and updates the project gitignore to exclude build artifacts and local team working files. The changes improve test clarity and add systematic coverage for a core data structure algorithm without modifying any production code. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@ptoss-2-funcao-joaquim-isPasswordValid.md`:
- Line 78: The markdown decision table row containing D1 (`password.length >= 7
&& (!strict || password.length > 14)`) has more cells than the header and breaks
the table layout; update that row in ptoss-2-funcao-joaquim-isPasswordValid.md
so it matches the header column count (normalize/remove or merge extra
pipe-separated cells for `A=...`, `B=...`, `C=...`, `min = true/false` to the
same number of columns as the table header) so the decision matrix renders
correctly.
In `@ptoss-2-test-method-selection.md`:
- Line 150: Update the section that still references outdated functions
(`getPrefetchMonthCount`, `getAvailabilityFromSchedule`, `intersect`,
`computeEffectiveStateAcrossTeams`) and the ambiguous TDD guidance so it matches
the current decision to focus on a single TDD track: `isPasswordValid`; remove
or replace all instructions that point to the old functions with tasks relevant
to `isPasswordValid` (e.g., propose unit tests, edge cases, and MC/DC candidate
conditions for `isPasswordValid`) and explicitly state that TDD will use
`isPasswordValid` as the single track; apply the same replacements to the other
mentioned ranges so no stale function names or undefined TDD guidance remain.
- Line 39: The markdown table row containing "Técnica caixa-branca usada |
Cobertura de branches de cada `if` e das decisões de 2 condições `value == null
|| other == null` e `Array.isArray(value) && Array.isArray(other)`" is producing
an extra column because of unescaped pipe characters inside the cell; update
that row to keep the table 2-column consistent by escaping any pipe characters
or wrapping the entire cell contents in a code span or HTML entity (e.g.,
replace internal | with \| or use `inline code`/&`#124`;) so the table has exactly
two cells: the left column "Técnica caixa-branca usada" and the right column
with the decision text. Ensure the edited row still contains the original
decision text (including the `value == null || other == null` and
`Array.isArray(value) && Array.isArray(other)`) but with pipes escaped.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c5b868f7-31b2-44e1-800b-ef8942288253
⛔ Files ignored due to path filters (2)
26-1-PTOSS-2-template_relatorio.docxis excluded by!**/*.docx26-1-PTOSS-2.pdfis excluded by!**/*.pdf
📒 Files selected for processing (10)
packages/features/bookings/lib/getLuckyUser.test.tspackages/lib/intervalTree.test.tsptoss-2-funcao-anderson-parseTimeString.mdptoss-2-funcao-bruno-findContainingIntervals.mdptoss-2-funcao-eduardo-isEqual.mdptoss-2-funcao-joaquim-isPasswordValid.mdptoss-2-funcao-john-subtract.mdptoss-2-funcao-rodrigo-extractHostTimezone.mdptoss-2-plano-geral.mdptoss-2-test-method-selection.md
| # pagefind | ||
| _pagefind/ | ||
|
|
||
| # PTOSS-2 working files (mantidos localmente, fora do versionamento) |
Summary
Adds unit tests for
findContainingIntervalsfromContainmentSearchAlgorithm.The tests cover equivalence partitioning, boundary value analysis, MC/DC for the containment decision, and the tree search pruning branches.
No new dependencies are required.
Visual Demo (For contributors especially)
N/A. This PR only adds unit tests and does not change the user interface.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
No environment variables or external test data are required.
Run:
Expected result:
To verify coverage:
corepack yarn vitest run packages/lib/intervalTree.test.ts \ --coverage.enabled \ --coverage.include="packages/lib/intervalTree.ts" \ --coverage.reporter=textExpected coverage for
intervalTree.ts:Checklist