Skip to content

Conversation

@csr
Copy link
Contributor

@csr csr commented Jan 7, 2026

This PR updates the kbn-scout-reporting package to support Scout test file paths located in custom scout_<custom> directories (e.g., scout_uiam_local, scout_cspm_agentless).

Example of a path the package now supports:

x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts

With these fixes:

  • ✅ The test category is correctly parsed from the path and reported correctly
  • ✅ The plugin metadata is extracted from kibana.jsonc for failure reports

@csr csr self-assigned this Jan 7, 2026
@csr csr added release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release labels Jan 7, 2026

private getScoutConfigCategory(configPath: string): ScoutTestRunConfigCategory {
const pattern = /scout\/(api|ui)\//;
// match scout or scout_* directory
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem: previously, test config file paths such as x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts were being reported with an unknown test config category.

Fix: we now correctly handle this custom Scout path so we report the test config category (api-test in this case).

const pathSegments = configPath.split(path.sep);
const testDirIndex = pathSegments.indexOf('scout');
const testDirIndex = pathSegments.findIndex(
(segment) => segment === 'scout' || segment.startsWith('scout_')
Copy link
Contributor Author

@csr csr Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem: previously, the Scout Reporter wasn't able to infer the plugin manifest file path (this is important to derive info on the Kibana module type (e.g., plugin), group (e.g. platform), etc.

Fix: we now add support and the Kibana config file path is being reported correctly. We also no longer see errors like this one when we run tests (using npx playwright test --config ...):

Error in reporter Error: Invalid path: "scout" directory not found in /Users/cesaredecal/dev/kibana/x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts.

@csr csr changed the title [Scout Reporter] Support scout_* directories for test discovery and reporting [Scout Reporter] Support test/scout_<custom> directories for test discovery and reporting Jan 7, 2026
@csr csr changed the title [Scout Reporter] Support test/scout_<custom> directories for test discovery and reporting [Scout Reporter] Support test/scout_<custom> directories for test reporting Jan 7, 2026
@csr csr marked this pull request as ready for review January 7, 2026 09:56
@csr csr requested a review from a team as a code owner January 7, 2026 09:56
@csr
Copy link
Contributor Author

csr commented Jan 7, 2026

To check before merging: the AppEx QA cluster has the correct test config category filled out for scout_uiam_local. I have already checked this locally by running the test config with SCOUT_REPORTER_ENABLED=true npx playwright test --config and I could see the test config category in the generated .scout/reports event file.

@csr csr requested a review from dmlemeshko January 7, 2026 10:02
@csr csr changed the title [Scout Reporter] Support test/scout_<custom> directories for test reporting [Scout Reporter] Support scout_<custom> directories for test reporting Jan 7, 2026
Copy link
Contributor

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot for the quick fix!

@csr csr merged commit 28b7b03 into elastic:main Jan 7, 2026
17 checks passed
@csr csr deleted the fix-scout-reporter-custom-config-handling branch January 7, 2026 18:57
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/20793041150

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 7, 2026
…ing (elastic#248048)

This PR updates the `kbn-scout-reporting` package to support Scout test
file paths located in custom `scout_<custom>` directories (e.g.,
`scout_uiam_local`, `scout_cspm_agentless`).

Example of a path the package now supports:

```
x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts
```

With these fixes:
* ✅ The test category is correctly parsed from the path and reported
correctly
* ✅ The plugin metadata is extracted from `kibana.jsonc` for failure
reports

(cherry picked from commit 28b7b03)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 7, 2026
…ing (elastic#248048)

This PR updates the `kbn-scout-reporting` package to support Scout test
file paths located in custom `scout_<custom>` directories (e.g.,
`scout_uiam_local`, `scout_cspm_agentless`).

Example of a path the package now supports:

```
x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts
```

With these fixes:
* ✅ The test category is correctly parsed from the path and reported
correctly
* ✅ The plugin metadata is extracted from `kibana.jsonc` for failure
reports

(cherry picked from commit 28b7b03)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 7, 2026
…ing (elastic#248048)

This PR updates the `kbn-scout-reporting` package to support Scout test
file paths located in custom `scout_<custom>` directories (e.g.,
`scout_uiam_local`, `scout_cspm_agentless`).

Example of a path the package now supports:

```
x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts
```

With these fixes:
* ✅ The test category is correctly parsed from the path and reported
correctly
* ✅ The plugin metadata is extracted from `kibana.jsonc` for failure
reports

(cherry picked from commit 28b7b03)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 7, 2026
…ing (elastic#248048)

This PR updates the `kbn-scout-reporting` package to support Scout test
file paths located in custom `scout_<custom>` directories (e.g.,
`scout_uiam_local`, `scout_cspm_agentless`).

Example of a path the package now supports:

```
x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts
```

With these fixes:
* ✅ The test category is correctly parsed from the path and reported
correctly
* ✅ The plugin metadata is extracted from `kibana.jsonc` for failure
reports

(cherry picked from commit 28b7b03)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1
9.2
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jan 7, 2026
…reporting (#248048) (#248172)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Scout Reporter] Support `scout_<custom>` directories for test
reporting (#248048)](#248048)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Cesare de
Cal","email":"[email protected]"},"sourceCommit":{"committedDate":"2026-01-07T18:57:39Z","message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"[Scout
Reporter] Support `scout_<custom>` directories for test
reporting","number":248048,"url":"https://github.com/elastic/kibana/pull/248048","mergeCommit":{"message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248048","number":248048,"mergeCommit":{"message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7"}}]}]
BACKPORT-->

Co-authored-by: Cesare de Cal <[email protected]>
kibanamachine added a commit that referenced this pull request Jan 7, 2026
… reporting (#248048) (#248170)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Scout Reporter] Support `scout_<custom>` directories for test
reporting (#248048)](#248048)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Cesare de
Cal","email":"[email protected]"},"sourceCommit":{"committedDate":"2026-01-07T18:57:39Z","message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"[Scout
Reporter] Support `scout_<custom>` directories for test
reporting","number":248048,"url":"https://github.com/elastic/kibana/pull/248048","mergeCommit":{"message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248048","number":248048,"mergeCommit":{"message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7"}}]}]
BACKPORT-->

Co-authored-by: Cesare de Cal <[email protected]>
kibanamachine added a commit that referenced this pull request Jan 7, 2026
…reporting (#248048) (#248171)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Scout Reporter] Support `scout_<custom>` directories for test
reporting (#248048)](#248048)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Cesare de
Cal","email":"[email protected]"},"sourceCommit":{"committedDate":"2026-01-07T18:57:39Z","message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"[Scout
Reporter] Support `scout_<custom>` directories for test
reporting","number":248048,"url":"https://github.com/elastic/kibana/pull/248048","mergeCommit":{"message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248048","number":248048,"mergeCommit":{"message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7"}}]}]
BACKPORT-->

Co-authored-by: Cesare de Cal <[email protected]>
kibanamachine added a commit that referenced this pull request Jan 8, 2026
…reporting (#248048) (#248173)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[Scout Reporter] Support `scout_<custom>` directories for test
reporting (#248048)](#248048)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Cesare de
Cal","email":"[email protected]"},"sourceCommit":{"committedDate":"2026-01-07T18:57:39Z","message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"[Scout
Reporter] Support `scout_<custom>` directories for test
reporting","number":248048,"url":"https://github.com/elastic/kibana/pull/248048","mergeCommit":{"message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248048","number":248048,"mergeCommit":{"message":"[Scout
Reporter] Support `scout_<custom>` directories for test reporting
(#248048)\n\nThis PR updates the `kbn-scout-reporting` package to
support Scout test\nfile paths located in custom `scout_<custom>`
directories (e.g.,\n`scout_uiam_local`,
`scout_cspm_agentless`).\n\nExample of a path the package now
supports:\n\n```
\nx-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts\n```\n\nWith
these fixes:\n* ✅ The test category is correctly parsed from the path
and reported\ncorrectly\n* ✅ The plugin metadata is extracted from
`kibana.jsonc` for
failure\nreports","sha":"28b7b03dbc1ce89f687081f090d9965817d45fd7"}}]}]
BACKPORT-->

Co-authored-by: Cesare de Cal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release release_note:skip Skip the PR/issue when compiling release notes v8.19.10 v9.1.10 v9.2.4 v9.3.0 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants