From 7ebfe0144c154354da6a9c81d766e24a835734a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Mon, 15 Jan 2024 21:23:57 +0100 Subject: [PATCH 1/3] Correctly get keys of assetsMap --- x-pack/plugins/fleet/server/services/epm/packages/install.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/fleet/server/services/epm/packages/install.ts b/x-pack/plugins/fleet/server/services/epm/packages/install.ts index 8dc9672f01ffc..f34ddf598a615 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/install.ts @@ -875,7 +875,7 @@ export async function installCustomPackage( acc.set(asset.path, asset.content); return acc; }, new Map()); - const paths = [...Object.keys(assetsMap)]; + const paths = [...assetsMap.keys()]; const packageInstallContext: PackageInstallContext = { assetsMap, From a1f520f06a40f46814c13ee56639194d1a1d0399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 16 Jan 2024 14:15:03 +0000 Subject: [PATCH 2/3] Enable obs-onboarding cypress tests for fleet changes --- .buildkite/scripts/pipelines/pull_request/pipeline.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index ca0a83616492e..47d1f75e88fb2 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -88,7 +88,10 @@ const uploadPipeline = (pipelineContent: string | object) => { } if ( - (await doAnyChangesMatch([/^x-pack\/plugins\/observability_onboarding/])) || + (await doAnyChangesMatch([ + /^x-pack\/plugins\/observability_onboarding/, + /^x-pack\/plugins\/fleet/, + ])) || GITHUB_PR_LABELS.includes('ci:all-cypress-suites') ) { pipeline.push( From 970fa20a200a0948af476cd3c666f71f6b934e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 16 Jan 2024 14:31:27 +0000 Subject: [PATCH 3/3] Restore custom integration test --- .../e2e/cypress/support/commands.ts | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/observability_onboarding/e2e/cypress/support/commands.ts b/x-pack/plugins/observability_onboarding/e2e/cypress/support/commands.ts index 843aca4c258ea..e989089f491eb 100644 --- a/x-pack/plugins/observability_onboarding/e2e/cypress/support/commands.ts +++ b/x-pack/plugins/observability_onboarding/e2e/cypress/support/commands.ts @@ -125,17 +125,30 @@ Cypress.Commands.add('deleteIntegration', (integrationName: string) => { cy.request({ log: false, - method: 'DELETE', + method: 'GET', url: `${kibanaUrl}/api/fleet/epm/packages/${integrationName}`, - body: { - force: false, - }, headers: { 'kbn-xsrf': 'e2e_test', - 'Elastic-Api-Version': '1', }, auth: { user: 'editor', pass: 'changeme' }, failOnStatusCode: false, + }).then((response) => { + const status = response.body.item?.status; + if (status === 'installed') { + cy.request({ + log: false, + method: 'DELETE', + url: `${kibanaUrl}/api/fleet/epm/packages/${integrationName}`, + body: { + force: false, + }, + headers: { + 'kbn-xsrf': 'e2e_test', + 'Elastic-Api-Version': '1', + }, + auth: { user: 'editor', pass: 'changeme' }, + }); + } }); });