Move functional tests off of legacy es client. (#99801)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Justin Kambic 2021-05-12 15:21:22 -04:00 committed by GitHub
parent 98fa1b58f5
commit e3f0afa4e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 12 deletions

View file

@ -15,7 +15,7 @@ import { makeChecksWithStatus } from './helper/make_checks';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const legacyEsService = getService('legacyEs');
const esService = getService('es');
const esArchiver = getService('esArchiver');
describe('certs api', () => {
@ -33,7 +33,7 @@ export default function ({ getService }: FtrProviderContext) {
const monitorId = 'monitor1';
before(async () => {
makeChecksWithStatus(
legacyEsService,
esService,
monitorId,
3,
1,

View file

@ -7,11 +7,12 @@
import uuid from 'uuid';
import { merge, flattenDeep } from 'lodash';
import { KibanaClient } from '@elastic/elasticsearch/api/kibana';
import { makePing } from './make_ping';
import { TlsProps } from './make_tls';
interface CheckProps {
es: any;
es: KibanaClient;
monitorId?: string;
numIps?: number;
fields?: { [key: string]: any };
@ -76,7 +77,7 @@ export const makeCheck = async ({
};
export const makeChecks = async (
es: any,
es: KibanaClient,
monitorId: string,
numChecks: number = 1,
numIps: number = 1,
@ -121,7 +122,7 @@ export const makeChecks = async (
};
export const makeChecksWithStatus = async (
es: any,
es: KibanaClient,
monitorId: string,
numChecks: number,
numIps: number,

View file

@ -36,7 +36,7 @@ export default function ({ getService }: FtrProviderContext) {
describe('checks with no summaries', async () => {
const testMonitorId = 'scope-test-id';
before(async () => {
const es = getService('legacyEs');
const es = getService('es');
dateRangeStart = new Date().toISOString();
await makeChecksWithStatus(es, testMonitorId, 1, numIps, 1, {}, 'up', (d) => {
delete d.summary;
@ -64,7 +64,7 @@ export default function ({ getService }: FtrProviderContext) {
};
before(async () => {
const es = getService('legacyEs');
const es = getService('es');
dateRangeStart = new Date().toISOString();
checks = await makeChecksWithStatus(es, testMonitorId, 1, numIps, 1, {}, 'up', (d) => {
// turn an all up status into having at least one down
@ -141,7 +141,7 @@ export default function ({ getService }: FtrProviderContext) {
before('generate three monitors with up, down, mix state', async () => {
await getService('esArchiver').load('uptime/blank');
const es = getService('legacyEs');
const es = getService('es');
const observer = {
geo: {

View file

@ -52,7 +52,7 @@ export default function ({ getService }: FtrProviderContext) {
const makeMonitorChecks = async (monitorId: string, status: 'up' | 'down') => {
return makeChecksWithStatus(
getService('legacyEs'),
getService('es'),
monitorId,
checksPerMonitor,
numIps,

View file

@ -12,7 +12,7 @@ import { makeChecksWithStatus } from './helper/make_checks';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const es = getService('legacyEs');
const es = getService('es');
describe('telemetry collectors heartbeat', () => {
before('generating data', async () => {

View file

@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default ({ getPageObjects, getService }: FtrProviderContext) => {
const { uptime: uptimePage } = getPageObjects(['uptime']);
const uptime = getService('uptime');
const es = getService('legacyEs');
const es = getService('es');
const monitor = () => uptime.monitor;
const MONITOR_ID = 'location-testing-id';

View file

@ -35,7 +35,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
beforeEach(async () => {
await makeChecksWithStatus(
getService('legacyEs'),
getService('es'),
MONITOR_ID,
5,
2,