Skip to content

Commit

Permalink
[Security Solution][Cypress] - Update cypress tests to match new min …
Browse files Browse the repository at this point in the history
…interval for rules

Fixes failing cypress tests that are a result of this recent change within alerting - #125396

Rule min interval times now must be 1 minute or greater.
  • Loading branch information
yctercero authored Mar 1, 2022
1 parent 87a2cfa commit 774fd63
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe.skip('From alert', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRule({ ...getNewRule(), index: ['exceptions-*'] }, 'rule_testing', '10s');
createCustomRule({ ...getNewRule(), index: ['exceptions-*'] }, 'rule_testing');
reload();
goToRuleDetails();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe.skip('From rule', () => {
beforeEach(() => {
cleanKibana();
loginAndWaitForPageWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
createCustomRule({ ...getNewRule(), index: ['exceptions-*'] }, 'rule_testing', '10s');
createCustomRule({ ...getNewRule(), index: ['exceptions-*'] }, 'rule_testing');
reload();
goToRuleDetails();

Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/security_solution/cypress/objects/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ const getSeverityOverride4 = (): SeverityOverride => ({
sourceValue: 'auditbeat',
});

// Default interval is 1m, our tests config overwrite this to 1s
// See https://github.com/elastic/kibana/pull/125396 for details
const getRunsEvery = (): Interval => ({
interval: '1',
timeType: 'Seconds',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export const createCustomIndicatorRule = (rule: ThreatIndicatorRule, ruleId = 'r
rule_id: ruleId,
risk_score: parseInt(rule.riskScore, 10),
description: rule.description,
// Default interval is 1m, our tests config overwrite this to 1s
// See https://github.com/elastic/kibana/pull/125396 for details
interval: '10s',
name: rule.name,
severity: rule.severity.toLocaleLowerCase(),
Expand Down
3 changes: 3 additions & 0 deletions x-pack/test/security_solution_cypress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
'--xpack.ruleRegistry.write.enabled=true',
'--xpack.ruleRegistry.write.cache.enabled=false',
'--xpack.ruleRegistry.unsafe.indexUpgrade.enabled=true',
// Without below line, default interval for rules is 1m
// See https://github.com/elastic/kibana/pull/125396 for details
'--xpack.alerting.minimumScheduleInterval=1s',
'--xpack.ruleRegistry.unsafe.legacyMultiTenancy.enabled=true',
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
'riskyHostsEnabled',
Expand Down

0 comments on commit 774fd63

Please sign in to comment.