RHIDP-14000: update feedback unit and e2e tests#1875
Conversation
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Warning Review limit reached
More reviews will be available in 20 minutes and 38 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR extends test coverage for the feedback feature by adding two end-to-end scenarios and four new unit tests. The E2E scenarios verify feedback status toggling consistency and duplicate submission handling. The unit tests validate configuration chains, filesystem storage, and concurrent operations. ChangesFeedback Test Coverage
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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: 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/unit/app/endpoints/test_feedback.py`:
- Around line 305-317: The tests mutate the process-wide
configuration.user_data_collection_configuration (used around store_feedback in
the test_feedback cases) and never restore it, causing flaky inter-test
interference; save a copy of the original
configuration.user_data_collection_configuration before mutating it (e.g., orig
= deepcopy(configuration.user_data_collection_configuration)), perform the test
changes, then restore the original in a finally block or teardown
(configuration.user_data_collection_configuration = orig) so both test sections
that call store_feedback leave global state unchanged and deterministic.
- Around line 389-405: The test can finish serially because threads are started
sequentially and update_feedback_status has no await; synchronize thread start
so all workers reach the lock concurrently by adding a synchronization primitive
(e.g., threading.Barrier or threading.Event) shared by the test and used in the
worker function before calling update_feedback_status; modify the worker (the
worker function that builds FeedbackStatusUpdateRequest and calls
asyncio.run(update_feedback_status, auth=auth)) to wait on the barrier/event,
initialize and start the threads, then release the barrier/event after all
threads are created so they all call update_feedback_status at the same time,
ensuring the lock inside update_feedback_status is actually contested.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: de5c3955-6c83-4d51-a947-7c3460e09f84
📒 Files selected for processing (2)
tests/e2e/features/feedback.featuretests/unit/app/endpoints/test_feedback.py
📜 Review details
⏰ 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: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
🧰 Additional context used
📓 Path-based instructions (2)
tests/e2e/**/*.{py,feature}
📄 CodeRabbit inference engine (AGENTS.md)
Use behave (BDD) framework for end-to-end testing with Gherkin feature files
Files:
tests/e2e/features/feedback.feature
tests/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
tests/**/*.py: Use pytest for all unit and integration tests; do not use unittest
Usepytest.mark.asynciomarker for async tests
Files:
tests/unit/app/endpoints/test_feedback.py
🔇 Additional comments (2)
tests/e2e/features/feedback.feature (2)
315-332: LGTM!
334-368: LGTM!
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
|
/cc @tisnik |
Description
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing
Summary by CodeRabbit