Skip to content

Commit

Permalink
skip synthetics tests if no docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiqueclarke committed Nov 8, 2021
1 parent df647c3 commit 8e67a36
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions x-pack/test/functional/apps/uptime/synthetics_integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
24 changes: 24 additions & 0 deletions x-pack/test/functional/helpers.ts
Original file line number Diff line number Diff line change
@@ -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);
}
});
}

0 comments on commit 8e67a36

Please sign in to comment.