Skip to content

Commit

Permalink
Move functional tests off of legacy es client. (elastic#99801)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
justinkambic and kibanamachine authored May 12, 2021
1 parent 98fa1b5 commit e3f0afa
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions x-pack/test/api_integration/apis/uptime/rest/certs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -33,7 +33,7 @@ export default function ({ getService }: FtrProviderContext) {
const monitorId = 'monitor1';
before(async () => {
makeChecksWithStatus(
legacyEsService,
esService,
monitorId,
3,
1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -76,7 +77,7 @@ export const makeCheck = async ({
};

export const makeChecks = async (
es: any,
es: KibanaClient,
monitorId: string,
numChecks: number = 1,
numIps: number = 1,
Expand Down Expand Up @@ -121,7 +122,7 @@ export const makeChecks = async (
};

export const makeChecksWithStatus = async (
es: any,
es: KibanaClient,
monitorId: string,
numChecks: number,
numIps: number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/api_integration/apis/uptime/rest/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/uptime/locations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/uptime/ping_redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {

beforeEach(async () => {
await makeChecksWithStatus(
getService('legacyEs'),
getService('es'),
MONITOR_ID,
5,
2,
Expand Down

0 comments on commit e3f0afa

Please sign in to comment.