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] Unskip remaining Jest tests from RAC rules migration #122677

Merged
merged 6 commits into from
Jan 13, 2022

Conversation

madirey
Copy link
Contributor

@madirey madirey commented Jan 11, 2022

Summary

This gives us the remaining coverage from when tests were skipped during the process of migrating to the new rules and alerts schema for 8.0.

Most of the tests would have already been passing, aside from internal unrelated changes that occurred while the tests were disabled. For those tests, I've documented the commits that necessitated test changes below.

Tests

  • Memory event code: Fields were removed here
  • Behavior event code: Fields were removed here
  • Threat indicator path: Default value was removed here
  • Prepackaged rules: Rule registry is always enabled
  • Update rules: Mocked function was removed here

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@madirey madirey mentioned this pull request Jan 11, 2022
20 tasks
@madirey madirey marked this pull request as ready for review January 11, 2022 19:09
@madirey madirey requested a review from a team as a code owner January 11, 2022 19:09
@madirey madirey added auto-backport Deprecated - use backport:version if exact versions are needed v8.0.0 v8.1.0 Feature:Detection Alerts Security Solution Detection Alerts Feature release_note:skip Skip the PR/issue when compiling release notes labels Jan 11, 2022
@madirey madirey requested a review from MadameSheema January 11, 2022 19:54
@kibana-ci
Copy link
Collaborator

kibana-ci commented Jan 11, 2022

💛 Build succeeded, but was flaky

Metrics [docs]

✅ unchanged

History

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

cc @madirey

@madirey madirey self-assigned this Jan 11, 2022
@madirey madirey added the Team:Detections and Resp Security Detection Response Team label Jan 11, 2022
@elasticmachine
Copy link
Contributor

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

getAlertMock(isRuleRegistryEnabled, getQueryRuleParams())
);
clients.rulesClient.find.mockResolvedValue(getFindResultWithSingleHit(true));
clients.rulesClient.update.mockResolvedValue(getAlertMock(true, getQueryRuleParams()));
Copy link
Member

@spong spong Jan 12, 2022

Choose a reason for hiding this comment

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

Can getAlertMock be refactored to remove the isRuleRegistryEnabled param now that we're in 8.0, or are there situations where it can still be disabled (and tested)?

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

One nit about if we can refactor getMockRule, but other than that LGTM! Thanks for looping back to unskip these and the additional details in the description @madirey! 🙂 🎉

Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

I had the same question about getAlertMock as Garret, but otherwise LGTM!

@@ -107,7 +107,7 @@ describe('AlertSummaryView', () => {
);
expect(container.querySelector('div[data-test-subj="summary-view"]')).toMatchSnapshot();
Copy link
Contributor

Choose a reason for hiding this comment

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

For posterity: it looks like these component/snapshot changes are due to the work done in #120347.

@@ -149,14 +148,19 @@ describe.skip('StepAboutRuleComponent', () => {
</ThemeProvider>
);

wrapper
Copy link
Contributor

@rylnd rylnd Jan 12, 2022

Choose a reason for hiding this comment

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

Should these DOM interactions not be contained within the act below? My understanding was that act allows the test framework to register/process/flush any changes to the DOM. If it works it works, but my concern is that these might break in the future. Happy to be corrected, though!

@madirey madirey merged commit c9dcd93 into elastic:main Jan 13, 2022
@madirey madirey deleted the unskip-rac-security-solution-tests branch January 13, 2022 13:33
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 13, 2022
…ion (elastic#122677)

* Regenerate snapshot of memory event summary rows

* Regenerate snapshot of behavior event summary rows

* Unskip StepAboutRuleComponent tests

* Unskip add_prepackaged_rules tests

* Unskip update_rules tests

(cherry picked from commit c9dcd93)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.0

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

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jan 17, 2022
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

1 similar comment
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

25 similar comments
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@marshallmain marshallmain added backport:skip This commit does not require backporting and removed v8.0.0 backport missing Added to PRs automatically when the are determined to be missing a backport. auto-backport Deprecated - use backport:version if exact versions are needed labels Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Detection Alerts Security Solution Detection Alerts Feature release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants