Skip to content

Commit 9b8ef82

Browse files
authored
[Security Solution] Make prebuilt rules bootstrap errors visible (elastic#239521)
**Partially addresses:** elastic#188090 ## Summary Prebuilt Rules bootstrap API endpoint may fail on a fresh deployment in Elastic Cloud. This PR rearranges assertions to provide an ability to view the error message.
1 parent 8758b5a commit 9b8ef82

File tree

1 file changed

+4
-3
lines changed
  • x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/oom_testing/install_prebuilt_rules

1 file changed

+4
-3
lines changed

x-pack/solutions/security/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/oom_testing/install_prebuilt_rules/install_prebuilt_rules.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ export default ({ getService }: FtrProviderContext): void => {
5959
});
6060

6161
it('install prebuilt rules from a package', async () => {
62-
const { body: bootstrapPrebuiltRulesResponse } = await detectionsApi
63-
.bootstrapPrebuiltRules()
64-
.expect(200);
62+
const { statusCode: bootstrapPrebuiltRulesStatusCode, body: bootstrapPrebuiltRulesResponse } =
63+
await detectionsApi.bootstrapPrebuiltRules();
6564

65+
// Assert body first to be able to see error messages in case of failure
6666
expect(bootstrapPrebuiltRulesResponse).toMatchObject({
6767
packages: expect.arrayContaining([
6868
expect.objectContaining({
@@ -73,6 +73,7 @@ export default ({ getService }: FtrProviderContext): void => {
7373
}),
7474
]),
7575
});
76+
expect(bootstrapPrebuiltRulesStatusCode).toBe(200);
7677

7778
const { body: reviewPrebuiltRulesForInstallationResponse } = await supertest
7879
.post(REVIEW_RULE_INSTALLATION_URL)

0 commit comments

Comments
 (0)