Skip to content

Commit

Permalink
check for server enabled (#81818)
Browse files Browse the repository at this point in the history
  • Loading branch information
neptunian authored Oct 27, 2020
1 parent 30a0323 commit b1aa93f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function (providerContext: FtrProviderContext) {
});
});
afterEach(async () => {
if (!server) return;
if (!server.enabled) return;
await es.transport.request({
method: 'DELETE',
path: `/_data_stream/${logsTemplateName}-default`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ export default function (providerContext: FtrProviderContext) {
const { getService } = providerContext;
const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer');
const dockerServers = getService('dockerServers');
const server = dockerServers.get('registry');
const pkgName = 'multiple_versions';
const pkgVersion = '0.1.0';
const pkgUpdateVersion = '0.2.0';
describe('setup checks packages completed install', async () => {
skipIfNoDockerRegistry(providerContext);
describe('package install', async () => {
before(async () => {
if (!server.enabled) return;
await supertest
.post(`/api/fleet/epm/packages/${pkgName}-0.1.0`)
.set('kbn-xsrf', 'xxxx')
Expand Down Expand Up @@ -84,6 +87,7 @@ export default function (providerContext: FtrProviderContext) {
expect(packageAfterSetup.attributes.install_status).equal('installing');
});
after(async () => {
if (!server.enabled) return;
await supertest
.delete(`/api/fleet/epm/packages/multiple_versions-0.1.0`)
.set('kbn-xsrf', 'xxxx')
Expand All @@ -92,6 +96,7 @@ export default function (providerContext: FtrProviderContext) {
});
describe('package update', async () => {
before(async () => {
if (!server.enabled) return;
await supertest
.post(`/api/fleet/epm/packages/${pkgName}-0.1.0`)
.set('kbn-xsrf', 'xxxx')
Expand Down Expand Up @@ -164,6 +169,7 @@ export default function (providerContext: FtrProviderContext) {
expect(packageAfterSetup.attributes.version).equal(pkgVersion);
});
after(async () => {
if (!server.enabled) return;
await supertest
.delete(`/api/fleet/epm/packages/multiple_versions-0.1.0`)
.set('kbn-xsrf', 'xxxx')
Expand Down

0 comments on commit b1aa93f

Please sign in to comment.