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] 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'));