Skip to content

Commit

Permalink
Add typings for new tags API (elastic#26027) (elastic#26079)
Browse files Browse the repository at this point in the history
* Add typings for new tags API

* Remove test code
  • Loading branch information
timroes authored Nov 22, 2018
1 parent 79f0eee commit fa213f3
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/infra/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers';
// tslint:disable-next-line:no-default-export
export default ({ loadTestFile }: KibanaFunctionalTestDefaultProviders) => {
describe('InfraOps app', function() {
(this as any).tags('ciGroup4');
this.tags('ciGroup4');

loadTestFile(require.resolve('./home_page'));
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/spaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TestInvoker } from './lib/types';
// tslint:disable:no-default-export
export default function spacesApp({ loadTestFile }: TestInvoker) {
describe('Spaces app', function spacesAppTestSuite() {
(this as any).tags('ciGroup4');
this.tags('ciGroup4');

loadTestFile(require.resolve('./spaces_selection'));
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/status_page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TestInvoker } from './lib/types';
// tslint:disable:no-default-export
export default function statusPage({ loadTestFile }: TestInvoker) {
describe('Status page', function statusPageTestSuite() {
(this as any).tags('ciGroup4');
this.tags('ciGroup4');

loadTestFile(require.resolve('./status_page'));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function({ getService, loadTestFile }: TestInvoker) {
const supertest = getService('supertest');

describe('saved objects security and spaces enabled', function() {
(this as any).tags('ciGroup5');
this.tags('ciGroup5');

before(async () => {
await createUsersAndRoles(es, supertest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function({ getService, loadTestFile }: TestInvoker) {
const supertest = getService('supertest');

describe('saved objects security only enabled', function() {
(this as any).tags('ciGroup5');
this.tags('ciGroup5');

before(async () => {
await createUsersAndRoles(es, supertest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TestInvoker } from '../../common/lib/types';
// tslint:disable:no-default-export
export default function({ loadTestFile }: TestInvoker) {
describe('saved objects spaces only enabled', function() {
(this as any).tags('ciGroup5');
this.tags('ciGroup5');

loadTestFile(require.resolve('./bulk_create'));
loadTestFile(require.resolve('./bulk_get'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function({ loadTestFile, getService }: TestInvoker) {
const supertest = getService('supertest');

describe('spaces api with security', function() {
(this as any).tags('ciGroup5');
this.tags('ciGroup5');

before(async () => {
await createUsersAndRoles(es, supertest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TestInvoker } from '../../common/lib/types';
// tslint:disable:no-default-export
export default function spacesOnlyTestSuite({ loadTestFile }: TestInvoker) {
describe('spaces api without security', function() {
(this as any).tags('ciGroup5');
this.tags('ciGroup5');

loadTestFile(require.resolve('./create'));
loadTestFile(require.resolve('./delete'));
Expand Down
17 changes: 17 additions & 0 deletions x-pack/test/types/mocha_decorations.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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 { Suite } from 'mocha';

// tslint:disable-next-line:no-namespace We need to use the namespace here to match the Mocha definition
declare module 'mocha' {
interface Suite {
/**
* Assign tags to the test suite to determine in which CI job it should be run.
*/
tags(tags: string[] | string): void;
}
}

0 comments on commit fa213f3

Please sign in to comment.