Skip to content
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

[Security Solution] Adds tests for coverage overview page #168058

Merged
merged 52 commits into from
Jan 9, 2024

Conversation

dplumlee
Copy link
Contributor

@dplumlee dplumlee commented Oct 5, 2023

Resolves: #162250

Summary

Adds remaining unit, api integration, and e2e cypress tests for the coverage overview page in accordance to the existing test plan

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@dplumlee dplumlee added technical debt Improvement of the software architecture and operational architecture release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Feature:Rule Management Security Solution Detection Rule Management area Team:Detection Rule Management Security Detection Rule Management Team v8.11.1 labels Oct 5, 2023
@dplumlee dplumlee self-assigned this Oct 5, 2023
@dplumlee dplumlee marked this pull request as ready for review November 7, 2023 05:25
@dplumlee dplumlee requested review from a team as code owners November 7, 2023 05:25
@dplumlee dplumlee requested a review from rylnd November 7, 2023 05:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@dplumlee dplumlee requested a review from nikitaindik November 7, 2023 05:25
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@dplumlee dplumlee requested a review from banderror January 4, 2024 17:18
CoverageOverviewRequestBody,
CoverageOverviewRuleActivity,
CoverageOverviewRuleSource,
} from './coverage_overview_route';
Copy link
Contributor

Choose a reason for hiding this comment

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

Obviously not part of this PR, but these types need to be migrated to Zod. It makes testing these request schemas SO much easier and understandable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I saw the validation tests Dmitrii wrote with zod while writing these and thought the same. In a later PR these types definitely need to be switched over.

Copy link
Contributor

@jpdjere jpdjere left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments! Great comprehensive tests 👍

LGTM - but remember to fix the duplicate scripts in package.json!

@dplumlee
Copy link
Contributor Author

dplumlee commented Jan 4, 2024

@elasticmachine merge upstream

@dplumlee dplumlee force-pushed the coverage-overview-tests branch from 68ce0af to 6cd40c3 Compare January 5, 2024 22:48
@dplumlee
Copy link
Contributor Author

dplumlee commented Jan 6, 2024

@elasticmachine merge upstream

1 similar comment
@dplumlee
Copy link
Contributor Author

dplumlee commented Jan 8, 2024

@elasticmachine merge upstream

@dplumlee dplumlee force-pushed the coverage-overview-tests branch from 396e05d to 636311c Compare January 8, 2024 18:37
@dplumlee dplumlee requested a review from banderror January 8, 2024 18:38
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Detection Engine - Security Solution Cypress Tests #1 / Create DataView runtime field adds field to timeline adds field to timeline
  • [job] [logs] FTR Configs #50 / maps app Auto open file upload wizard in maps app "before all" hook for "should navigate to maps app with url params"

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 11.4MB 11.4MB +12.1KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @dplumlee

Copy link
Contributor

@banderror banderror left a comment

Choose a reason for hiding this comment

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

This is SO much more readable than the previous version 🙌
Thank you for addressing my feedback @dplumlee, LGTM 👍

@dplumlee dplumlee merged commit 315cf9d into elastic:main Jan 9, 2024
39 checks passed
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.12 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 168058

Questions ?

Please refer to the Backport tool documentation

@dplumlee
Copy link
Contributor Author

dplumlee commented Jan 9, 2024

💚 All backports created successfully

Status Branch Result
8.12

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

Questions ?

Please refer to the Backport tool documentation

dplumlee added a commit to dplumlee/kibana that referenced this pull request Jan 9, 2024
…8058)

**Resolves: elastic#162250

Adds remaining unit, api integration, and e2e cypress tests for the
coverage overview page in accordance to the [existing test
plan](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md)

- [Flaky test runner
build](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4756)

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 315cf9d)
dplumlee added a commit that referenced this pull request Jan 10, 2024
…8058) (#174549)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Security Solution] Adds tests for coverage overview page
(#168058)](#168058)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Davis
Plumlee","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-09T19:09:40Z","message":"[Security
Solution] Adds tests for coverage overview page (#168058)\n\n**Resolves:
https://github.com/elastic/kibana/issues/162250**\r\n\r\n##
Summary\r\n\r\nAdds remaining unit, api integration, and e2e cypress
tests for the\r\ncoverage overview page in accordance to the [existing
test\r\nplan](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md)\r\n\r\n-
[Flaky test
runner\r\nbuild](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4756)\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"315cf9d399c62a69dd02a1aed5ce7118ffa9885a","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["technical
debt","release_note:skip","Team:Detections and Resp","Team:
SecuritySolution","Feature:Rule Management","Team:Detection Rule
Management","v8.12.0","v8.13.0"],"number":168058,"url":"https://github.com/elastic/kibana/pull/168058","mergeCommit":{"message":"[Security
Solution] Adds tests for coverage overview page (#168058)\n\n**Resolves:
https://github.com/elastic/kibana/issues/162250**\r\n\r\n##
Summary\r\n\r\nAdds remaining unit, api integration, and e2e cypress
tests for the\r\ncoverage overview page in accordance to the [existing
test\r\nplan](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md)\r\n\r\n-
[Flaky test
runner\r\nbuild](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4756)\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"315cf9d399c62a69dd02a1aed5ce7118ffa9885a"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/168058","number":168058,"mergeCommit":{"message":"[Security
Solution] Adds tests for coverage overview page (#168058)\n\n**Resolves:
https://github.com/elastic/kibana/issues/162250**\r\n\r\n##
Summary\r\n\r\nAdds remaining unit, api integration, and e2e cypress
tests for the\r\ncoverage overview page in accordance to the [existing
test\r\nplan](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md)\r\n\r\n-
[Flaky test
runner\r\nbuild](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4756)\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"315cf9d399c62a69dd02a1aed5ce7118ffa9885a"}}]}]
BACKPORT-->
@dplumlee dplumlee deleted the coverage-overview-tests branch January 10, 2024 01:54
nreese pushed a commit to nreese/kibana that referenced this pull request Jan 10, 2024
…8058)

**Resolves: elastic#162250

## Summary

Adds remaining unit, api integration, and e2e cypress tests for the
coverage overview page in accordance to the [existing test
plan](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md)

- [Flaky test runner
build](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4756)

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
delanni pushed a commit to delanni/kibana that referenced this pull request Jan 11, 2024
…8058)

**Resolves: elastic#162250

## Summary

Adds remaining unit, api integration, and e2e cypress tests for the
coverage overview page in accordance to the [existing test
plan](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md)

- [Flaky test runner
build](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4756)

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Rule Management Security Solution Detection Rule Management area release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. technical debt Improvement of the software architecture and operational architecture v8.12.0 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solution] Add test coverage for Protections/Detections Coverage Overview
10 participants