Skip to content

Commit

Permalink
Merge branch 'master' into dev/session/ui-revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 3, 2021
2 parents d75eaca + 912a67f commit 5aa414d
Show file tree
Hide file tree
Showing 143 changed files with 1,952 additions and 758 deletions.
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ the infrastructure monitoring use-case within Kibana.
|{kib-repo}blob/{branch}/x-pack/plugins/lens/readme.md[lens]
|Run all tests from the x-pack root directory
|Visualization editor allowing to quickly and easily configure compelling visualizations to use on dashboards and canvas workpads.
|{kib-repo}blob/{branch}/x-pack/plugins/license_management/README.md[licenseManagement]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@
| [SearchInterceptorDeps](./kibana-plugin-plugins-data-public.searchinterceptordeps.md) | |
| [SearchSessionInfoProvider](./kibana-plugin-plugins-data-public.searchsessioninfoprovider.md) | Provide info about current search session to be stored in the Search Session saved object |
| [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) | search source fields |
| [TabbedAggColumn](./kibana-plugin-plugins-data-public.tabbedaggcolumn.md) | \* |
| [TabbedTable](./kibana-plugin-plugins-data-public.tabbedtable.md) | \* |

## Variables

Expand Down Expand Up @@ -187,7 +185,6 @@
| [SavedQueryTimeFilter](./kibana-plugin-plugins-data-public.savedquerytimefilter.md) | |
| [SearchBarProps](./kibana-plugin-plugins-data-public.searchbarprops.md) | |
| [StatefulSearchBarProps](./kibana-plugin-plugins-data-public.statefulsearchbarprops.md) | |
| [TabbedAggRow](./kibana-plugin-plugins-data-public.tabbedaggrow.md) | \* |
| [TimefilterContract](./kibana-plugin-plugins-data-public.timefiltercontract.md) | |
| [TimeHistoryContract](./kibana-plugin-plugins-data-public.timehistorycontract.md) | |
| [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) | |
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
| [RefreshInterval](./kibana-plugin-plugins-data-server.refreshinterval.md) | |
| [SearchStrategyDependencies](./kibana-plugin-plugins-data-server.searchstrategydependencies.md) | |
| [SearchUsage](./kibana-plugin-plugins-data-server.searchusage.md) | |
| [TabbedAggColumn](./kibana-plugin-plugins-data-server.tabbedaggcolumn.md) | \* |
| [TabbedTable](./kibana-plugin-plugins-data-server.tabbedtable.md) | \* |

## Variables

Expand Down Expand Up @@ -112,6 +110,5 @@
| [KibanaContext](./kibana-plugin-plugins-data-server.kibanacontext.md) | |
| [ParsedInterval](./kibana-plugin-plugins-data-server.parsedinterval.md) | |
| [Query](./kibana-plugin-plugins-data-server.query.md) | |
| [TabbedAggRow](./kibana-plugin-plugins-data-server.tabbedaggrow.md) | \* |
| [TimeRange](./kibana-plugin-plugins-data-server.timerange.md) | |

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ export interface Suite {
suites: Suite[];
tests: Test[];
title: string;
file?: string;
file: string;
parent?: Suite;
eachTest: (cb: (test: Test) => void) => void;
root: boolean;
suiteTag: string;
}

export interface Test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class FunctionalTestRunner {
}

const mocha = await setupMocha(this.lifecycle, this.log, config, providers);
await this.lifecycle.beforeTests.trigger();
await this.lifecycle.beforeTests.trigger(mocha.suite);
this.log.info('Starting tests');

return await runTests(this.lifecycle, mocha);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

import { Lifecycle } from './lifecycle';
import { FailureMetadata } from './failure_metadata';
import { Test } from '../fake_mocha_types';

it('collects metadata for the current test', async () => {
const lifecycle = new Lifecycle();
const failureMetadata = new FailureMetadata(lifecycle);

const test1 = {};
const test1 = {} as Test;
await lifecycle.beforeEachRunnable.trigger(test1);
failureMetadata.add({ foo: 'bar' });

Expand All @@ -23,7 +24,7 @@ it('collects metadata for the current test', async () => {
}
`);

const test2 = {};
const test2 = {} as Test;
await lifecycle.beforeEachRunnable.trigger(test2);
failureMetadata.add({ test: 2 });

Expand All @@ -43,7 +44,7 @@ it('adds messages to the messages state', () => {
const lifecycle = new Lifecycle();
const failureMetadata = new FailureMetadata(lifecycle);

const test1 = {};
const test1 = {} as Test;
lifecycle.beforeEachRunnable.trigger(test1);
failureMetadata.addMessages(['foo', 'bar']);
failureMetadata.addMessages(['baz']);
Expand Down
19 changes: 8 additions & 11 deletions packages/kbn-test/src/functional_test_runner/lib/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@

import { LifecyclePhase } from './lifecycle_phase';

// mocha's global types mean we can't import Mocha or it will override the global jest types..............
type ItsASuite = any;
type ItsATest = any;
type ItsARunnable = any;
import { Suite, Test } from '../fake_mocha_types';

export class Lifecycle {
public readonly beforeTests = new LifecyclePhase<[]>({
public readonly beforeTests = new LifecyclePhase<[Suite]>({
singular: true,
});
public readonly beforeEachRunnable = new LifecyclePhase<[ItsARunnable]>();
public readonly beforeTestSuite = new LifecyclePhase<[ItsASuite]>();
public readonly beforeEachTest = new LifecyclePhase<[ItsATest]>();
public readonly afterTestSuite = new LifecyclePhase<[ItsASuite]>();
public readonly testFailure = new LifecyclePhase<[Error, ItsATest]>();
public readonly testHookFailure = new LifecyclePhase<[Error, ItsATest]>();
public readonly beforeEachRunnable = new LifecyclePhase<[Test]>();
public readonly beforeTestSuite = new LifecyclePhase<[Suite]>();
public readonly beforeEachTest = new LifecyclePhase<[Test]>();
public readonly afterTestSuite = new LifecyclePhase<[Suite]>();
public readonly testFailure = new LifecyclePhase<[Error, Test]>();
public readonly testHookFailure = new LifecyclePhase<[Error, Test]>();
public readonly cleanup = new LifecyclePhase<[]>({
singular: true,
});
Expand Down
Loading

0 comments on commit 5aa414d

Please sign in to comment.