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][Exceptions]- Increase exceptions test coverage #152757

Merged
merged 69 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
8d500d5
add coverage for endpoint exception when close alert is ticked
WafaaNasr Feb 21, 2023
4b216d0
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Mar 1, 2023
99dfcd0
e2e add endpoint exception from alert table and validate closealert
WafaaNasr Mar 6, 2023
8312650
update mapping to match data
WafaaNasr Mar 7, 2023
36f7954
validate alert count + change desc of test
WafaaNasr Mar 7, 2023
b690e65
implement case C15235
WafaaNasr Mar 7, 2023
bf2e1b1
apply new cypress schema changes
WafaaNasr Mar 8, 2023
0647cc1
organise tests to be under the correct folder
WafaaNasr Mar 8, 2023
099d293
add test for coping comment to clipboard
WafaaNasr Mar 8, 2023
db3d0d9
merge with latest
WafaaNasr Mar 9, 2023
2b54c23
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Mar 10, 2023
2fc628d
rename comments actions + highlight C15229 test case by adding comment
WafaaNasr Mar 10, 2023
a18a995
restructuring exceptions entries tests and add new tests for comments
WafaaNasr Mar 21, 2023
d8de292
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Mar 21, 2023
82e5a8d
rename flyout_validations
WafaaNasr Mar 21, 2023
d6a2d68
add unicode in exception comment
WafaaNasr Mar 22, 2023
cdfa094
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Mar 22, 2023
838cda7
revert flyout validations
WafaaNasr Mar 23, 2023
e21b070
divide validations into sections
WafaaNasr Mar 23, 2023
7f1dcdd
add sync file
WafaaNasr Mar 28, 2023
dc1d25a
add sync test for editing exception after delete C34929
WafaaNasr Mar 30, 2023
6d9f185
fix conflicts
WafaaNasr Mar 30, 2023
d9bc04f
Merge branch 'main' into increase-exceptions-test-coverage
kibanamachine Mar 30, 2023
c3e64d7
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Mar 30, 2023
b25c969
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Mar 31, 2023
5428f93
add tests for delete value list references exceptions and sync
WafaaNasr Mar 31, 2023
29b6cd6
comment the conflict data in flyout validtions
WafaaNasr Apr 4, 2023
19edf8e
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Apr 4, 2023
43e3ed6
skip the flyout_validations until fixing the rerendering issue
WafaaNasr Apr 4, 2023
544111f
simplifing comments
WafaaNasr Apr 4, 2023
59ccaf0
remove th empty file
WafaaNasr Apr 4, 2023
625fb33
use value list in exception entry
WafaaNasr Apr 5, 2023
c7a87b2
C76973 test affected rules in exception viewer
WafaaNasr Apr 6, 2023
6a57d1c
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Apr 6, 2023
0e28c7d
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Apr 11, 2023
d6129ed
merge with latest
WafaaNasr Apr 24, 2023
3b19578
undo from debugging
WafaaNasr Apr 24, 2023
fe788e7
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Apr 26, 2023
4a75a51
Add tests to cover the migrations cases
WafaaNasr Apr 26, 2023
767e92d
rename the ftr create_exceptions to exceptions_workflows
WafaaNasr Apr 26, 2023
1e53cd1
add tests for shared exceptions lists
WafaaNasr Apr 26, 2023
f4ebc08
classify the shared list according to its different functionality
WafaaNasr Apr 27, 2023
5e6395c
merge with latest
WafaaNasr Apr 27, 2023
7cef488
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Apr 28, 2023
c3793ab
add tests for linking rules in page detail
WafaaNasr Apr 28, 2023
08725b3
remove comment
WafaaNasr Apr 28, 2023
8189789
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Apr 28, 2023
3422562
update name of test subj and todo change callback name
WafaaNasr Apr 28, 2023
1228a71
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr May 9, 2023
9b0e830
Use CleanKibana instead esArchive and refactor the affecting rules in…
WafaaNasr May 16, 2023
5b877b6
apply comments
WafaaNasr May 16, 2023
e0e24f7
wrap exception actions into tasks
WafaaNasr May 17, 2023
cae58fd
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr May 17, 2023
0887b7b
fix opened Alerts validations after closing one endpoint exception
WafaaNasr May 17, 2023
31e49fd
merge with latest changes
WafaaNasr May 31, 2023
b8d64cb
use esArchiverResetKibana to isolate the tests
WafaaNasr May 31, 2023
95d2625
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Jun 1, 2023
5f80200
fix rule exception
WafaaNasr Jun 1, 2023
844608d
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Jun 2, 2023
3c7b83f
change parallelism from 15 to 10
WafaaNasr Jun 2, 2023
ffc405d
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Jun 2, 2023
c494b59
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Jun 2, 2023
3671938
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Jun 2, 2023
7cb1546
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Jun 5, 2023
0e5f52f
remove the unused exception index in comments tests as well add more …
WafaaNasr Jun 5, 2023
dfaf2c9
fix conflict and revert parallelism change
WafaaNasr Jun 6, 2023
5bd96c6
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Jun 7, 2023
d49bd16
create task for saving managed rules
WafaaNasr Jun 7, 2023
abcba1b
Merge branch 'main' of https://github.com/elastic/kibana into increas…
WafaaNasr Jun 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/pipelines/pull_request/security_solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 15
parallelism: 10
WafaaNasr marked this conversation as resolved.
Show resolved Hide resolved
retry:
automatic:
- exit_status: '-1'
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const MenuItemsComponent: FC<MenuItemsProps> = ({
{canUserEditList && (
<EuiFlexItem>
<EuiButton
data-test-subj={`${dataTestSubj || ''}ManageRulesButton`}
data-test-subj={`${dataTestSubj || ''}LinkRulesButton`}
fill
onClick={() => {
if (typeof onManageRules === 'function') onManageRules();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('MenuItems', () => {
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.getByTestId('LinkedRulesMenuItems')).toHaveTextContent('Linked to 1 rules');
expect(wrapper.getByTestId('ManageRulesButton')).toBeInTheDocument();
expect(wrapper.getByTestId('LinkRulesButton')).toBeInTheDocument();
expect(wrapper.getByTestId('MenuActionsButtonIcon')).toBeInTheDocument();
});
it('should not render linkedRules HeaderMenu component, instead should render a text', () => {
Expand Down Expand Up @@ -101,7 +101,7 @@ describe('MenuItems', () => {
/>
);
expect(wrapper).toMatchSnapshot();
expect(wrapper.queryByTestId('ManageRulesButton')).not.toBeInTheDocument();
expect(wrapper.queryByTestId('LinkRulesButton')).not.toBeInTheDocument();
});
it('should call onManageRules', () => {
const wrapper = render(
Expand All @@ -115,7 +115,7 @@ describe('MenuItems', () => {
onManageRules={onManageRules}
/>
);
fireEvent.click(wrapper.getByTestId('ManageRulesButton'));
fireEvent.click(wrapper.getByTestId('LinkRulesButton'));
expect(onManageRules).toHaveBeenCalled();
});
it('should call onExportModalOpen', () => {
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/lists/common/constants.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,6 @@ export const _VERSION = 'WzI5NywxXQ==';
export const VERSION = 1;
export const IMMUTABLE = false;
export const IMPORT_TIMEOUT = moment.duration(5, 'minutes');

/** Added in 8.7 */
export const EXPIRE_TIME = '2023-04-24T19:00:00.000Z';
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
COMMENTS,
DESCRIPTION,
ENTRIES,
EXPIRE_TIME,
ITEM_ID,
ITEM_TYPE,
LIST_ID,
Expand Down Expand Up @@ -60,3 +61,18 @@ export const getCreateExceptionListItemMinimalSchemaMockWithoutId =
os_types: OS_TYPES,
type: ITEM_TYPE,
});

/**
* Useful for testing newer exception list item versions, as the previous
* versions can be used to test migration cases
*/
export const getCreateExceptionListItemNewerVersionSchemaMock =
(): CreateExceptionListItemSchema => ({
description: DESCRIPTION,
entries: ENTRIES,
expire_time: EXPIRE_TIME,
list_id: LIST_ID,
name: NAME,
os_types: OS_TYPES,
type: ITEM_TYPE,
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ImportExceptionsListSchema,
} from '@kbn/securitysolution-io-ts-list-types';

import { ENTRIES } from '../../constants.mock';
import { ENTRIES, EXPIRE_TIME } from '../../constants.mock';

export const getImportExceptionsListSchemaMock = (
listId = 'detection_list_id'
Expand All @@ -23,6 +23,10 @@ export const getImportExceptionsListSchemaMock = (
type: 'detection',
});

/**
This mock holds the old properties of the Exception List item
so that we can test the migration test cases
WafaaNasr marked this conversation as resolved.
Show resolved Hide resolved
*/
export const getImportExceptionsListItemSchemaMock = (
itemId = 'item_id_1',
listId = 'detection_list_id'
Expand All @@ -35,6 +39,23 @@ export const getImportExceptionsListItemSchemaMock = (
type: 'simple',
});

/**
This mock will hold the new properties of the Exception List item
so please keep it updated with the new ones and use it to test the
new scenarios
*/
export const getImportExceptionsListItemNewerVersionSchemaMock = (
itemId = 'item_id_1',
listId = 'detection_list_id'
): ImportExceptionListItemSchema => ({
description: 'some description',
entries: ENTRIES,
expire_time: EXPIRE_TIME,
item_id: itemId,
list_id: listId,
name: 'Query with a rule id',
type: 'simple',
});
export const getImportExceptionsListSchemaDecodedMock = (
listId = 'detection_list_id'
): ImportExceptionListSchemaDecoded => ({
Expand Down
Loading