Skip to content

[8.x] [scout] unique runId for reporting, disabled failed test reporter locally (#209507)#210088

Merged
kibanamachine merged 2 commits intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-209507
Feb 9, 2025
Merged

[8.x] [scout] unique runId for reporting, disabled failed test reporter locally (#209507)#210088
kibanamachine merged 2 commits intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-209507

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by: Dzmitry Lemechko "}},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com//pull/209507","number":209507,"mergeCommit":{"message":"[scout] unique runId for reporting, disabled failed test reporter locally (#209507)\n\n## Summary\r\n\r\nThis PR makes few changes to scout reporter:\r\n\r\nRecently I found out that Playwright load configuration file _multiple\r\ntimes_:\r\n- first time after you run `npx playwright test -c ...`\r\n- on every worker start\r\n\r\nlog before:\r\n\r\n```\r\n[main][~/github/kibana]$ npx playwright test --config x-pack/platform/plugins/shared/maps/ui_tests/playwright.config.ts\r\n[createPlaywrightConfig] called with runId: 18f35f735a10155c\r\n\r\nRunning 1 test using 1 worker\r\n\r\n[createPlaywrightConfig] called with runId: 2633b4e4c20afa15\r\n[chromium] › full_screen_mode.spec.ts:28:9 › Maps › Full screen mode @svlSecurity @svlOblt @svlSearch @ess\r\n```\r\n\r\nWith our current logic unique `runId` will be generated on each\r\nconfiguration load, meaning for parallel run we will report failures in\r\ndifferent directories instead of the same one.\r\n\r\nPlaywright doesn't expose any unique identifier for the run, so we have\r\ndo something similar described in\r\n\r\nhttps://github.com/microsoft/playwright/issues/28941#issuecomment-1888008102\r\n\r\nlog after fix:\r\n\r\n```\r\n[main][~/github/kibana]$ npx playwright test --config x-pack/platform/plugins/shared/maps/ui_tests/playwright.config.ts\r\n[createPlaywrightConfig] called with runId: 310a576f32d3b8a5\r\n\r\nRunning 1 test using 1 worker\r\n\r\n[createPlaywrightConfig] called with runId: 310a576f32d3b8a5\r\n[chromium] › full_screen_mode.spec.ts:28:9 › Maps › Full screen mode @svlSecurity @svlOblt @svlSearch @ess\r\n```\r\n\r\nWe also had a chat with @dolaru and agreed that Scout reporters to be\r\ndisabled for local test run. Few reasons:\r\n- Scout custom reporting targets CI execution: events-based reporter was\r\nalready disabled\r\n- Failed test reporter purpose is to provide html boilerplate to be\r\nannotated in pipeline build\r\n- When you run tests with IDE playwright plugin it provides its own\r\nreporter / history, should be enough.","sha":"6635fe501c307d567afa71a346fc91a7675e3cc5"}}]}] BACKPORT-->

…ally (elastic#209507)

## Summary

This PR makes few changes to scout reporter:

Recently I found out that Playwright load configuration file _multiple
times_:
- first time after you run `npx playwright test -c ...`
- on every worker start

log before:

```
[main][~/github/kibana]$ npx playwright test --config x-pack/platform/plugins/shared/maps/ui_tests/playwright.config.ts
[createPlaywrightConfig] called with runId: 18f35f735a10155c

Running 1 test using 1 worker

[createPlaywrightConfig] called with runId: 2633b4e4c20afa15
[chromium] › full_screen_mode.spec.ts:28:9 › Maps › Full screen mode @svlSecurity @svlOblt @svlSearch @ess
```

With our current logic unique `runId` will be generated on each
configuration load, meaning for parallel run we will report failures in
different directories instead of the same one.

Playwright doesn't expose any unique identifier for the run, so we have
do something similar described in

microsoft/playwright#28941 (comment)

log after fix:

```
[main][~/github/kibana]$ npx playwright test --config x-pack/platform/plugins/shared/maps/ui_tests/playwright.config.ts
[createPlaywrightConfig] called with runId: 310a576f32d3b8a5

Running 1 test using 1 worker

[createPlaywrightConfig] called with runId: 310a576f32d3b8a5
[chromium] › full_screen_mode.spec.ts:28:9 › Maps › Full screen mode @svlSecurity @svlOblt @svlSearch @ess
```

We also had a chat with @dolaru and agreed that Scout reporters to be
disabled for local test run. Few reasons:
- Scout custom reporting targets CI execution: events-based reporter was
already disabled
- Failed test reporter purpose is to provide html boilerplate to be
annotated in pipeline build
- When you run tests with IDE playwright plugin it provides its own
reporter / history, should be enough.

(cherry picked from commit 6635fe5)
@kibanamachine kibanamachine merged commit 2046aed into elastic:8.x Feb 9, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @dmlemeshko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants