From 8e67a361c34556892aac8b750d076b8237e50e8f Mon Sep 17 00:00:00 2001 From: Dominique Clarke Date: Mon, 8 Nov 2021 13:22:34 -0500 Subject: [PATCH] skip synthetics tests if no docker image --- .../apps/uptime/synthetics_integration.ts | 2 ++ x-pack/test/functional/helpers.ts | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 x-pack/test/functional/helpers.ts diff --git a/x-pack/test/functional/apps/uptime/synthetics_integration.ts b/x-pack/test/functional/apps/uptime/synthetics_integration.ts index 438f20f631d90db..977632b224e66b3 100644 --- a/x-pack/test/functional/apps/uptime/synthetics_integration.ts +++ b/x-pack/test/functional/apps/uptime/synthetics_integration.ts @@ -8,6 +8,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; import { FullAgentPolicy } from '../../../../plugins/fleet/common'; +import { skipIfNoDockerRegistry } from '../../helpers'; export default function ({ getPageObjects, getService }: FtrProviderContext) { const monitorName = 'Sample Synthetics integration'; @@ -130,6 +131,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); // Failing: See https://github.com/elastic/kibana/issues/116980 describe.skip('When on the Synthetics Integration Policy Create Page', function () { + skipIfNoDockerRegistry(); this.tags(['ciGroup10']); const basicConfig = { name: monitorName, diff --git a/x-pack/test/functional/helpers.ts b/x-pack/test/functional/helpers.ts new file mode 100644 index 000000000000000..0e56da16dc02137 --- /dev/null +++ b/x-pack/test/functional/helpers.ts @@ -0,0 +1,24 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Context } from 'mocha'; +import { ToolingLog } from '@kbn/dev-utils'; +import { FtrProviderContext } from '../api_integration/ftr_provider_context'; + +export function skipIfNoDockerRegistry(providerContext: FtrProviderContext) { + const { getService } = providerContext; + const dockerServers = getService('dockerServers'); + + const server = dockerServers.get('registry'); + const log = getService('log'); + + beforeEach(function beforeSetupWithDockerRegistry() { + if (!server.enabled) { + warnAndSkipTest(this, log); + } + }); +}