Skip to content

[9.1] [scout] adding ESLint rules for test package imports (#225791)#226138

Merged
dmlemeshko merged 5 commits intoelastic:9.1from
dmlemeshko:backport/9.1/pr-225791
Jul 7, 2025
Merged

[9.1] [scout] adding ESLint rules for test package imports (#225791)#226138
dmlemeshko merged 5 commits intoelastic:9.1from
dmlemeshko:backport/9.1/pr-225791

Conversation

@dmlemeshko
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.1:

Questions ?

Please refer to the Backport tool documentation

## Summary

Adding ESLint rules to control the proper test package is used for
testing:

- platform tests should import only from `@kbn/scout`
- solution tests should import only from solution-specific scout package
(e.g. security plugins => `@kbn/scout-security`)

example:

```
ERROR
/Users/dmle/github/kibana/x-pack/solutions/observability/plugins/apm/ui_tests/parallel_tests/service_inventory/service_inventory.spec.ts
        7:1  error  '@kbn/scout' import is restricted from being used by a pattern.
Observability solution tests should import from '@kbn/scout-oblt' instead  no-restricted-imports

      ✖ 1 problem (1 error, 0 warnings)
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 4c6ab87)

# Conflicts:
#	x-pack/solutions/observability/plugins/observability/tsconfig.json
#	x-pack/solutions/observability/plugins/observability/ui_tests/fixtures/generators.ts
@dmlemeshko dmlemeshko requested a review from kibanamachine as a code owner July 2, 2025 10:31
@dmlemeshko dmlemeshko added the backport This PR is a backport of another PR label Jul 2, 2025
@dmlemeshko dmlemeshko enabled auto-merge (squash) July 2, 2025 10:31
@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Jul 2, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@dmlemeshko dmlemeshko requested review from fake-haris and jbudz July 2, 2025 20:16
@dmlemeshko dmlemeshko merged commit 548f94a into elastic:9.1 Jul 7, 2025
12 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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 Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants