From 55e78d52ef4da04040f7f2289107704450dc9098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Tue, 17 Dec 2024 20:38:17 +0100 Subject: [PATCH 1/3] Skip UA tests when running fwd-compatibility tests --- .../apis/upgrade_assistant/index.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/upgrade_assistant/index.ts b/x-pack/test/api_integration/apis/upgrade_assistant/index.ts index 21aeea27e6174..264e37d366606 100644 --- a/x-pack/test/api_integration/apis/upgrade_assistant/index.ts +++ b/x-pack/test/api_integration/apis/upgrade_assistant/index.ts @@ -5,10 +5,26 @@ * 2.0. */ +import { version as kibanaVersion } from '../../../../package.json'; import { FtrProviderContext } from '../../ftr_provider_context'; -export default function ({ loadTestFile }: FtrProviderContext) { +export default function ({ loadTestFile, getService }: FtrProviderContext) { describe('Upgrade Assistant', function () { + const es = getService('es'); + + before( + "Check version to avoid failures during forward-compatibility tests where these don't make sense", + async () => { + const { + version: { number: esVersion }, + } = await es.info(); + if (esVersion !== kibanaVersion) { + // @ts-expect-error for some reason TS thinks it's jest and not mocha: https://mochajs.org/#inclusive-tests + this.skip(); + } + } + ); + loadTestFile(require.resolve('./upgrade_assistant')); loadTestFile(require.resolve('./cloud_backup_status')); loadTestFile(require.resolve('./privileges')); From 9431eb6db60dfadafd764dad2f8e2fb3180a0fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Tue, 17 Dec 2024 21:18:49 +0100 Subject: [PATCH 2/3] Fix package.json import --- x-pack/test/api_integration/apis/upgrade_assistant/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/upgrade_assistant/index.ts b/x-pack/test/api_integration/apis/upgrade_assistant/index.ts index 264e37d366606..61e2dbce21fee 100644 --- a/x-pack/test/api_integration/apis/upgrade_assistant/index.ts +++ b/x-pack/test/api_integration/apis/upgrade_assistant/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { version as kibanaVersion } from '../../../../package.json'; +import { version as kibanaVersion } from '../../../../../package.json'; import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ loadTestFile, getService }: FtrProviderContext) { From 561f8b602de5b68448f80109611bd5ed4bec8771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20Haro?= Date: Wed, 18 Dec 2024 00:58:45 +0100 Subject: [PATCH 3/3] Improve skip decision logic --- x-pack/test/api_integration/apis/upgrade_assistant/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/x-pack/test/api_integration/apis/upgrade_assistant/index.ts b/x-pack/test/api_integration/apis/upgrade_assistant/index.ts index 61e2dbce21fee..1f56a4a9563ed 100644 --- a/x-pack/test/api_integration/apis/upgrade_assistant/index.ts +++ b/x-pack/test/api_integration/apis/upgrade_assistant/index.ts @@ -14,12 +14,11 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) { before( "Check version to avoid failures during forward-compatibility tests where these don't make sense", - async () => { + async function () { const { version: { number: esVersion }, } = await es.info(); - if (esVersion !== kibanaVersion) { - // @ts-expect-error for some reason TS thinks it's jest and not mocha: https://mochajs.org/#inclusive-tests + if (esVersion.replace('-SNAPSHOT', '') !== kibanaVersion.replace('-SNAPSHOT', '')) { this.skip(); } }