[Scout] Further enhancements to AI Test Reviews + Scout Best Practices#264097
[Scout] Further enhancements to AI Test Reviews + Scout Best Practices#264097csr merged 16 commits intoelastic:mainfrom
Conversation
Vale Linting ResultsSummary: 1 warning, 1 suggestion found
|
| File | Line | Rule | Message |
|---|---|---|---|
| docs/extend/scout/best-practices.md | 757 | Elastic.DontUse | Don't use 'just'. |
💡 Suggestions (1)
| File | Line | Rule | Message |
|---|---|---|---|
| docs/extend/scout/best-practices.md | 501 | Elastic.WordChoice | Consider using 'can, might' instead of 'may', unless the term is in the UI. |
The Vale linter checks documentation changes against the Elastic Docs style guide.
To use Vale locally or report issues, refer to Elastic style guide for Vale.
| - Within a test, avoid relying on configuration, data, or behavior specific to a single deployment. Test logic should produce the same result locally and on Cloud. | ||
| - Run your tests against a real Elastic Cloud project before merging to catch environment-specific surprises early. See [Run tests on Elastic Cloud](./run-tests.md#scout-run-tests-cloud) for setup instructions. | ||
|
|
||
| ### Keep tests close to the code they test [keep-tests-close-to-source-code] |
There was a problem hiding this comment.
New best practice centered around selective testing. We also now mention selective testing in the Scout article (under "benefits" + FAQ).
There was a problem hiding this comment.
@dmlemeshko - will this selective testing "best practice" be enough? It's a bit generic, let me know if you can come up with something more specific.
💚 Build Succeeded
cc @csr |
|
|
||
| ### Keep tests close to the code they test [keep-tests-close-to-source-code] | ||
|
|
||
| Scout uses selective testing to run only the tests for modules affected by a PR. For this to work, tests must live in the same plugin or package as the code they cover, otherwise changes won't trigger the relevant tests. The full suite still runs post-merge on `kibana-on-merge`. |
There was a problem hiding this comment.
I'm not sure I follow how this instruction "Scout uses selective testing.." assists to code review and what do we expect it to do. If the focus is on "tests should be in the right place" I would phrase it more like looking into test scenarios and verify they logically belong to the plugin/package they were added it. For API tests you can check routes to be defined in /server directory.
For UI we can actualy mention checking '/public' dir to understand what plugin is doing.
steliosmavro
left a comment
There was a problem hiding this comment.
Looks good, left an optional nitpick! 🚀
|
|
||
| #### Q: What is selective testing? [scout-faq-selective-testing] | ||
|
|
||
| In PR builds, Scout automatically detects which modules changed and runs only the relevant tests, reducing CI time. |
There was a problem hiding this comment.
Do we have anything to link here? Feels like a link for more info is missing , like how to know that my tests are being picked up or something like that 🤔 just a thought.
Test Reviews (powered by Macroscope +
scout-best-practices-reviewerskill):Scout Best Practices Docs:
loadIfNeededbehaviorbeforeAll/afterAll