Skip to content

Commit

Permalink
Merge branch 'tests/uptime-testing-utils' of https://github.com/domin…
Browse files Browse the repository at this point in the history
…iqueclarke/kibana into tests/uptime-testing-utils
  • Loading branch information
dominiqueclarke committed Jan 11, 2021
2 parents 8f8af46 + 5ade268 commit ae7406b
Show file tree
Hide file tree
Showing 488 changed files with 6,531 additions and 3,451 deletions.
8 changes: 6 additions & 2 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ Content is fetched from the remote (https://feeds.elastic.co and https://feeds-s
|Create choropleth maps. Display the results of a term-aggregation as e.g. countries, zip-codes, states.
|{kib-repo}blob/{branch}/src/plugins/runtime_fields/README.mdx[runtimeFields]
|The runtime fields plugin provides types and constants for OSS and xpack runtime field related code.
|{kib-repo}blob/{branch}/src/plugins/saved_objects/README.md[savedObjects]
|The savedObjects plugin exposes utilities to manipulate saved objects on the client side.
Expand Down Expand Up @@ -483,8 +487,8 @@ Elastic.
|Welcome to the Kibana rollup plugin! This plugin provides Kibana support for Elasticsearch's rollup feature. Please refer to the Elasticsearch documentation to understand rollup indices and how to create rollup jobs.
|{kib-repo}blob/{branch}/x-pack/plugins/runtime_fields/README.md[runtimeFields]
|Welcome to the home of the runtime field editor and everything related to runtime fields!
|{kib-repo}blob/{branch}/x-pack/plugins/runtime_field_editor/README.md[runtimeFieldEditor]
|Welcome to the home of the runtime field editor!
|{kib-repo}blob/{branch}/x-pack/plugins/saved_objects_tagging/README.md[savedObjectsTagging]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export interface ISearchSetup
| --- | --- | --- |
| [aggs](./kibana-plugin-plugins-data-public.isearchsetup.aggs.md) | <code>AggsSetup</code> | |
| [session](./kibana-plugin-plugins-data-public.isearchsetup.session.md) | <code>ISessionService</code> | Current session management [ISessionService](./kibana-plugin-plugins-data-public.isessionservice.md) |
| [sessionsClient](./kibana-plugin-plugins-data-public.isearchsetup.sessionsclient.md) | <code>ISessionsClient</code> | Background search sessions SO CRUD [ISessionsClient](./kibana-plugin-plugins-data-public.isessionsclient.md) |
| [sessionsClient](./kibana-plugin-plugins-data-public.isearchsetup.sessionsclient.md) | <code>ISessionsClient</code> | Search sessions SO CRUD [ISessionsClient](./kibana-plugin-plugins-data-public.isessionsclient.md) |
| [usageCollector](./kibana-plugin-plugins-data-public.isearchsetup.usagecollector.md) | <code>SearchUsageCollector</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## ISearchSetup.sessionsClient property

Background search sessions SO CRUD [ISessionsClient](./kibana-plugin-plugins-data-public.isessionsclient.md)
Search sessions SO CRUD [ISessionsClient](./kibana-plugin-plugins-data-public.isessionsclient.md)

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export interface ISearchStart
| [search](./kibana-plugin-plugins-data-public.isearchstart.search.md) | <code>ISearchGeneric</code> | low level search [ISearchGeneric](./kibana-plugin-plugins-data-public.isearchgeneric.md) |
| [searchSource](./kibana-plugin-plugins-data-public.isearchstart.searchsource.md) | <code>ISearchStartSearchSource</code> | high level search [ISearchStartSearchSource](./kibana-plugin-plugins-data-public.isearchstartsearchsource.md) |
| [session](./kibana-plugin-plugins-data-public.isearchstart.session.md) | <code>ISessionService</code> | Current session management [ISessionService](./kibana-plugin-plugins-data-public.isessionservice.md) |
| [sessionsClient](./kibana-plugin-plugins-data-public.isearchstart.sessionsclient.md) | <code>ISessionsClient</code> | Background search sessions SO CRUD [ISessionsClient](./kibana-plugin-plugins-data-public.isessionsclient.md) |
| [sessionsClient](./kibana-plugin-plugins-data-public.isearchstart.sessionsclient.md) | <code>ISessionsClient</code> | Search sessions SO CRUD [ISessionsClient](./kibana-plugin-plugins-data-public.isessionsclient.md) |
| [showError](./kibana-plugin-plugins-data-public.isearchstart.showerror.md) | <code>(e: Error) =&gt; void</code> | |

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## ISearchStart.sessionsClient property

Background search sessions SO CRUD [ISessionsClient](./kibana-plugin-plugins-data-public.isessionsclient.md)
Search sessions SO CRUD [ISessionsClient](./kibana-plugin-plugins-data-public.isessionsclient.md)

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
| [KBN\_FIELD\_TYPES](./kibana-plugin-plugins-data-public.kbn_field_types.md) | \* |
| [METRIC\_TYPES](./kibana-plugin-plugins-data-public.metric_types.md) | |
| [QuerySuggestionTypes](./kibana-plugin-plugins-data-public.querysuggestiontypes.md) | |
| [SessionState](./kibana-plugin-plugins-data-public.sessionstate.md) | Possible state that current session can be in |
| [SearchSessionState](./kibana-plugin-plugins-data-public.searchsessionstate.md) | Possible state that current session can be in |
| [SortDirection](./kibana-plugin-plugins-data-public.sortdirection.md) | |
| [TimeoutErrorMode](./kibana-plugin-plugins-data-public.timeouterrormode.md) | |

Expand Down Expand Up @@ -90,7 +90,7 @@
| [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) | |
| [SearchError](./kibana-plugin-plugins-data-public.searcherror.md) | |
| [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 backgroundSearch saved object |
| [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) | \* |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## SearchSessionInfoProvider.getName property

User-facing name of the session. e.g. will be displayed in background sessions management list
User-facing name of the session. e.g. will be displayed in saved Search Sessions management list

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## SearchSessionInfoProvider interface

Provide info about current search session to be stored in backgroundSearch saved object
Provide info about current search session to be stored in the Search Session saved object

<b>Signature:</b>

Expand All @@ -16,6 +16,6 @@ export interface SearchSessionInfoProvider<ID extends UrlGeneratorId = UrlGenera

| Property | Type | Description |
| --- | --- | --- |
| [getName](./kibana-plugin-plugins-data-public.searchsessioninfoprovider.getname.md) | <code>() =&gt; Promise&lt;string&gt;</code> | User-facing name of the session. e.g. will be displayed in background sessions management list |
| [getName](./kibana-plugin-plugins-data-public.searchsessioninfoprovider.getname.md) | <code>() =&gt; Promise&lt;string&gt;</code> | User-facing name of the session. e.g. will be displayed in saved Search Sessions management list |
| [getUrlGeneratorData](./kibana-plugin-plugins-data-public.searchsessioninfoprovider.geturlgeneratordata.md) | <code>() =&gt; Promise&lt;{</code><br/><code> urlGeneratorId: ID;</code><br/><code> initialState: UrlGeneratorStateMapping[ID]['State'];</code><br/><code> restoreState: UrlGeneratorStateMapping[ID]['State'];</code><br/><code> }&gt;</code> | |

Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SessionState](./kibana-plugin-plugins-data-public.sessionstate.md)
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [SearchSessionState](./kibana-plugin-plugins-data-public.searchsessionstate.md)

## SessionState enum
## SearchSessionState enum

Possible state that current session can be in

<b>Signature:</b>

```typescript
export declare enum SessionState
export declare enum SearchSessionState
```

## Enumeration Members

| Member | Value | Description |
| --- | --- | --- |
| BackgroundCompleted | <code>&quot;backgroundCompleted&quot;</code> | Page load completed with background session created. |
| BackgroundLoading | <code>&quot;backgroundLoading&quot;</code> | Search request was sent to the background. The page is loading in background. |
| BackgroundCompleted | <code>&quot;backgroundCompleted&quot;</code> | Page load completed with search session created. |
| BackgroundLoading | <code>&quot;backgroundLoading&quot;</code> | Search session was sent to the background. The page is loading in background. |
| Canceled | <code>&quot;canceled&quot;</code> | Current session requests where explicitly canceled by user Displaying none or partial results |
| Completed | <code>&quot;completed&quot;</code> | No action was taken and the page completed loading without background session creation. |
| Completed | <code>&quot;completed&quot;</code> | No action was taken and the page completed loading without search session creation. |
| Loading | <code>&quot;loading&quot;</code> | Pending search request has not been sent to the background yet |
| None | <code>&quot;none&quot;</code> | Session is not active, e.g. didn't start |
| Restored | <code>&quot;restored&quot;</code> | Revisiting the page after background completion |
Expand Down
2 changes: 1 addition & 1 deletion examples/search_examples/public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export const SearchExamplesApp = ({
<EuiFormLabel>Index Pattern</EuiFormLabel>
<IndexPatternSelect
placeholder={i18n.translate(
'backgroundSessionExample.selectIndexPatternPlaceholder',
'searchSessionExample.selectIndexPatternPlaceholder',
{
defaultMessage: 'Select index pattern',
}
Expand Down
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,16 @@
"@loaders.gl/json": "^2.3.1",
"@slack/webhook": "^5.0.0",
"@storybook/addons": "^6.0.16",
"@turf/along": "6.0.1",
"@turf/area": "6.0.1",
"@turf/bbox": "6.0.1",
"@turf/bbox-polygon": "6.0.1",
"@turf/boolean-contains": "6.0.1",
"@turf/center-of-mass": "6.0.1",
"@turf/circle": "6.0.1",
"@turf/distance": "6.0.1",
"@turf/helpers": "6.0.1",
"@turf/length": "^6.0.2",
"JSONStream": "1.3.5",
"abort-controller": "^3.0.0",
"abortcontroller-polyfill": "^1.4.0",
Expand Down Expand Up @@ -343,7 +352,7 @@
"@babel/traverse": "^7.11.5",
"@babel/types": "^7.11.0",
"@cypress/snapshot": "^2.1.7",
"@cypress/webpack-preprocessor": "^5.4.11",
"@cypress/webpack-preprocessor": "^5.5.0",
"@elastic/apm-rum": "^5.6.1",
"@elastic/apm-rum-react": "^1.2.5",
"@elastic/charts": "24.4.0",
Expand Down Expand Up @@ -399,11 +408,6 @@
"@testing-library/react": "^11.0.4",
"@testing-library/react-hooks": "^3.4.1",
"@testing-library/user-event": "^12.1.6",
"@turf/bbox": "6.0.1",
"@turf/bbox-polygon": "6.0.1",
"@turf/boolean-contains": "6.0.1",
"@turf/distance": "6.0.1",
"@turf/helpers": "6.0.1",
"@types/accept": "3.1.1",
"@types/angular": "^1.6.56",
"@types/angular-mocks": "^1.7.0",
Expand Down Expand Up @@ -603,7 +607,7 @@
"cpy": "^8.1.1",
"cronstrue": "^1.51.0",
"css-loader": "^3.4.2",
"cypress": "^6.1.0",
"cypress": "^6.2.1",
"cypress-cucumber-preprocessor": "^2.5.2",
"cypress-multi-reporters": "^1.4.0",
"d3": "3.5.17",
Expand Down
5 changes: 3 additions & 2 deletions packages/kbn-es-archiver/src/actions/empty_kibana_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { Client } from 'elasticsearch';
import { ToolingLog, KbnClient } from '@kbn/dev-utils';

import { migrateKibanaIndex, deleteKibanaIndices, createStats } from '../lib';
import { migrateKibanaIndex, createStats, cleanKibanaIndices } from '../lib';

export async function emptyKibanaIndexAction({
client,
Expand All @@ -32,8 +32,9 @@ export async function emptyKibanaIndexAction({
kbnClient: KbnClient;
}) {
const stats = createStats('emptyKibanaIndex', log);
const kibanaPluginIds = await kbnClient.plugins.getEnabledIds();

await deleteKibanaIndices({ client, stats, log });
await cleanKibanaIndices({ client, stats, log, kibanaPluginIds });
await migrateKibanaIndex({ client, kbnClient });
return stats;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
import Stream, { Readable, Writable } from 'stream';
import { createGunzip } from 'zlib';

import expect from '@kbn/expect';
import { createListStream, createPromiseFromStreams, createConcatStream } from '@kbn/utils';

import { createFormatArchiveStreams } from '../format';
import { createFormatArchiveStreams } from './format';

const INPUTS = [1, 2, { foo: 'bar' }, [1, 2]];
const INPUT_JSON = INPUTS.map((i) => JSON.stringify(i, null, 2)).join('\n\n');
Expand All @@ -32,9 +31,9 @@ describe('esArchiver createFormatArchiveStreams', () => {
describe('{ gzip: false }', () => {
it('returns an array of streams', () => {
const streams = createFormatArchiveStreams({ gzip: false });
expect(streams).to.be.an('array');
expect(streams.length).to.be.greaterThan(0);
streams.forEach((s) => expect(s).to.be.a(Stream));
expect(streams).toBeInstanceOf(Array);
expect(streams.length).toBeGreaterThan(0);
streams.forEach((s) => expect(s).toBeInstanceOf(Stream));
});

it('streams consume js values and produces buffers', async () => {
Expand All @@ -44,8 +43,8 @@ describe('esArchiver createFormatArchiveStreams', () => {
createConcatStream([]),
] as [Readable, ...Writable[]]);

expect(output.length).to.be.greaterThan(0);
output.forEach((b) => expect(b).to.be.a(Buffer));
expect(output.length).toBeGreaterThan(0);
output.forEach((b) => expect(b).toBeInstanceOf(Buffer));
});

it('product is pretty-printed JSON separated by two newlines', async () => {
Expand All @@ -55,16 +54,16 @@ describe('esArchiver createFormatArchiveStreams', () => {
createConcatStream(''),
] as [Readable, ...Writable[]]);

expect(json).to.be(INPUT_JSON);
expect(json).toBe(INPUT_JSON);
});
});

describe('{ gzip: true }', () => {
it('returns an array of streams', () => {
const streams = createFormatArchiveStreams({ gzip: true });
expect(streams).to.be.an('array');
expect(streams.length).to.be.greaterThan(0);
streams.forEach((s) => expect(s).to.be.a(Stream));
expect(streams).toBeInstanceOf(Array);
expect(streams.length).toBeGreaterThan(0);
streams.forEach((s) => expect(s).toBeInstanceOf(Stream));
});

it('streams consume js values and produces buffers', async () => {
Expand All @@ -74,8 +73,8 @@ describe('esArchiver createFormatArchiveStreams', () => {
createConcatStream([]),
] as [Readable, ...Writable[]]);

expect(output.length).to.be.greaterThan(0);
output.forEach((b) => expect(b).to.be.a(Buffer));
expect(output.length).toBeGreaterThan(0);
output.forEach((b) => expect(b).toBeInstanceOf(Buffer));
});

it('output can be gunzipped', async () => {
Expand All @@ -85,7 +84,7 @@ describe('esArchiver createFormatArchiveStreams', () => {
createGunzip(),
createConcatStream(''),
] as [Readable, ...Writable[]]);
expect(output).to.be(INPUT_JSON);
expect(output).toBe(INPUT_JSON);
});
});

Expand All @@ -97,7 +96,7 @@ describe('esArchiver createFormatArchiveStreams', () => {
createConcatStream(''),
] as [Readable, ...Writable[]]);

expect(json).to.be(INPUT_JSON);
expect(json).toBe(INPUT_JSON);
});
});
});
Loading

0 comments on commit ae7406b

Please sign in to comment.