Skip to content

Commit

Permalink
[Security Solution] Fix PATCH rule API test failure in Serverless (el…
Browse files Browse the repository at this point in the history
…astic#202885)

**Resolves: elastic#202812

## Summary
This PR fixes a problem in the MKI Serverless periodic pipeline that was
introduced in elastic#201825. The issue happened because the test tried to
delete prebuilt rule assets stored in .kibana_security_solution, but you
can’t access this index in Serverless MKI.

The fix makes sure this call only runs in non-Serverless MKI
environments.
  • Loading branch information
nikitaindik authored and SoniaSanzV committed Dec 9, 2024
1 parent 4befc6f commit 169b0c2
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default ({ getService }: FtrProviderContext) => {
describe('patch rules', () => {
beforeEach(async () => {
await deleteAllRules(supertest, log);
await deleteAllPrebuiltRuleAssets(es, log);
});

it('should patch a single rule property of name using a rule_id', async () => {
Expand Down Expand Up @@ -233,8 +232,8 @@ export default ({ getService }: FtrProviderContext) => {
});
});

// Unskip: https://github.com/elastic/kibana/issues/195921
it('@skipInServerlessMKI throws an error if rule has external rule source and non-customizable fields are changed', async () => {
await deleteAllPrebuiltRuleAssets(es, log);
// Install base prebuilt detection rule
await createHistoricalPrebuiltRuleAssetSavedObjects(es, [
createRuleAssetSavedObject({ rule_id: 'rule-1', author: ['elastic'] }),
Expand Down

0 comments on commit 169b0c2

Please sign in to comment.