Skip to content

Commit

Permalink
[7.x] Disables ingest manager integration tests (#59464)
Browse files Browse the repository at this point in the history
* Skips failing Ingest Manager integration tests

#58969
#58968
#58967
#58966
#58961
#58960
#58959
#58958
#58958
#58957
#58956
#58955
#58954

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Skips additional failing Ingest Manager integration tests

#58969
#58968
#58967
#58966

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* [test] Comment out Jest hooks in skipped blocks (#59086)

* [test] Comment out Jest hooks in skipped blocks

Jest will run the hooks regardless of if they are skipped.

Tests skipped in 61c9dc4
and 420ded8 were still resulting in build failures due to the beforeEach failing.

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Additional variables/imports no longer needed

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Skip additional flaky ingest tests

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Comment out file

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* Must have one test

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
Tyler Smalley authored Mar 5, 2020
1 parent e540979 commit 8b9fc23
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 11 deletions.
9 changes: 8 additions & 1 deletion src/plugins/es_ui_shared/public/request/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import sinon from 'sinon';
import { sendRequest as sendRequestUnbound, useRequest as useRequestUnbound } from './request';
// import { sendRequest as sendRequestUnbound, useRequest as useRequestUnbound } from './request';

import React from 'react';
import { act } from 'react-dom/test-utils';
Expand Down Expand Up @@ -52,6 +52,11 @@ describe.skip('request lib', () => {
let sendRequest;
let useRequest;

/**
*
* commented out due to hooks being called regardless of skip
* https://github.com/facebook/jest/issues/8379
beforeEach(() => {
sendPost = sinon.stub();
sendPost.withArgs(successRequest.path, successRequest.body).returns(successResponse);
Expand All @@ -67,6 +72,8 @@ describe.skip('request lib', () => {
useRequest = useRequestUnbound.bind(null, httpClient);
});
*/

describe('sendRequest function', () => {
it('uses the provided path, method, and body to send the request', async () => {
const response = await sendRequest({ ...successRequest });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
* you may not use this file except in compliance with the Elastic License.
*/

test.skip('requires one test', () => {});

/**
* skipped due to all being flaky: https://github.com/elastic/kibana/issues/58954
*
* commented out due to hooks being called regardless of skip
* https://github.com/facebook/jest/issues/8379
import { resolve } from 'path';
import * as kbnTestServer from '../../../../../src/test_utils/kbn_server';
Expand All @@ -25,6 +33,7 @@ function createXPackRoot(config: {} = {}) {
describe('ingestManager', () => {
describe('default. manager, EPM, and Fleet all disabled', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;
beforeAll(async () => {
root = createXPackRoot();
await root.setup();
Expand Down Expand Up @@ -52,6 +61,7 @@ describe('ingestManager', () => {
describe('manager only (no EPM, no Fleet)', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;
beforeAll(async () => {
const ingestManagerConfig = {
enabled: true,
Expand Down Expand Up @@ -89,6 +99,7 @@ describe('ingestManager', () => {
describe('manager and EPM; no Fleet', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;
beforeAll(async () => {
const ingestManagerConfig = {
enabled: true,
Expand Down Expand Up @@ -122,6 +133,7 @@ describe('ingestManager', () => {
describe('manager and Fleet; no EPM)', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;
beforeAll(async () => {
const ingestManagerConfig = {
enabled: true,
Expand Down Expand Up @@ -156,6 +168,7 @@ describe('ingestManager', () => {
describe('all flags enabled: manager, EPM, and Fleet)', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;
beforeAll(async () => {
const ingestManagerConfig = {
enabled: true,
Expand Down Expand Up @@ -188,3 +201,4 @@ describe('ingestManager', () => {
});
});
});
*/
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@

jest.mock('ui/new_platform');
import { RemoteClusterForm } from '../../public/application/sections/components/remote_cluster_form';
import { pageHelpers, setupEnvironment, nextTick } from './helpers';
// import { pageHelpers, setupEnvironment, nextTick } from './helpers';
import { pageHelpers, nextTick } from './helpers';
import { REMOTE_CLUSTER_EDIT, REMOTE_CLUSTER_EDIT_NAME } from './helpers/constants';

const { setup } = pageHelpers.remoteClustersEdit;
// const { setup } = pageHelpers.remoteClustersEdit;
const { setup: setupRemoteClustersAdd } = pageHelpers.remoteClustersAdd;

// FLAKY: https://github.com/elastic/kibana/issues/57762
// FLAKY: https://github.com/elastic/kibana/issues/57997
// FLAKY: https://github.com/elastic/kibana/issues/57998
describe.skip('Edit Remote cluster', () => {
let server;
let httpRequestsMockHelpers;
// let server;
// let httpRequestsMockHelpers;
let component;
let find;
let exists;

/**
*
* commented out due to hooks being called regardless of skip
* https://github.com/facebook/jest/issues/8379
beforeAll(() => {
({ server, httpRequestsMockHelpers } = setupEnvironment());
});
Expand All @@ -38,6 +44,8 @@ describe.skip('Edit Remote cluster', () => {
component.update();
});
*/

test('should have the title of the page set correctly', () => {
expect(exists('remoteClusterPageTitle')).toBe(true);
expect(find('remoteClusterPageTitle').text()).toEqual('Edit remote cluster');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,19 @@ describe.skip('onPostAuthInterceptor', () => {
).toString('base64')}`,
};

/**
*
* commented out due to hooks being called regardless of skip
* https://github.com/facebook/jest/issues/8379
beforeEach(async () => {
root = kbnTestServer.createRoot();
});
afterEach(async () => await root.shutdown());
*/

function initKbnServer(router: IRouter, basePath: IBasePath, routes: 'legacy' | 'new-platform') {
const kbnServer = kbnTestServer.getKbnServer(root);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@ import { elasticsearchServiceMock } from 'src/core/server/mocks';
describe.skip('onRequestInterceptor', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;

/**
*
* commented out due to hooks being called regardless of skip
* https://github.com/facebook/jest/issues/8379
beforeEach(async () => {
root = kbnTestServer.createRoot();
}, 30000);
afterEach(async () => await root.shutdown());
*/

function initKbnServer(router: IRouter, basePath: IBasePath, routes: 'legacy' | 'new-platform') {
const kbnServer = kbnTestServer.getKbnServer(root);

Expand Down
21 changes: 15 additions & 6 deletions x-pack/test_utils/jest/contract_tests/example.contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,25 @@

import Slapshot from '@mattapperson/slapshot';

import { createKibanaServer } from './servers';
import { getEsArchiver } from './services/es_archiver';
import { EsArchiver } from 'src/es_archiver';
import * as path from 'path';
// import { createKibanaServer } from './servers';
// import { getEsArchiver } from './services/es_archiver';
// import { EsArchiver } from 'src/es_archiver';
// import * as path from 'path';
import * as legacyElasticsearch from 'elasticsearch';

const { callWhenOnline, memorize } = Slapshot;
// const { callWhenOnline, memorize } = Slapshot;
const { memorize } = Slapshot;

let servers: { kbnServer: any; shutdown: () => void };
let esArchiver: EsArchiver;
// let esArchiver: EsArchiver;

// FLAKY: https://github.com/elastic/kibana/issues/44250
describe.skip('Example contract tests', () => {
/**
*
* commented out due to hooks being called regardless of skip
* https://github.com/facebook/jest/issues/8379
beforeAll(async () => {
await callWhenOnline(async () => {
servers = await createKibanaServer();
Expand All @@ -28,6 +34,7 @@ describe.skip('Example contract tests', () => {
});
});
});
afterAll(async () => {
if (servers) {
await servers.shutdown();
Expand All @@ -37,6 +44,8 @@ describe.skip('Example contract tests', () => {
beforeEach(async () => await callWhenOnline(() => esArchiver.load('example')));
afterEach(async () => await callWhenOnline(() => esArchiver.unload('example')));
*/

it('should run online or offline', async () => {
const res = await memorize('example_test_snapshot', async () => {
return { serverExists: !!servers.kbnServer };
Expand Down

0 comments on commit 8b9fc23

Please sign in to comment.