kibana/x-pack/test/ingest_manager_api_integration/helpers.ts
Sandra Gonzales 2932b169a2
[Ingest Manager] Integration test install/uninstall a package (#72957)
* integration test for initial installation of package

* add all services to integration config

* rename files, test removing package

* remove import from merge conflict

* rename es_assets to all_assets package

* move install package to before clause and update test descriptions

* fix typo

* update ilm policy name

* use skipIfNoDockerRegistry helper
2020-07-23 11:45:38 -05:00

30 lines
1 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { Context } from 'mocha';
import { ToolingLog } from '@kbn/dev-utils';
import { FtrProviderContext } from '../api_integration/ftr_provider_context';
export function warnAndSkipTest(mochaContext: Context, log: ToolingLog) {
log.warning(
'disabling tests because DockerServers service is not enabled, set INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT to run them'
);
mochaContext.skip();
}
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);
}
});
}