[Security Solution] [Attack discovery] Improves Attack discovery code coverage#186679
Merged
andrew-goldstein merged 2 commits intoelastic:mainfrom Jun 25, 2024
Merged
Conversation
Contributor
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
56bf759 to
3168bdd
Compare
…ode coverage ### Summary This PR improves unit test coverage for the [Attack discovery](elastic#181818) feature. ### Desk testing Run `node scripts/jest --watch x-pack/plugins/security_solution/public/attack_discovery --coverage`
3168bdd to
1e3c9a5
Compare
stephmilovic
approved these changes
Jun 25, 2024
Contributor
stephmilovic
left a comment
There was a problem hiding this comment.
Nice work Andrew! LGTM
Here is the before/after on code coverage. Awesome job!
| % Stmts | % Branch | % Funcs | % Lines |
| 83.31. | 61.64 | 72.36. | 85.1 |
| 92.1 | 77 | 86.95 | 92.76 |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
andrew-goldstein
added a commit
to andrew-goldstein/kibana
that referenced
this pull request
Aug 29, 2024
…hs ago in [this pr](elastic#186679), as tracked by elastic#189757
andrew-goldstein
added a commit
that referenced
this pull request
Aug 29, 2024
) Fixes a flakey jest test that failed twice since it was introduced ~2 months ago in [this pr](#186679), as tracked by #189757 ### CI and desk flake testing To test the fix for fakyness, it ran `10,000` times in CI, and locally, with a `100%` success rate. (The test was wrapped in a loop to execute 10,000 times.) - Tested in CI 10,000 times via following Buildkite build: :green_heart: Build Succeeded [Buildkite Build](https://buildkite.com/elastic/kibana-pull-request/builds/230901) The 10,000 passing test runs are included in the following (abbreviated) build log output: ``` Ran all test suites. $ node scripts/jest --config x-pack/plugins/security_solution/public/attack_discovery/jest.config.js actual full command is: NODE_OPTIONS="--max-old-space-size=12288 --trace-warnings" node ./scripts/jest --config="x-pack/plugins/security_solution/public/attack_discovery/jest.config.js" --runInBand --coverage=false --passWithNoTests PASS x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx (742.054 s) # other passing tests... Test Suites: 54 passed, 54 total Tests: 10297 passed, 10297 total Snapshots: 0 total Time: 962.106 s ``` - Tested locally 10,000 times, as illustrated by the following console output: ``` ✓ renders the expected the timer text - iteration 9996 (43 ms) ✓ renders the expected the timer text - iteration 9997 (44 ms) ✓ renders the expected the timer text - iteration 9998 (48 ms) ✓ renders the expected the timer text - iteration 9999 (49 ms) ✓ renders the expected the timer text - iteration 10000 (46 ms) Test Suites: 1 passed, 1 total Tests: 10002 passed, 10002 total Snapshots: 0 total Time: 294.54 s Ran all test suites matching /x-pack\/plugins\/security_solution\/public\/attack_discovery\/pages\/loading_callout\/countdown\/index.test.tsx/i. ```
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Aug 29, 2024
…tic#191736) Fixes a flakey jest test that failed twice since it was introduced ~2 months ago in [this pr](elastic#186679), as tracked by elastic#189757 ### CI and desk flake testing To test the fix for fakyness, it ran `10,000` times in CI, and locally, with a `100%` success rate. (The test was wrapped in a loop to execute 10,000 times.) - Tested in CI 10,000 times via following Buildkite build: :green_heart: Build Succeeded [Buildkite Build](https://buildkite.com/elastic/kibana-pull-request/builds/230901) The 10,000 passing test runs are included in the following (abbreviated) build log output: ``` Ran all test suites. $ node scripts/jest --config x-pack/plugins/security_solution/public/attack_discovery/jest.config.js actual full command is: NODE_OPTIONS="--max-old-space-size=12288 --trace-warnings" node ./scripts/jest --config="x-pack/plugins/security_solution/public/attack_discovery/jest.config.js" --runInBand --coverage=false --passWithNoTests PASS x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx (742.054 s) # other passing tests... Test Suites: 54 passed, 54 total Tests: 10297 passed, 10297 total Snapshots: 0 total Time: 962.106 s ``` - Tested locally 10,000 times, as illustrated by the following console output: ``` ✓ renders the expected the timer text - iteration 9996 (43 ms) ✓ renders the expected the timer text - iteration 9997 (44 ms) ✓ renders the expected the timer text - iteration 9998 (48 ms) ✓ renders the expected the timer text - iteration 9999 (49 ms) ✓ renders the expected the timer text - iteration 10000 (46 ms) Test Suites: 1 passed, 1 total Tests: 10002 passed, 10002 total Snapshots: 0 total Time: 294.54 s Ran all test suites matching /x-pack\/plugins\/security_solution\/public\/attack_discovery\/pages\/loading_callout\/countdown\/index.test.tsx/i. ``` (cherry picked from commit e0f8eb1)
kibanamachine
added a commit
that referenced
this pull request
Aug 29, 2024
#191736) (#191774) # Backport This will backport the following commits from `main` to `8.15`: - [[Security Solution] [Attack discovery] Fixes a flakey jest test (#191736)](#191736) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Andrew Macri","email":"andrew.macri@elastic.co"},"sourceCommit":{"committedDate":"2024-08-29T21:29:52Z","message":"[Security Solution] [Attack discovery] Fixes a flakey jest test (#191736)\n\nFixes a flakey jest test that failed twice since it was introduced ~2 months ago in [this pr](#186679), as tracked by https://github.com/elastic/kibana/issues/189757\r\n\r\n### CI and desk flake testing\r\n\r\nTo test the fix for fakyness, it ran `10,000` times in CI, and locally, with a `100%` success rate. (The test was wrapped in a loop to execute 10,000 times.)\r\n\r\n- Tested in CI 10,000 times via following Buildkite build:\r\n\r\n:green_heart: Build Succeeded\r\n[Buildkite Build](https://buildkite.com/elastic/kibana-pull-request/builds/230901)\r\n\r\nThe 10,000 passing test runs are included in the following (abbreviated) build log output:\r\n\r\n```\r\nRan all test suites.\r\n$ node scripts/jest --config x-pack/plugins/security_solution/public/attack_discovery/jest.config.js\r\nactual full command is:\r\nNODE_OPTIONS=\"--max-old-space-size=12288 --trace-warnings\" node ./scripts/jest --config=\"x-pack/plugins/security_solution/public/attack_discovery/jest.config.js\" --runInBand --coverage=false --passWithNoTests\r\n PASS x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx (742.054 s)\r\n# other passing tests...\r\n\r\nTest Suites: 54 passed, 54 total\r\nTests: 10297 passed, 10297 total\r\nSnapshots: 0 total\r\nTime: 962.106 s\r\n```\r\n\r\n- Tested locally 10,000 times, as illustrated by the following console output:\r\n\r\n```\r\n ✓ renders the expected the timer text - iteration 9996 (43 ms)\r\n ✓ renders the expected the timer text - iteration 9997 (44 ms)\r\n ✓ renders the expected the timer text - iteration 9998 (48 ms)\r\n ✓ renders the expected the timer text - iteration 9999 (49 ms)\r\n ✓ renders the expected the timer text - iteration 10000 (46 ms)\r\n\r\nTest Suites: 1 passed, 1 total\r\nTests: 10002 passed, 10002 total\r\nSnapshots: 0 total\r\nTime: 294.54 s\r\nRan all test suites matching /x-pack\\/plugins\\/security_solution\\/public\\/attack_discovery\\/pages\\/loading_callout\\/countdown\\/index.test.tsx/i.\r\n```","sha":"e0f8eb1b6bf0f609b7b2b0b6a34216745a3be29f","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Security Generative AI","v8.16.0","v8.15.1"],"title":"[Security Solution] [Attack discovery] Fixes a flakey jest test","number":191736,"url":"https://github.com/elastic/kibana/pull/191736","mergeCommit":{"message":"[Security Solution] [Attack discovery] Fixes a flakey jest test (#191736)\n\nFixes a flakey jest test that failed twice since it was introduced ~2 months ago in [this pr](#186679), as tracked by https://github.com/elastic/kibana/issues/189757\r\n\r\n### CI and desk flake testing\r\n\r\nTo test the fix for fakyness, it ran `10,000` times in CI, and locally, with a `100%` success rate. (The test was wrapped in a loop to execute 10,000 times.)\r\n\r\n- Tested in CI 10,000 times via following Buildkite build:\r\n\r\n:green_heart: Build Succeeded\r\n[Buildkite Build](https://buildkite.com/elastic/kibana-pull-request/builds/230901)\r\n\r\nThe 10,000 passing test runs are included in the following (abbreviated) build log output:\r\n\r\n```\r\nRan all test suites.\r\n$ node scripts/jest --config x-pack/plugins/security_solution/public/attack_discovery/jest.config.js\r\nactual full command is:\r\nNODE_OPTIONS=\"--max-old-space-size=12288 --trace-warnings\" node ./scripts/jest --config=\"x-pack/plugins/security_solution/public/attack_discovery/jest.config.js\" --runInBand --coverage=false --passWithNoTests\r\n PASS x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx (742.054 s)\r\n# other passing tests...\r\n\r\nTest Suites: 54 passed, 54 total\r\nTests: 10297 passed, 10297 total\r\nSnapshots: 0 total\r\nTime: 962.106 s\r\n```\r\n\r\n- Tested locally 10,000 times, as illustrated by the following console output:\r\n\r\n```\r\n ✓ renders the expected the timer text - iteration 9996 (43 ms)\r\n ✓ renders the expected the timer text - iteration 9997 (44 ms)\r\n ✓ renders the expected the timer text - iteration 9998 (48 ms)\r\n ✓ renders the expected the timer text - iteration 9999 (49 ms)\r\n ✓ renders the expected the timer text - iteration 10000 (46 ms)\r\n\r\nTest Suites: 1 passed, 1 total\r\nTests: 10002 passed, 10002 total\r\nSnapshots: 0 total\r\nTime: 294.54 s\r\nRan all test suites matching /x-pack\\/plugins\\/security_solution\\/public\\/attack_discovery\\/pages\\/loading_callout\\/countdown\\/index.test.tsx/i.\r\n```","sha":"e0f8eb1b6bf0f609b7b2b0b6a34216745a3be29f"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191736","number":191736,"mergeCommit":{"message":"[Security Solution] [Attack discovery] Fixes a flakey jest test (#191736)\n\nFixes a flakey jest test that failed twice since it was introduced ~2 months ago in [this pr](#186679), as tracked by https://github.com/elastic/kibana/issues/189757\r\n\r\n### CI and desk flake testing\r\n\r\nTo test the fix for fakyness, it ran `10,000` times in CI, and locally, with a `100%` success rate. (The test was wrapped in a loop to execute 10,000 times.)\r\n\r\n- Tested in CI 10,000 times via following Buildkite build:\r\n\r\n:green_heart: Build Succeeded\r\n[Buildkite Build](https://buildkite.com/elastic/kibana-pull-request/builds/230901)\r\n\r\nThe 10,000 passing test runs are included in the following (abbreviated) build log output:\r\n\r\n```\r\nRan all test suites.\r\n$ node scripts/jest --config x-pack/plugins/security_solution/public/attack_discovery/jest.config.js\r\nactual full command is:\r\nNODE_OPTIONS=\"--max-old-space-size=12288 --trace-warnings\" node ./scripts/jest --config=\"x-pack/plugins/security_solution/public/attack_discovery/jest.config.js\" --runInBand --coverage=false --passWithNoTests\r\n PASS x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx (742.054 s)\r\n# other passing tests...\r\n\r\nTest Suites: 54 passed, 54 total\r\nTests: 10297 passed, 10297 total\r\nSnapshots: 0 total\r\nTime: 962.106 s\r\n```\r\n\r\n- Tested locally 10,000 times, as illustrated by the following console output:\r\n\r\n```\r\n ✓ renders the expected the timer text - iteration 9996 (43 ms)\r\n ✓ renders the expected the timer text - iteration 9997 (44 ms)\r\n ✓ renders the expected the timer text - iteration 9998 (48 ms)\r\n ✓ renders the expected the timer text - iteration 9999 (49 ms)\r\n ✓ renders the expected the timer text - iteration 10000 (46 ms)\r\n\r\nTest Suites: 1 passed, 1 total\r\nTests: 10002 passed, 10002 total\r\nSnapshots: 0 total\r\nTime: 294.54 s\r\nRan all test suites matching /x-pack\\/plugins\\/security_solution\\/public\\/attack_discovery\\/pages\\/loading_callout\\/countdown\\/index.test.tsx/i.\r\n```","sha":"e0f8eb1b6bf0f609b7b2b0b6a34216745a3be29f"}},{"branch":"8.15","label":"v8.15.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Andrew Macri <andrew.macri@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Security Solution] [Attack discovery] Improves Attack discovery code coverage
Summary
This PR improves unit test coverage for the Attack discovery feature.
Desk testing
Run
node scripts/jest --watch x-pack/plugins/security_solution/public/attack_discovery --coverage