Re-enable the filters (auto-complete) tests#461
Conversation
Signed-off-by: Jorge Padilla <jpadilla@redhat.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds runnable filter tests and parsing/matching helpers to ChangesFilter Test Implementation
RBAC Test Adjustments
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 `@tests/api/filter.test.js`:
- Around line 59-83: parseFilterValue currently parses operators like '!=' and
'!' into operator but the numeric comparison block (using operator/operand,
isNumericOperand, expectedNum, actualNum) only implements =, >, <, >=, <=
causing '!=' and '!' to fall through to string matching; update the numeric
switch in the test (the switch over operator inside the items.forEach) to handle
'!=' and '!' by asserting not-equality (use Jest's
expect(actualNum).not.toBe(expectedNum)), and similarly extend the non-numeric
literal matching branch (the code handling property === fv around lines 88-90)
to treat '!' and '!=' as negation (assert the property does not equal the
operand); keep other behavior and preserve the existing error path (throw for
truly unsupported operators).
- Around line 49-55: The test currently only checks parseability for values when
RELATIVE_DATE_VALUES.has(fv); update the assertion to verify each parsed date
actually falls within the expected relative range for the selected fv
(hour/day/week/month/year). For each item in items (same loop using fv and
property), parse the value into a Date (Date.parse), compute now = Date.now()
and a lowerBound = now - durationMillis where durationMillis maps fv -> {hour:
1*60*60*1000, day: 24*60*60*1000, week: 7*24*60*60*1000, month: 30*24*60*60*1000
(or use month arithmetic), year: 365*24*60*60*1000 (or use full-year
arithmetic)}, then assert parsedTime <= now and parsedTime >= lowerBound; keep
the existing parse/assertions but replace the weak Date.parse check with these
range assertions so the test fails if the backend ignored the date filter.
🪄 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: Enterprise
Run ID: a5b506b0-9f35-49aa-bdbc-fa2400c5a4c9
📒 Files selected for processing (1)
tests/api/filter.test.js
1. Add proper relative date range validation - verify dates fall within the expected time window (hour/day/week/month/year ago from now) 2. Add support for != and ! operators in both numeric and non-numeric filter assertions Addresses review comments in PR #461. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Jorge Padilla <jpadilla@redhat.com>
|
🤖 I'm an AI agent I've addressed both CodeRabbit review comments: 1. Relative date range validation (lines 49-67)
2. Operator support for != and ! (lines 82-84, 106-110)
Both issues have been fixed in commit 7539760. |
|
/test deploy-and-run-e2e-api |
Signed-off-by: Jorge Padilla <jpadilla@redhat.com>
Signed-off-by: Jorge Padilla <jpadilla@redhat.com>
|
Tests job is failing because of actual product regression bug. https://redhat.atlassian.net/browse/ACM-33881 |
|
/test deploy-and-run-e2e-api |
|
Why remove available, port, and suspend queries? |
@smcavey These were commented out. We have a known issue for The goal of the test is to validate the API, not to check for every single property collected. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jlpadilla, smcavey The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test deploy-and-run-e2e-api |
|
/test deploy-and-run-e2e-api Last 2 executions failed with different errors. Adding hold to run several times to confirm this isn't adding stability problems |
|
/test all |
|
New changes are detected. LGTM label has been removed. |
|
/test deploy-and-run-e2e-api Got another different random fail. |
|
/test deploy-and-run-e2e-api |
|
@jlpadilla: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary by CodeRabbit