-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[FTR] enable recommended mocha + no-floating-promises ESLint rules #190690
Conversation
/ci |
…a into add-mocha-rules-for-ftr
/ci |
/ci |
/ci |
/ci |
/ci |
1 similar comment
/ci |
/ci |
…to debug-build-failure
…a into debug-build-failure
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.
This is awesome! Thanks for doing this! Core changes LGTM
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.
LGTM
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.
Thanks for the changes, LGTM!
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.
Shared UX changes LGTM, thanks for this!!
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.
ML related changes LGTM.
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.
Entity Analytics LGTM, thanks for this 🚀
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.
LGTM
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.
Fleet changes 🚀
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.
ResponseOps changes LGTM
I opened #191185 to track the skipped Cases test
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.
LGTM
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.
Code review - test changes LGTM 👍 Thanks so much for tackling this cleanup!
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.
Detection engine changes (which involve skipping a previously false-positive test) LGTM. Thanks!
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @dmlemeshko |
## Summary This PR refactors the `setupFleetAndAgents` helper function into a `FleetAndAgents` FTR service, which is now initialized during the config file loading. Reason: The previous implementation of `setupFleetAndAgents` wrapped a Mocha `before` hook, which is considered an anti-pattern according to the Mocha ESLint rules that the Operations and QA teams have agreed to enable in the Kibana repo. It's best practice to avoid duplicating hooks, as this can lead to inconsistent test results and make debugging difficult. Ensuring a single before and after hook sequence guarantees that the associated logic runs in a predictable and sequential manner. This change also unblocks #191267, where we plan to enforce the same recommended Mocha ESLint rules that were previously enabled for UI tests in #190690. --------- Co-authored-by: kibanamachine <[email protected]>
## Summary Follow-up to #190690 Most of API integration tests does not match the path pattern set in the original PR (thanks @pheyos for catching it) and where not updated. This PR updates `.eslintrc.js` with explicit patterns to lint api_integration tests. Hopefully it is final change, but I rely on code owners to double check it. Most of the changes are trivial adjustments: - duplicated before/after hooks `mocha/no-sibling-hooks` - duplicated test titles `mocha/no-identical-title` - async function in describe() `mocha/no-async-describe` --------- Co-authored-by: Ash <[email protected]>
Summary
This PR enforces ESLint rules in FTR tests, in particular:
no-floating-promises
rule to catch unawaited Promises in tests/services/page objectsWhy is it important?
and others
Note for reviewers: some tests were skipped due to failures after missing
await
was added. Most likely is a "false positive" case when test is finished before async operation is actually completed. Please work on fixing and re-enabling it