-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix(j-s): slow down the execution of js playwright tests #17438
Conversation
WalkthroughThe pull request introduces a comment regarding a feature flag affecting end-to-end tests in the Processing component of the judicial system. It defines a new constant, Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
…nd.is into j-s/e2e-debugging # Conflicts: # apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17438 +/- ##
==========================================
+ Coverage 35.66% 35.68% +0.01%
==========================================
Files 6941 6940 -1
Lines 149145 149044 -101
Branches 42650 42597 -53
==========================================
- Hits 53193 53179 -14
+ Misses 95952 95865 -87
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 29 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx
Show resolved
Hide resolved
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: 0
🧹 Nitpick comments (3)
apps/system-e2e/src/playwright.config.ts (1)
73-78
: Consider investigating root causes of flakiness.While adding
slowMo
can help stabilize flaky tests, it significantly increases test execution time (now ~8.5 minutes). Consider:
- Using Playwright's built-in auto-waiting mechanisms
- Adding explicit waits only where needed
- Investigating race conditions or timing issues
use: { - /* Slows down execution in ms */ - launchOptions: { - slowMo: 1000, - }, + /* Wait until element is visible and actionable */ + actionTimeout: 30 * 1000, + navigationTimeout: 30 * 1000, },apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx (2)
80-80
: Document the feature flag's impact on E2E tests.Instead of a TODO comment, document the specific conditions under which the E2E tests fail and how to handle them.
- // TODO: currently for e2e tests, this is failing locally due to this feature flag + // Note: E2E tests may fail locally when Feature.MULTIPLE_INDICTMENT_SUBTYPES is disabled. + // To fix: Enable the feature flag in your local environment or use the isTrafficViolationCase check.
81-83
: Consider extracting the feature check into a custom hook.The constant combines multiple conditions that determine routing behavior. Consider moving this logic into a custom hook for better reusability and testability.
+ const useIsTrafficViolationCase = (workingCase: Case) => { + const { features } = useContext(FeatureContext) + return features.includes(Feature.MULTIPLE_INDICTMENT_SUBTYPES) || + isTrafficViolationCase(workingCase) + } - const isTrafficViolationCaseCheck = - features.includes(Feature.MULTIPLE_INDICTMENT_SUBTYPES) || - isTrafficViolationCase(workingCase) + const isTrafficViolationCaseCheck = useIsTrafficViolationCase(workingCase)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx
(1 hunks)apps/system-e2e/src/playwright.config.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
apps/system-e2e/src/playwright.config.ts (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
📓 Learnings (1)
apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx (4)
Learnt from: gudjong
PR: island-is/island.is#15421
File: apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx:55-61
Timestamp: 2024-11-12T15:15:11.835Z
Learning: The `updateCase` method in the `apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx` file has its own error handling, and additional error handling in the `initialize` function is not necessary.
Learnt from: oddsson
PR: island-is/island.is#17192
File: apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCount.tsx:579-587
Timestamp: 2024-12-17T20:28:47.549Z
Learning: In the `IndictmentCount.tsx` file of the `apps/judicial-system/web` project, constraints on the vehicle registration number are planned to be removed. Avoid suggesting changes related to vehicle registration number validation for now.
Learnt from: oddsson
PR: island-is/island.is#16731
File: apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx:172-186
Timestamp: 2024-11-12T15:15:20.157Z
Learning: In `IndictmentOverview.tsx`, since the defendants data does not change, using `useMemo` to memoize the filtering logic is unnecessary.
Learnt from: unakb
PR: island-is/island.is#15378
File: apps/judicial-system/web/src/routes/Court/Indictments/Summary/Summary.tsx:86-100
Timestamp: 2024-11-12T15:15:11.835Z
Learning: User unakb prefers explicit case handling in switch statements for key functionalities like `getRulingDecisionTagColor` to ensure clarity and avoid assumptions that a case was overlooked.
Datadog ReportBranch report: ✅ 0 Failed, 336 Passed, 0 Skipped, 1m 10.84s Total Time |
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.
Nice, let's see what this tells us, will get us moving in the right direction hopefully to eliminating the flakiness 🙏
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.
e2e config LGTM 👍
Debug and research flakiness in our E2E tests
What
slowMo
option. Locally the tests now take 515s or ~8.5m to execute.Why
Checklist:
Summary by CodeRabbit
Tests
Chores