Revert "[7.x] [FTR][CI] Use default distribution for all tests (#94968) (#99980)"

This reverts commit be40e96806.
This commit is contained in:
Tyler Smalley 2021-05-28 17:21:51 -07:00
parent 22b7991212
commit 52dd72e0a2
133 changed files with 6792 additions and 5627 deletions

View file

@ -73,7 +73,11 @@ def agentProcess(Map params = [:]) {
]) { ]) {
task { task {
if (config.needBuild) { if (config.needBuild) {
kibanaPipeline.buildKibana() if (!config.isXpack) {
kibanaPipeline.buildOss()
} else {
kibanaPipeline.buildXpack()
}
} }
for(def i = 0; i < config.agentExecutions; i++) { for(def i = 0; i < config.agentExecutions; i++) {

View file

@ -16,7 +16,7 @@ kibanaPipeline(timeoutMinutes: 180) {
def job = 'xpack-securityCypress' def job = 'xpack-securityCypress'
workers.ci(name: job, size: 'l', ramDisk: true) { workers.ci(name: job, size: 'l', ramDisk: true) {
kibanaPipeline.bash('test/scripts/jenkins_build_kibana.sh', 'Build Distributable') kibanaPipeline.bash('test/scripts/jenkins_xpack_build_kibana.sh', 'Build Default Distributable')
kibanaPipeline.functionalTestProcess(job, 'test/scripts/jenkins_security_solution_cypress_chrome.sh')() kibanaPipeline.functionalTestProcess(job, 'test/scripts/jenkins_security_solution_cypress_chrome.sh')()
// Temporarily disabled to figure out test flake // Temporarily disabled to figure out test flake
// kibanaPipeline.functionalTestProcess(job, 'test/scripts/jenkins_security_solution_cypress_firefox.sh')() // kibanaPipeline.functionalTestProcess(job, 'test/scripts/jenkins_security_solution_cypress_firefox.sh')()

View file

@ -37,8 +37,12 @@ kibanaPipeline(timeoutMinutes: 210) {
]) ])
task { task {
kibanaPipeline.buildKibana(16) kibanaPipeline.buildOss(6)
tasks.ossCiGroups() tasks.ossCiGroups()
}
task {
kibanaPipeline.buildXpack(10, true)
tasks.xpackCiGroups() tasks.xpackCiGroups()
tasks.xpackCiGroupDocker() tasks.xpackCiGroupDocker()
} }

View file

@ -168,7 +168,6 @@ export async function createDefaultSpace({
index, index,
type: '_doc', type: '_doc',
id: 'space:default', id: 'space:default',
refresh: 'wait_for',
body: { body: {
type: 'space', type: 'space',
updated_at: new Date().toISOString(), updated_at: new Date().toISOString(),

View file

@ -8,14 +8,13 @@
import { ToolingLog } from '@kbn/dev-utils'; import { ToolingLog } from '@kbn/dev-utils';
import { KbnClientImportExport } from './kbn_client_import_export';
import { KbnClientPlugins } from './kbn_client_plugins';
import { KbnClientRequester, ReqOptions } from './kbn_client_requester'; import { KbnClientRequester, ReqOptions } from './kbn_client_requester';
import { KbnClientSavedObjects } from './kbn_client_saved_objects';
import { KbnClientSpaces } from './kbn_client_spaces';
import { KbnClientStatus } from './kbn_client_status'; import { KbnClientStatus } from './kbn_client_status';
import { KbnClientUiSettings, UiSettingValues } from './kbn_client_ui_settings'; import { KbnClientPlugins } from './kbn_client_plugins';
import { KbnClientVersion } from './kbn_client_version'; import { KbnClientVersion } from './kbn_client_version';
import { KbnClientSavedObjects } from './kbn_client_saved_objects';
import { KbnClientUiSettings, UiSettingValues } from './kbn_client_ui_settings';
import { KbnClientImportExport } from './kbn_client_import_export';
export interface KbnClientOptions { export interface KbnClientOptions {
url: string; url: string;
@ -30,7 +29,6 @@ export class KbnClient {
readonly plugins: KbnClientPlugins; readonly plugins: KbnClientPlugins;
readonly version: KbnClientVersion; readonly version: KbnClientVersion;
readonly savedObjects: KbnClientSavedObjects; readonly savedObjects: KbnClientSavedObjects;
readonly spaces: KbnClientSpaces;
readonly uiSettings: KbnClientUiSettings; readonly uiSettings: KbnClientUiSettings;
readonly importExport: KbnClientImportExport; readonly importExport: KbnClientImportExport;
@ -61,13 +59,11 @@ export class KbnClient {
this.plugins = new KbnClientPlugins(this.status); this.plugins = new KbnClientPlugins(this.status);
this.version = new KbnClientVersion(this.status); this.version = new KbnClientVersion(this.status);
this.savedObjects = new KbnClientSavedObjects(this.log, this.requester); this.savedObjects = new KbnClientSavedObjects(this.log, this.requester);
this.spaces = new KbnClientSpaces(this.requester);
this.uiSettings = new KbnClientUiSettings(this.log, this.requester, this.uiSettingDefaults); this.uiSettings = new KbnClientUiSettings(this.log, this.requester, this.uiSettingDefaults);
this.importExport = new KbnClientImportExport( this.importExport = new KbnClientImportExport(
this.log, this.log,
this.requester, this.requester,
this.savedObjects, this.savedObjects,
this.spaces,
options.importExportDir options.importExportDir
); );
} }

View file

@ -15,7 +15,6 @@ import { ToolingLog, isAxiosResponseError, createFailError } from '@kbn/dev-util
import { KbnClientRequester, uriencode, ReqOptions } from './kbn_client_requester'; import { KbnClientRequester, uriencode, ReqOptions } from './kbn_client_requester';
import { KbnClientSavedObjects } from './kbn_client_saved_objects'; import { KbnClientSavedObjects } from './kbn_client_saved_objects';
import { KbnClientSpaces } from './kbn_client_spaces';
interface ImportApiResponse { interface ImportApiResponse {
success: boolean; success: boolean;
@ -40,7 +39,6 @@ export class KbnClientImportExport {
public readonly log: ToolingLog, public readonly log: ToolingLog,
public readonly requester: KbnClientRequester, public readonly requester: KbnClientRequester,
public readonly savedObjects: KbnClientSavedObjects, public readonly savedObjects: KbnClientSavedObjects,
private readonly spaces: KbnClientSpaces,
public readonly dir?: string public readonly dir?: string
) {} ) {}
@ -68,19 +66,6 @@ export class KbnClientImportExport {
const formData = new FormData(); const formData = new FormData();
formData.append('file', objects.map((obj) => JSON.stringify(obj)).join('\n'), 'import.ndjson'); formData.append('file', objects.map((obj) => JSON.stringify(obj)).join('\n'), 'import.ndjson');
if (options?.space) {
this.log.info('creating space', options.space);
try {
await this.spaces.create({
id: options.space,
name: options.space,
});
} catch (e) {
this.log.warning('creating space failed:', e.message);
}
}
// TODO: should we clear out the existing saved objects? // TODO: should we clear out the existing saved objects?
const resp = await this.req<ImportApiResponse>(options?.space, { const resp = await this.req<ImportApiResponse>(options?.space, {
method: 'POST', method: 'POST',

View file

@ -121,8 +121,6 @@ export class KbnClientRequester {
responseType: options.responseType, responseType: options.responseType,
// work around https://github.com/axios/axios/issues/2791 // work around https://github.com/axios/axios/issues/2791
transformResponse: options.responseType === 'text' ? [(x) => x] : undefined, transformResponse: options.responseType === 'text' ? [(x) => x] : undefined,
maxContentLength: 30000000,
maxBodyLength: 30000000,
paramsSerializer: (params) => Qs.stringify(params), paramsSerializer: (params) => Qs.stringify(params),
}); });

View file

@ -1,67 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { KbnClientRequester, uriencode } from './kbn_client_requester';
interface UpdateBody {
name: string;
description?: string;
disabledFeatures?: string | string[];
initials?: string;
color?: string;
imageUrl?: string;
}
interface CreateBody extends UpdateBody {
id: string;
}
export class KbnClientSpaces {
constructor(private readonly requester: KbnClientRequester) {}
async create(body: CreateBody) {
await this.requester.request({
method: 'POST',
path: '/api/spaces/space',
body,
});
}
async update(id: string, body: UpdateBody) {
await this.requester.request({
method: 'PUT',
path: uriencode`/api/spaces/space/${id}`,
body,
});
}
async get(id: string) {
const { data } = await this.requester.request({
method: 'GET',
path: uriencode`/api/spaces/space/${id}`,
});
return data;
}
async list() {
const { data } = await this.requester.request({
method: 'GET',
path: '/api/spaces/space',
});
return data;
}
async delete(id: string) {
await this.requester.request({
method: 'DELETE',
path: uriencode`/api/spaces/space/${id}`,
});
}
}

View file

@ -40,7 +40,6 @@ export const IGNORE_FILE_GLOBS = [
'.ci/pipeline-library/**/*', '.ci/pipeline-library/**/*',
'packages/kbn-test/jest-preset.js', 'packages/kbn-test/jest-preset.js',
'test/package/Vagrantfile', 'test/package/Vagrantfile',
'test/**/fixtures/**/*',
// filename must match language code which requires capital letters // filename must match language code which requires capital letters
'**/translations/*.json', '**/translations/*.json',

View file

@ -63,8 +63,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('dashboard panel full screen', async () => { it('dashboard panel full screen', async () => {
const header = await dashboardPanelActions.getPanelHeading('[Flights] Airline Carrier'); const header = await dashboardPanelActions.getPanelHeading('[Flights] Airline Carrier');
await dashboardPanelActions.toggleContextMenu(header); await dashboardPanelActions.toggleContextMenu(header);
await dashboardPanelActions.clickContextMenuMoreItem();
await testSubjects.click('embeddablePanelAction-togglePanel'); await testSubjects.click('embeddablePanelAction-togglePanel');
await a11y.testAppSnapshot(); await a11y.testAppSnapshot();
}); });

View file

@ -43,7 +43,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.body).to.eql({ expect(resp.body).to.eql({
elasticsearchIndicesCreated: { kibana_sample_data_flights: 13059 }, elasticsearchIndicesCreated: { kibana_sample_data_flights: 13059 },
kibanaSavedObjectsLoaded: 23, kibanaSavedObjectsLoaded: 20,
}); });
}); });

View file

@ -13,12 +13,12 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const es = getService('es'); const es = getService('es');
describe('telemetry API', () => { describe('telemetry API', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic')); before(() => esArchiver.load('saved_objects/basic'));
after(() => kibanaServer.importExport.unload('saved_objects/basic')); after(() => esArchiver.unload('saved_objects/basic'));
it('should increment the opt *in* counter in the .kibana/kql-telemetry document', async () => { it('should increment the opt *in* counter in the .kibana/kql-telemetry document', async () => {
await supertest await supertest

View file

@ -12,8 +12,8 @@ import { getKibanaVersion } from './lib/saved_objects_test_utils';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const SPACE_ID = 'ftr-so-bulk-create'; const esDeleteAllIndices = getService('esDeleteAllIndices');
const BULK_REQUESTS = [ const BULK_REQUESTS = [
{ {
@ -38,14 +38,15 @@ export default function ({ getService }: FtrProviderContext) {
before(async () => { before(async () => {
KIBANA_VERSION = await getKibanaVersion(getService); KIBANA_VERSION = await getKibanaVersion(getService);
await kibanaServer.importExport.load('saved_objects/basic', { space: SPACE_ID });
}); });
after(() => kibanaServer.spaces.delete(SPACE_ID)); describe('with kibana index', () => {
before(() => esArchiver.load('saved_objects/basic'));
after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200 with individual responses', async () => it('should return 200 with individual responses', async () =>
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_bulk_create`) .post(`/api/saved_objects/_bulk_create`)
.send(BULK_REQUESTS) .send(BULK_REQUESTS)
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
@ -74,7 +75,7 @@ export default function ({ getService }: FtrProviderContext) {
}, },
coreMigrationVersion: KIBANA_VERSION, coreMigrationVersion: KIBANA_VERSION,
references: [], references: [],
namespaces: [SPACE_ID], namespaces: ['default'],
}, },
], ],
}); });
@ -82,7 +83,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should not return raw id when object id is unspecified', async () => it('should not return raw id when object id is unspecified', async () =>
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_bulk_create`) .post(`/api/saved_objects/_bulk_create`)
.send(BULK_REQUESTS.map(({ id, ...rest }) => rest)) .send(BULK_REQUESTS.map(({ id, ...rest }) => rest))
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
@ -91,4 +92,45 @@ export default function ({ getService }: FtrProviderContext) {
); );
})); }));
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return 200 with errors', async () => {
await new Promise((resolve) => setTimeout(resolve, 2000));
await supertest
.post('/api/saved_objects/_bulk_create')
.send(BULK_REQUESTS)
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
saved_objects: [
{
id: BULK_REQUESTS[0].id,
type: BULK_REQUESTS[0].type,
error: {
error: 'Internal Server Error',
message: 'An internal server error occurred',
statusCode: 500,
},
},
{
id: BULK_REQUESTS[1].id,
type: BULK_REQUESTS[1].type,
error: {
error: 'Internal Server Error',
message: 'An internal server error occurred',
statusCode: 500,
},
},
],
});
});
});
});
});
} }

View file

@ -12,7 +12,8 @@ import { getKibanaVersion } from './lib/saved_objects_test_utils';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const esDeleteAllIndices = getService('esDeleteAllIndices');
const BULK_REQUESTS = [ const BULK_REQUESTS = [
{ {
@ -34,10 +35,11 @@ export default function ({ getService }: FtrProviderContext) {
before(async () => { before(async () => {
KIBANA_VERSION = await getKibanaVersion(getService); KIBANA_VERSION = await getKibanaVersion(getService);
await kibanaServer.importExport.load('saved_objects/basic');
}); });
after(() => kibanaServer.importExport.unload('saved_objects/basic')); describe('with kibana index', () => {
before(() => esArchiver.load('saved_objects/basic'));
after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200 with individual responses', async () => it('should return 200 with individual responses', async () =>
await supertest await supertest
@ -45,16 +47,12 @@ export default function ({ getService }: FtrProviderContext) {
.send(BULK_REQUESTS) .send(BULK_REQUESTS)
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
const mockDate = '2015-01-01T00:00:00.000Z';
resp.body.saved_objects[0].updated_at = mockDate;
resp.body.saved_objects[2].updated_at = mockDate;
expect(resp.body).to.eql({ expect(resp.body).to.eql({
saved_objects: [ saved_objects: [
{ {
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab', id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
type: 'visualization', type: 'visualization',
updated_at: '2015-01-01T00:00:00.000Z', updated_at: '2017-09-21T18:51:23.794Z',
version: resp.body.saved_objects[0].version, version: resp.body.saved_objects[0].version,
attributes: { attributes: {
title: 'Count of requests', title: 'Count of requests',
@ -89,7 +87,7 @@ export default function ({ getService }: FtrProviderContext) {
{ {
id: '7.0.0-alpha1', id: '7.0.0-alpha1',
type: 'config', type: 'config',
updated_at: '2015-01-01T00:00:00.000Z', updated_at: '2017-09-21T18:49:16.302Z',
version: resp.body.saved_objects[2].version, version: resp.body.saved_objects[2].version,
attributes: { attributes: {
buildNum: 8467, buildNum: 8467,
@ -105,4 +103,53 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.body.saved_objects[0].migrationVersion).to.be.ok(); expect(resp.body.saved_objects[0].migrationVersion).to.be.ok();
})); }));
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return 200 with individual responses', async () =>
await supertest
.post('/api/saved_objects/_bulk_get')
.send(BULK_REQUESTS)
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
saved_objects: [
{
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
type: 'visualization',
error: {
error: 'Not Found',
message:
'Saved object [visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab] not found',
statusCode: 404,
},
},
{
id: 'does not exist',
type: 'dashboard',
error: {
error: 'Not Found',
message: 'Saved object [dashboard/does not exist] not found',
statusCode: 404,
},
},
{
id: '7.0.0-alpha1',
type: 'config',
error: {
error: 'Not Found',
message: 'Saved object [config/7.0.0-alpha1] not found',
statusCode: 404,
},
},
],
});
}));
});
});
} }

View file

@ -12,12 +12,13 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const esDeleteAllIndices = getService('esDeleteAllIndices');
describe('bulkUpdate', () => { describe('bulkUpdate', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic')); describe('with kibana index', () => {
after(() => kibanaServer.importExport.unload('saved_objects/basic')); before(() => esArchiver.load('saved_objects/basic'));
after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200', async () => { it('should return 200', async () => {
const response = await supertest const response = await supertest
.put(`/api/saved_objects/_bulk_update`) .put(`/api/saved_objects/_bulk_update`)
@ -229,4 +230,59 @@ export default function ({ getService }: FtrProviderContext) {
}); });
}); });
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return 200 with errors', async () => {
const response = await supertest
.put(`/api/saved_objects/_bulk_update`)
.send([
{
type: 'visualization',
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
attributes: {
title: 'An existing visualization',
},
},
{
type: 'dashboard',
id: 'be3733a0-9efe-11e7-acb3-3dab96693fab',
attributes: {
title: 'An existing dashboard',
},
},
])
.expect(200);
const {
saved_objects: [firstObject, secondObject],
} = response.body;
expect(firstObject).to.eql({
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
type: 'visualization',
error: {
statusCode: 500,
error: 'Internal Server Error',
message: 'An internal server error occurred',
},
});
expect(secondObject).to.eql({
id: 'be3733a0-9efe-11e7-acb3-3dab96693fab',
type: 'dashboard',
error: {
statusCode: 500,
error: 'Internal Server Error',
message: 'An internal server error occurred',
},
});
});
});
});
} }

View file

@ -12,18 +12,20 @@ import { getKibanaVersion } from './lib/saved_objects_test_utils';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const es = getService('es');
const esArchiver = getService('esArchiver');
const esDeleteAllIndices = getService('esDeleteAllIndices');
describe('create', () => { describe('create', () => {
let KIBANA_VERSION: string; let KIBANA_VERSION: string;
before(async () => { before(async () => {
KIBANA_VERSION = await getKibanaVersion(getService); KIBANA_VERSION = await getKibanaVersion(getService);
await kibanaServer.importExport.load('saved_objects/basic');
}); });
after(() => kibanaServer.importExport.unload('saved_objects/basic')); describe('with kibana index', () => {
before(() => esArchiver.load('saved_objects/basic'));
after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200', async () => { it('should return 200', async () => {
await supertest await supertest
.post(`/api/saved_objects/visualization`) .post(`/api/saved_objects/visualization`)
@ -76,4 +78,33 @@ export default function ({ getService }: FtrProviderContext) {
}); });
}); });
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return 500 and not auto-create saved objects index', async () => {
await supertest
.post(`/api/saved_objects/visualization`)
.send({
attributes: {
title: 'My favorite vis',
},
})
.expect(500)
.then((resp) => {
expect(resp.body).to.eql({
error: 'Internal Server Error',
message: 'An internal server error occurred.',
statusCode: 500,
});
});
expect((await es.indices.exists({ index: '.kibana' })).body).to.be(false);
});
});
});
} }

View file

@ -11,11 +11,13 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const esDeleteAllIndices = getService('esDeleteAllIndices');
describe('delete', () => { describe('delete', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic')); describe('with kibana index', () => {
after(() => kibanaServer.importExport.unload('saved_objects/basic')); before(() => esArchiver.load('saved_objects/basic'));
after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200 when deleting a doc', async () => it('should return 200 when deleting a doc', async () =>
await supertest await supertest
@ -37,4 +39,25 @@ export default function ({ getService }: FtrProviderContext) {
}); });
})); }));
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('returns generic 404 when kibana index is missing', async () =>
await supertest
.delete(`/api/saved_objects/dashboard/be3733a0-9efe-11e7-acb3-3dab96693fab`)
.expect(404)
.then((resp) => {
expect(resp.body).to.eql({
statusCode: 404,
error: 'Not Found',
message: 'Saved object [dashboard/be3733a0-9efe-11e7-acb3-3dab96693fab] not found',
});
}));
});
});
} }

View file

@ -15,23 +15,24 @@ function ndjsonToObject(input: string) {
} }
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const SPACE_ID = 'ftr-so-export'; const esDeleteAllIndices = getService('esDeleteAllIndices');
describe('export', () => { describe('export', () => {
let KIBANA_VERSION: string; let KIBANA_VERSION: string;
before(async () => { before(async () => {
KIBANA_VERSION = await getKibanaVersion(getService); KIBANA_VERSION = await getKibanaVersion(getService);
await kibanaServer.importExport.load('saved_objects/basic', { space: SPACE_ID });
}); });
after(() => kibanaServer.spaces.delete(SPACE_ID)); describe('with kibana index', () => {
describe('basic amount of saved objects', () => { describe('basic amount of saved objects', () => {
before(() => esArchiver.load('saved_objects/basic'));
after(() => esArchiver.unload('saved_objects/basic'));
it('should return objects in dependency order', async () => { it('should return objects in dependency order', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
type: ['index-pattern', 'search', 'visualization', 'dashboard'], type: ['index-pattern', 'search', 'visualization', 'dashboard'],
}) })
@ -53,7 +54,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should exclude the export details if asked', async () => { it('should exclude the export details if asked', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
type: ['index-pattern', 'search', 'visualization', 'dashboard'], type: ['index-pattern', 'search', 'visualization', 'dashboard'],
excludeExportDetails: true, excludeExportDetails: true,
@ -73,7 +74,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should support including dependencies when exporting selected objects', async () => { it('should support including dependencies when exporting selected objects', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
includeReferencesDeep: true, includeReferencesDeep: true,
objects: [ objects: [
@ -101,7 +102,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should support including dependencies when exporting by type', async () => { it('should support including dependencies when exporting by type', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
includeReferencesDeep: true, includeReferencesDeep: true,
type: ['dashboard'], type: ['dashboard'],
@ -124,7 +125,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should support including dependencies when exporting by type and search', async () => { it('should support including dependencies when exporting by type and search', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
includeReferencesDeep: true, includeReferencesDeep: true,
type: ['dashboard'], type: ['dashboard'],
@ -148,7 +149,7 @@ export default function ({ getService }: FtrProviderContext) {
it(`should throw error when object doesn't exist`, async () => { it(`should throw error when object doesn't exist`, async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
objects: [ objects: [
{ {
@ -182,7 +183,7 @@ export default function ({ getService }: FtrProviderContext) {
it(`should return 400 when exporting unsupported type`, async () => { it(`should return 400 when exporting unsupported type`, async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
type: ['wigwags'], type: ['wigwags'],
}) })
@ -198,7 +199,7 @@ export default function ({ getService }: FtrProviderContext) {
it(`should return 400 when exporting objects with unsupported type`, async () => { it(`should return 400 when exporting objects with unsupported type`, async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
objects: [ objects: [
{ {
@ -248,12 +249,9 @@ export default function ({ getService }: FtrProviderContext) {
], ],
}, },
]; ];
await supertest await supertest.post('/api/saved_objects/_bulk_create').send(soWithCycliRefs).expect(200);
.post(`/s/${SPACE_ID}/api/saved_objects/_bulk_create`)
.send(soWithCycliRefs)
.expect(200);
const resp = await supertest const resp = await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
includeReferencesDeep: true, includeReferencesDeep: true,
type: ['dashboard'], type: ['dashboard'],
@ -267,38 +265,12 @@ export default function ({ getService }: FtrProviderContext) {
}); });
describe('10,000 objects', () => { describe('10,000 objects', () => {
before(async () => { before(() => esArchiver.load('saved_objects/10k'));
const fileChunks = []; after(() => esArchiver.unload('saved_objects/10k'));
for (let i = 0; i <= 9995; i++) {
fileChunks.push(
JSON.stringify({
type: 'visualization',
id: `${SPACE_ID}-${i}`,
attributes: {
title: `My visualization (${i})`,
uiStateJSON: '{}',
visState: '{}',
},
references: [
{
name: 'kibanaSavedObjectMeta.searchSourceJSON.index',
type: 'index-pattern',
id: '91200a00-9efd-11e7-acb3-3dab96693fab',
},
],
})
);
}
await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_import`)
.attach('file', Buffer.from(fileChunks.join('\n'), 'utf8'), 'export.ndjson')
.expect(200);
});
it('should return 400 when exporting without type or objects passed in', async () => { it('should return 400 when exporting without type or objects passed in', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.expect(400) .expect(400)
.then((resp) => { .then((resp) => {
expect(resp.body).to.eql({ expect(resp.body).to.eql({
@ -311,7 +283,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return 200 when exporting by single type', async () => { it('should return 200 when exporting by single type', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
type: 'dashboard', type: 'dashboard',
excludeExportDetails: true, excludeExportDetails: true,
@ -326,7 +298,6 @@ export default function ({ getService }: FtrProviderContext) {
// Sort values aren't deterministic so we need to exclude them // Sort values aren't deterministic so we need to exclude them
const { sort, ...obj } = objects[0]; const { sort, ...obj } = objects[0];
expect(obj).to.eql({ expect(obj).to.eql({
attributes: { attributes: {
description: '', description: '',
@ -358,7 +329,7 @@ export default function ({ getService }: FtrProviderContext) {
}, },
], ],
type: 'dashboard', type: 'dashboard',
updated_at: objects[0].updated_at, updated_at: '2017-09-21T18:57:40.826Z',
version: objects[0].version, version: objects[0].version,
}); });
expect(objects[0].migrationVersion).to.be.ok(); expect(objects[0].migrationVersion).to.be.ok();
@ -372,7 +343,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return 200 when exporting by array type', async () => { it('should return 200 when exporting by array type', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
type: ['dashboard'], type: ['dashboard'],
excludeExportDetails: true, excludeExportDetails: true,
@ -418,7 +389,7 @@ export default function ({ getService }: FtrProviderContext) {
}, },
], ],
type: 'dashboard', type: 'dashboard',
updated_at: objects[0].updated_at, updated_at: '2017-09-21T18:57:40.826Z',
version: objects[0].version, version: objects[0].version,
}); });
expect(objects[0].migrationVersion).to.be.ok(); expect(objects[0].migrationVersion).to.be.ok();
@ -432,7 +403,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return 200 when exporting by objects', async () => { it('should return 200 when exporting by objects', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
objects: [ objects: [
{ {
@ -483,7 +454,7 @@ export default function ({ getService }: FtrProviderContext) {
}, },
], ],
type: 'dashboard', type: 'dashboard',
updated_at: objects[0].updated_at, updated_at: '2017-09-21T18:57:40.826Z',
version: objects[0].version, version: objects[0].version,
}); });
expect(objects[0].migrationVersion).to.be.ok(); expect(objects[0].migrationVersion).to.be.ok();
@ -497,7 +468,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return 400 when exporting by type and objects', async () => { it('should return 400 when exporting by type and objects', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
type: 'dashboard', type: 'dashboard',
objects: [ objects: [
@ -517,10 +488,32 @@ export default function ({ getService }: FtrProviderContext) {
}); });
}); });
}); });
});
describe('10,001 objects', () => {
let customVisId: string;
before(async () => {
await esArchiver.load('saved_objects/10k');
await supertest
.post('/api/saved_objects/visualization')
.send({
attributes: {
title: 'My favorite vis',
},
})
.expect(200)
.then((resp) => {
customVisId = resp.body.id;
});
});
after(async () => {
await supertest.delete(`/api/saved_objects/visualization/${customVisId}`).expect(200);
await esArchiver.unload('saved_objects/10k');
});
it('should allow exporting more than 10,000 objects if permitted by maxImportExportSize', async () => { it('should allow exporting more than 10,000 objects if permitted by maxImportExportSize', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
type: ['dashboard', 'visualization', 'search', 'index-pattern'], type: ['dashboard', 'visualization', 'search', 'index-pattern'],
excludeExportDetails: true, excludeExportDetails: true,
@ -539,7 +532,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return 400 when exporting more than allowed by maxImportExportSize', async () => { it('should return 400 when exporting more than allowed by maxImportExportSize', async () => {
let anotherCustomVisId: string; let anotherCustomVisId: string;
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/visualization`) .post('/api/saved_objects/visualization')
.send({ .send({
attributes: { attributes: {
title: 'My other favorite vis', title: 'My other favorite vis',
@ -550,7 +543,7 @@ export default function ({ getService }: FtrProviderContext) {
anotherCustomVisId = resp.body.id; anotherCustomVisId = resp.body.id;
}); });
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_export`) .post('/api/saved_objects/_export')
.send({ .send({
type: ['dashboard', 'visualization', 'search', 'index-pattern'], type: ['dashboard', 'visualization', 'search', 'index-pattern'],
excludeExportDetails: true, excludeExportDetails: true,
@ -565,9 +558,31 @@ export default function ({ getService }: FtrProviderContext) {
}); });
await supertest await supertest
// @ts-expect-error TS complains about using `anotherCustomVisId` before it is assigned // @ts-expect-error TS complains about using `anotherCustomVisId` before it is assigned
.delete(`/s/${SPACE_ID}/api/saved_objects/visualization/${anotherCustomVisId}`) .delete(`/api/saved_objects/visualization/${anotherCustomVisId}`)
.expect(200); .expect(200);
}); });
}); });
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return empty response', async () => {
await supertest
.post('/api/saved_objects/_export')
.send({
type: ['index-pattern', 'search', 'visualization', 'dashboard'],
excludeExportDetails: true,
})
.expect(200)
.then((resp) => {
expect(resp.text).to.eql('');
});
});
});
});
} }

View file

@ -12,22 +12,17 @@ import { SavedObject } from '../../../../src/core/server';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const SPACE_ID = 'ftr-so-find'; const esDeleteAllIndices = getService('esDeleteAllIndices');
describe('find', () => { describe('find', () => {
before(async () => { describe('with kibana index', () => {
await kibanaServer.importExport.load('saved_objects/basic', { space: SPACE_ID }); before(() => esArchiver.load('saved_objects/basic'));
await kibanaServer.importExport.load('saved_objects/basic/foo-ns', { after(() => esArchiver.unload('saved_objects/basic'));
space: `${SPACE_ID}-foo`,
});
});
after(() => kibanaServer.spaces.delete(SPACE_ID));
it('should return 200 with individual responses', async () => it('should return 200 with individual responses', async () =>
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find?type=visualization&fields=title`) .get('/api/saved_objects/_find?type=visualization&fields=title')
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
expect(resp.body.saved_objects.map((so: { id: string }) => so.id)).to.eql([ expect(resp.body.saved_objects.map((so: { id: string }) => so.id)).to.eql([
@ -39,7 +34,7 @@ export default function ({ getService }: FtrProviderContext) {
describe('unknown type', () => { describe('unknown type', () => {
it('should return 200 with empty response', async () => it('should return 200 with empty response', async () =>
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find?type=wigwags`) .get('/api/saved_objects/_find?type=wigwags')
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
expect(resp.body).to.eql({ expect(resp.body).to.eql({
@ -55,7 +50,7 @@ export default function ({ getService }: FtrProviderContext) {
describe.skip('page beyond total', () => { describe.skip('page beyond total', () => {
it('should return 200 with empty response', async () => it('should return 200 with empty response', async () =>
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find?type=visualization&page=100&per_page=100`) .get('/api/saved_objects/_find?type=visualization&page=100&per_page=100')
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
expect(resp.body).to.eql({ expect(resp.body).to.eql({
@ -70,7 +65,7 @@ export default function ({ getService }: FtrProviderContext) {
describe('unknown search field', () => { describe('unknown search field', () => {
it('should return 200 with empty response', async () => it('should return 200 with empty response', async () =>
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find?type=url&search_fields=a`) .get('/api/saved_objects/_find?type=url&search_fields=a')
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
expect(resp.body).to.eql({ expect(resp.body).to.eql({
@ -85,7 +80,7 @@ export default function ({ getService }: FtrProviderContext) {
describe('unknown namespace', () => { describe('unknown namespace', () => {
it('should return 200 with empty response', async () => it('should return 200 with empty response', async () =>
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find?type=visualization&namespaces=foo`) .get('/api/saved_objects/_find?type=visualization&namespaces=foo')
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
expect(resp.body).to.eql({ expect(resp.body).to.eql({
@ -100,7 +95,7 @@ export default function ({ getService }: FtrProviderContext) {
describe('known namespace', () => { describe('known namespace', () => {
it('should return 200 with individual responses', async () => it('should return 200 with individual responses', async () =>
await supertest await supertest
.get(`/api/saved_objects/_find?type=visualization&fields=title&namespaces=${SPACE_ID}`) .get('/api/saved_objects/_find?type=visualization&fields=title&namespaces=default')
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
expect( expect(
@ -108,7 +103,7 @@ export default function ({ getService }: FtrProviderContext) {
id: so.id, id: so.id,
namespaces: so.namespaces, namespaces: so.namespaces,
})) }))
).to.eql([{ id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab', namespaces: [SPACE_ID] }]); ).to.eql([{ id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab', namespaces: ['default'] }]);
expect(resp.body.saved_objects[0].migrationVersion).to.be.ok(); expect(resp.body.saved_objects[0].migrationVersion).to.be.ok();
})); }));
}); });
@ -116,21 +111,17 @@ export default function ({ getService }: FtrProviderContext) {
describe('wildcard namespace', () => { describe('wildcard namespace', () => {
it('should return 200 with individual responses from the all namespaces', async () => it('should return 200 with individual responses from the all namespaces', async () =>
await supertest await supertest
.get(`/api/saved_objects/_find?type=visualization&fields=title&namespaces=*`) .get('/api/saved_objects/_find?type=visualization&fields=title&namespaces=*')
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
const knownDocuments = resp.body.saved_objects.filter((so: { namespaces: string[] }) =>
so.namespaces.some((ns) => [SPACE_ID, `${SPACE_ID}-foo`].includes(ns))
);
expect( expect(
knownDocuments.map((so: { id: string; namespaces: string[] }) => ({ resp.body.saved_objects.map((so: { id: string; namespaces: string[] }) => ({
id: so.id, id: so.id,
namespaces: so.namespaces, namespaces: so.namespaces,
})) }))
).to.eql([ ).to.eql([
{ id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab', namespaces: [SPACE_ID] }, { id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab', namespaces: ['default'] },
{ id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab', namespaces: [`${SPACE_ID}-foo`] }, { id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab', namespaces: ['foo-ns'] },
]); ]);
})); }));
}); });
@ -139,7 +130,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return 200 with a valid response', async () => it('should return 200 with a valid response', async () =>
await supertest await supertest
.get( .get(
`/s/${SPACE_ID}/api/saved_objects/_find?type=visualization&filter=visualization.attributes.title:"Count of requests"` '/api/saved_objects/_find?type=visualization&filter=visualization.attributes.title:"Count of requests"'
) )
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
@ -151,7 +142,7 @@ export default function ({ getService }: FtrProviderContext) {
it('wrong type should return 400 with Bad Request', async () => it('wrong type should return 400 with Bad Request', async () =>
await supertest await supertest
.get( .get(
`/s/${SPACE_ID}/api/saved_objects/_find?type=visualization&filter=dashboard.attributes.title:foo` '/api/saved_objects/_find?type=visualization&filter=dashboard.attributes.title:foo'
) )
.expect(400) .expect(400)
.then((resp) => { .then((resp) => {
@ -165,7 +156,7 @@ export default function ({ getService }: FtrProviderContext) {
it('KQL syntax error should return 400 with Bad Request', async () => it('KQL syntax error should return 400 with Bad Request', async () =>
await supertest await supertest
.get( .get(
`/s/${SPACE_ID}/api/saved_objects/_find?type=dashboard&filter=dashboard.attributes.title:foo<invalid` '/api/saved_objects/_find?type=dashboard&filter=dashboard.attributes.title:foo<invalid'
) )
.expect(400) .expect(400)
.then((resp) => { .then((resp) => {
@ -183,7 +174,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return 200 with valid response for a valid aggregation', async () => it('should return 200 with valid response for a valid aggregation', async () =>
await supertest await supertest
.get( .get(
`/s/${SPACE_ID}/api/saved_objects/_find?type=visualization&per_page=0&aggs=${encodeURIComponent( `/api/saved_objects/_find?type=visualization&per_page=0&aggs=${encodeURIComponent(
JSON.stringify({ JSON.stringify({
type_count: { max: { field: 'visualization.attributes.version' } }, type_count: { max: { field: 'visualization.attributes.version' } },
}) })
@ -207,7 +198,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return a 400 when referencing an invalid SO attribute', async () => it('should return a 400 when referencing an invalid SO attribute', async () =>
await supertest await supertest
.get( .get(
`/s/${SPACE_ID}/api/saved_objects/_find?type=visualization&per_page=0&aggs=${encodeURIComponent( `/api/saved_objects/_find?type=visualization&per_page=0&aggs=${encodeURIComponent(
JSON.stringify({ JSON.stringify({
type_count: { max: { field: 'dashboard.attributes.version' } }, type_count: { max: { field: 'dashboard.attributes.version' } },
}) })
@ -226,7 +217,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return a 400 when using a forbidden aggregation option', async () => it('should return a 400 when using a forbidden aggregation option', async () =>
await supertest await supertest
.get( .get(
`/s/${SPACE_ID}/api/saved_objects/_find?type=visualization&per_page=0&aggs=${encodeURIComponent( `/api/saved_objects/_find?type=visualization&per_page=0&aggs=${encodeURIComponent(
JSON.stringify({ JSON.stringify({
type_count: { type_count: {
max: { max: {
@ -249,14 +240,12 @@ export default function ({ getService }: FtrProviderContext) {
}); });
describe('`has_reference` and `has_reference_operator` parameters', () => { describe('`has_reference` and `has_reference_operator` parameters', () => {
before(() => kibanaServer.importExport.load('saved_objects/references', { space: SPACE_ID })); before(() => esArchiver.load('saved_objects/references'));
after(() => after(() => esArchiver.unload('saved_objects/references'));
kibanaServer.importExport.unload('saved_objects/references', { space: SPACE_ID })
);
it('search for a reference', async () => { it('search for a reference', async () => {
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find`) .get('/api/saved_objects/_find')
.query({ .query({
type: 'visualization', type: 'visualization',
has_reference: JSON.stringify({ type: 'ref-type', id: 'ref-1' }), has_reference: JSON.stringify({ type: 'ref-type', id: 'ref-1' }),
@ -273,7 +262,7 @@ export default function ({ getService }: FtrProviderContext) {
it('search for multiple references with OR operator', async () => { it('search for multiple references with OR operator', async () => {
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find`) .get('/api/saved_objects/_find')
.query({ .query({
type: 'visualization', type: 'visualization',
has_reference: JSON.stringify([ has_reference: JSON.stringify([
@ -287,15 +276,15 @@ export default function ({ getService }: FtrProviderContext) {
const objects = resp.body.saved_objects; const objects = resp.body.saved_objects;
expect(objects.map((obj: SavedObject) => obj.id)).to.eql([ expect(objects.map((obj: SavedObject) => obj.id)).to.eql([
'only-ref-1', 'only-ref-1',
'only-ref-2',
'ref-1-and-ref-2', 'ref-1-and-ref-2',
'only-ref-2',
]); ]);
}); });
}); });
it('search for multiple references with AND operator', async () => { it('search for multiple references with AND operator', async () => {
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find`) .get('/api/saved_objects/_find')
.query({ .query({
type: 'visualization', type: 'visualization',
has_reference: JSON.stringify([ has_reference: JSON.stringify([
@ -311,18 +300,15 @@ export default function ({ getService }: FtrProviderContext) {
}); });
}); });
}); });
});
describe('searching for special characters', () => { describe('searching for special characters', () => {
before(() => before(() => esArchiver.load('saved_objects/find_edgecases'));
kibanaServer.importExport.load('saved_objects/find_edgecases', { space: SPACE_ID }) after(() => esArchiver.unload('saved_objects/find_edgecases'));
);
after(() =>
kibanaServer.importExport.unload('saved_objects/find_edgecases', { space: SPACE_ID })
);
it('can search for objects with dashes', async () => it('can search for objects with dashes', async () =>
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find`) .get('/api/saved_objects/_find')
.query({ .query({
type: 'visualization', type: 'visualization',
search_fields: 'title', search_fields: 'title',
@ -338,7 +324,7 @@ export default function ({ getService }: FtrProviderContext) {
it('can search with the prefix search character just after a special one', async () => it('can search with the prefix search character just after a special one', async () =>
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find`) .get('/api/saved_objects/_find')
.query({ .query({
type: 'visualization', type: 'visualization',
search_fields: 'title', search_fields: 'title',
@ -354,7 +340,7 @@ export default function ({ getService }: FtrProviderContext) {
it('can search for objects with asterisk', async () => it('can search for objects with asterisk', async () =>
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find`) .get('/api/saved_objects/_find')
.query({ .query({
type: 'visualization', type: 'visualization',
search_fields: 'title', search_fields: 'title',
@ -370,7 +356,7 @@ export default function ({ getService }: FtrProviderContext) {
it('can still search tokens by prefix', async () => it('can still search tokens by prefix', async () =>
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/_find`) .get('/api/saved_objects/_find')
.query({ .query({
type: 'visualization', type: 'visualization',
search_fields: 'title', search_fields: 'title',
@ -381,8 +367,120 @@ export default function ({ getService }: FtrProviderContext) {
const savedObjects = resp.body.saved_objects; const savedObjects = resp.body.saved_objects;
expect( expect(
savedObjects.map((so: SavedObject<{ title: string }>) => so.attributes.title) savedObjects.map((so: SavedObject<{ title: string }>) => so.attributes.title)
).to.eql(['some*visualization', 'my-visualization']); ).to.eql(['my-visualization', 'some*visualization']);
}));
});
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return 200 with empty response', async () =>
await supertest
.get('/api/saved_objects/_find?type=visualization')
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
page: 1,
per_page: 20,
total: 0,
saved_objects: [],
});
}));
describe('unknown type', () => {
it('should return 200 with empty response', async () =>
await supertest
.get('/api/saved_objects/_find?type=wigwags')
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
page: 1,
per_page: 20,
total: 0,
saved_objects: [],
});
}));
});
describe('missing type', () => {
it('should return 400', async () =>
await supertest
.get('/api/saved_objects/_find')
.expect(400)
.then((resp) => {
expect(resp.body).to.eql({
error: 'Bad Request',
message:
'[request query.type]: expected at least one defined value but got [undefined]',
statusCode: 400,
});
}));
});
describe('page beyond total', () => {
it('should return 200 with empty response', async () =>
await supertest
.get('/api/saved_objects/_find?type=visualization&page=100&per_page=100')
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
page: 100,
per_page: 100,
total: 0,
saved_objects: [],
});
}));
});
describe('unknown search field', () => {
it('should return 200 with empty response', async () =>
await supertest
.get('/api/saved_objects/_find?type=url&search_fields=a')
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
page: 1,
per_page: 20,
total: 0,
saved_objects: [],
});
}));
});
describe('with a filter', () => {
it('should return 200 with an empty response', async () =>
await supertest
.get(
'/api/saved_objects/_find?type=visualization&filter=visualization.attributes.title:"Count of requests"'
)
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
page: 1,
per_page: 20,
total: 0,
saved_objects: [],
});
}));
it('wrong type should return 400 with Bad Request', async () =>
await supertest
.get(
'/api/saved_objects/_find?type=visualization&filter=dashboard.attributes.title:foo'
)
.expect(400)
.then((resp) => {
expect(resp.body).to.eql({
error: 'Bad Request',
message: 'This type dashboard is not allowed: Bad Request',
statusCode: 400,
});
})); }));
}); });
}); });
});
} }

View file

@ -12,16 +12,19 @@ import { getKibanaVersion } from './lib/saved_objects_test_utils';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const esDeleteAllIndices = getService('esDeleteAllIndices');
describe('get', () => { describe('get', () => {
let KIBANA_VERSION: string; let KIBANA_VERSION: string;
before(async () => { before(async () => {
KIBANA_VERSION = await getKibanaVersion(getService); KIBANA_VERSION = await getKibanaVersion(getService);
await kibanaServer.importExport.load('saved_objects/basic');
}); });
after(() => kibanaServer.importExport.unload('saved_objects/basic'));
describe('with kibana index', () => {
before(() => esArchiver.load('saved_objects/basic'));
after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200', async () => it('should return 200', async () =>
await supertest await supertest
@ -31,7 +34,7 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.body).to.eql({ expect(resp.body).to.eql({
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab', id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
type: 'visualization', type: 'visualization',
updated_at: resp.body.updated_at, updated_at: '2017-09-21T18:51:23.794Z',
version: resp.body.version, version: resp.body.version,
migrationVersion: resp.body.migrationVersion, migrationVersion: resp.body.migrationVersion,
coreMigrationVersion: KIBANA_VERSION, coreMigrationVersion: KIBANA_VERSION,
@ -70,4 +73,26 @@ export default function ({ getService }: FtrProviderContext) {
})); }));
}); });
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return basic 404 without mentioning index', async () =>
await supertest
.get('/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab')
.expect(404)
.then((resp) => {
expect(resp.body).to.eql({
error: 'Not Found',
message:
'Saved object [visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab] not found',
statusCode: 404,
});
}));
});
});
} }

View file

@ -22,7 +22,7 @@ const createConflictError = (
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
describe('import', () => { describe('import', () => {
// mock success results including metadata // mock success results including metadata
@ -42,9 +42,10 @@ export default function ({ getService }: FtrProviderContext) {
meta: { title: 'Requests', icon: 'dashboardApp' }, meta: { title: 'Requests', icon: 'dashboardApp' },
}; };
describe('with kibana index', () => {
describe('with basic data existing', () => { describe('with basic data existing', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic')); before(() => esArchiver.load('saved_objects/basic'));
after(() => kibanaServer.importExport.unload('saved_objects/basic')); after(() => esArchiver.unload('saved_objects/basic'));
it('should return 415 when no file passed in', async () => { it('should return 415 when no file passed in', async () => {
await supertest await supertest
@ -236,4 +237,5 @@ export default function ({ getService }: FtrProviderContext) {
}); });
}); });
}); });
});
} }

View file

@ -12,7 +12,8 @@ import { getKibanaVersion } from './lib/saved_objects_test_utils';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const esDeleteAllIndices = getService('esDeleteAllIndices');
describe('resolve', () => { describe('resolve', () => {
let KIBANA_VERSION: string; let KIBANA_VERSION: string;
@ -22,21 +23,19 @@ export default function ({ getService }: FtrProviderContext) {
}); });
describe('with kibana index', () => { describe('with kibana index', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic')); before(() => esArchiver.load('saved_objects/basic'));
after(() => kibanaServer.importExport.unload('saved_objects/basic')); after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200', async () => it('should return 200', async () =>
await supertest await supertest
.get(`/api/saved_objects/resolve/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`) .get(`/api/saved_objects/resolve/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`)
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
resp.body.saved_object.updated_at = '2015-01-01T00:00:00.000Z';
expect(resp.body).to.eql({ expect(resp.body).to.eql({
saved_object: { saved_object: {
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab', id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
type: 'visualization', type: 'visualization',
updated_at: '2015-01-01T00:00:00.000Z', updated_at: '2017-09-21T18:51:23.794Z',
version: resp.body.saved_object.version, version: resp.body.saved_object.version,
migrationVersion: resp.body.saved_object.migrationVersion, migrationVersion: resp.body.saved_object.migrationVersion,
coreMigrationVersion: KIBANA_VERSION, coreMigrationVersion: KIBANA_VERSION,
@ -77,5 +76,26 @@ export default function ({ getService }: FtrProviderContext) {
})); }));
}); });
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana')
);
it('should return basic 404 without mentioning index', async () =>
await supertest
.get('/api/saved_objects/resolve/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab')
.expect(404)
.then((resp) => {
expect(resp.body).to.eql({
error: 'Not Found',
message:
'Saved object [visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab] not found',
statusCode: 404,
});
}));
});
}); });
} }

View file

@ -12,7 +12,8 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const esDeleteAllIndices = getService('esDeleteAllIndices');
describe('resolve_import_errors', () => { describe('resolve_import_errors', () => {
// mock success results including metadata // mock success results including metadata
@ -31,15 +32,224 @@ export default function ({ getService }: FtrProviderContext) {
id: 'be3733a0-9efe-11e7-acb3-3dab96693fab', id: 'be3733a0-9efe-11e7-acb3-3dab96693fab',
meta: { title: 'Requests', icon: 'dashboardApp' }, meta: { title: 'Requests', icon: 'dashboardApp' },
}; };
const SPACE_ID = 'ftr-so-resolve_import_errors';
describe('without kibana index', () => {
// Cleanup data that got created in import
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return 200 and import nothing when empty parameters are passed in', async () => {
await supertest
.post('/api/saved_objects/_resolve_import_errors')
.field('retries', '[]')
.attach('file', join(__dirname, '../../fixtures/import.ndjson'))
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
success: true,
successCount: 0,
warnings: [],
});
});
});
it('should return 200 with internal server errors', async () => {
await supertest
.post('/api/saved_objects/_resolve_import_errors')
.field(
'retries',
JSON.stringify([
{
type: 'index-pattern',
id: '91200a00-9efd-11e7-acb3-3dab96693fab',
overwrite: true,
},
{
type: 'visualization',
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
overwrite: true,
},
{
type: 'dashboard',
id: 'be3733a0-9efe-11e7-acb3-3dab96693fab',
overwrite: true,
},
])
)
.attach('file', join(__dirname, '../../fixtures/import.ndjson'))
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
successCount: 0,
success: false,
errors: [
{
...indexPattern,
...{ title: indexPattern.meta.title },
overwrite: true,
error: {
statusCode: 500,
error: 'Internal Server Error',
message: 'An internal server error occurred',
type: 'unknown',
},
},
{
...visualization,
...{ title: visualization.meta.title },
overwrite: true,
error: {
statusCode: 500,
error: 'Internal Server Error',
message: 'An internal server error occurred',
type: 'unknown',
},
},
{
...dashboard,
...{ title: dashboard.meta.title },
overwrite: true,
error: {
statusCode: 500,
error: 'Internal Server Error',
message: 'An internal server error occurred',
type: 'unknown',
},
},
],
warnings: [],
});
});
});
it('should return 400 when no file passed in', async () => {
await supertest
.post('/api/saved_objects/_resolve_import_errors')
.field('retries', '[]')
.expect(400)
.then((resp) => {
expect(resp.body).to.eql({
statusCode: 400,
error: 'Bad Request',
message: '[request body.file]: expected value of type [Stream] but got [undefined]',
});
});
});
it('should return 200 when retrying unsupported types', async () => {
const fileBuffer = Buffer.from(
'{"id":"1","type":"wigwags","attributes":{"title":"my title"},"references":[]}',
'utf8'
);
await supertest
.post('/api/saved_objects/_resolve_import_errors')
.field('retries', JSON.stringify([{ type: 'wigwags', id: '1' }]))
.attach('file', fileBuffer, 'export.ndjson')
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
success: false,
successCount: 0,
errors: [
{
id: '1',
type: 'wigwags',
title: 'my title',
meta: { title: 'my title' },
error: { type: 'unsupported_type' },
},
],
warnings: [],
});
});
});
it('should return 400 when resolving conflicts with a file containing more than 10,001 objects', async () => {
const fileChunks = [];
for (let i = 0; i <= 10001; i++) {
fileChunks.push(`{"type":"visualization","id":"${i}","attributes":{},"references":[]}`);
}
await supertest
.post('/api/saved_objects/_resolve_import_errors')
.field('retries', '[]')
.attach('file', Buffer.from(fileChunks.join('\n'), 'utf8'), 'export.ndjson')
.expect(400)
.then((resp) => {
expect(resp.body).to.eql({
statusCode: 400,
error: 'Bad Request',
message: "Can't import more than 10001 objects",
});
});
});
it('should return 200 with errors when missing references', async () => {
const objToInsert = {
id: '1',
type: 'visualization',
attributes: {
title: 'My favorite vis',
visState: '{}',
},
references: [
{
name: 'ref_0',
type: 'index-pattern',
id: '2',
},
],
};
await supertest
.post('/api/saved_objects/_resolve_import_errors')
.field(
'retries',
JSON.stringify([
{
type: 'visualization',
id: '1',
},
])
)
.attach('file', Buffer.from(JSON.stringify(objToInsert), 'utf8'), 'export.ndjson')
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
success: false,
successCount: 0,
errors: [
{
id: '1',
type: 'visualization',
title: 'My favorite vis',
meta: { title: 'My favorite vis', icon: 'visualizeApp' },
error: {
type: 'missing_references',
references: [
{
type: 'index-pattern',
id: '2',
},
],
},
},
],
warnings: [],
});
});
});
});
describe('with kibana index', () => {
describe('with basic data existing', () => { describe('with basic data existing', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic', { space: SPACE_ID })); before(() => esArchiver.load('saved_objects/basic'));
after(() => kibanaServer.spaces.delete(SPACE_ID)); after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200 when skipping all the records', async () => { it('should return 200 when skipping all the records', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_resolve_import_errors`) .post('/api/saved_objects/_resolve_import_errors')
.field('retries', '[]') .field('retries', '[]')
.attach('file', join(__dirname, '../../fixtures/import.ndjson')) .attach('file', join(__dirname, '../../fixtures/import.ndjson'))
.expect(200) .expect(200)
@ -50,7 +260,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return 200 when manually overwriting each object', async () => { it('should return 200 when manually overwriting each object', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_resolve_import_errors`) .post('/api/saved_objects/_resolve_import_errors')
.field( .field(
'retries', 'retries',
JSON.stringify([ JSON.stringify([
@ -89,7 +299,7 @@ export default function ({ getService }: FtrProviderContext) {
it('should return 200 with only one record when overwriting 1 and skipping 1', async () => { it('should return 200 with only one record when overwriting 1 and skipping 1', async () => {
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_resolve_import_errors`) .post('/api/saved_objects/_resolve_import_errors')
.field( .field(
'retries', 'retries',
JSON.stringify([ JSON.stringify([
@ -129,7 +339,7 @@ export default function ({ getService }: FtrProviderContext) {
], ],
}; };
await supertest await supertest
.post(`/s/${SPACE_ID}/api/saved_objects/_resolve_import_errors`) .post('/api/saved_objects/_resolve_import_errors')
.field( .field(
'retries', 'retries',
JSON.stringify([ JSON.stringify([
@ -163,7 +373,7 @@ export default function ({ getService }: FtrProviderContext) {
}); });
}); });
await supertest await supertest
.get(`/s/${SPACE_ID}/api/saved_objects/visualization/1`) .get('/api/saved_objects/visualization/1')
.expect(200) .expect(200)
.then((resp) => { .then((resp) => {
expect(resp.body.references).to.eql([ expect(resp.body.references).to.eql([
@ -177,4 +387,5 @@ export default function ({ getService }: FtrProviderContext) {
}); });
}); });
}); });
});
} }

View file

@ -11,11 +11,13 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const esDeleteAllIndices = getService('esDeleteAllIndices');
describe('update', () => { describe('update', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic')); describe('with kibana index', () => {
after(() => kibanaServer.importExport.unload('saved_objects/basic')); before(() => esArchiver.load('saved_objects/basic'));
after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200', async () => { it('should return 200', async () => {
await supertest await supertest
.put(`/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`) .put(`/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`)
@ -160,4 +162,30 @@ export default function ({ getService }: FtrProviderContext) {
}); });
}); });
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return 500', async () =>
await supertest
.put(`/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`)
.send({
attributes: {
title: 'My second favorite vis',
},
})
.expect(500)
.then((resp) => {
expect(resp.body).eql({
statusCode: 500,
error: 'Internal Server Error',
message: 'An internal server error occurred.',
});
}));
});
});
} }

View file

@ -11,6 +11,7 @@ import { Response } from 'supertest';
import { FtrProviderContext } from '../../ftr_provider_context'; import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const esDeleteAllIndices = getService('esDeleteAllIndices');
const supertest = getService('supertest'); const supertest = getService('supertest');
const esArchiver = getService('esArchiver'); const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
@ -25,8 +26,8 @@ export default function ({ getService }: FtrProviderContext) {
}); });
describe('with kibana index', () => { describe('with kibana index', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic')); before(() => esArchiver.load('saved_objects/basic'));
after(() => kibanaServer.importExport.unload('saved_objects/basic')); after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200 with individual responses', async () => it('should return 200 with individual responses', async () =>
await supertest await supertest
@ -85,8 +86,8 @@ export default function ({ getService }: FtrProviderContext) {
}); });
describe('`hasReference` and `hasReferenceOperator` parameters', () => { describe('`hasReference` and `hasReferenceOperator` parameters', () => {
before(() => kibanaServer.importExport.load('saved_objects/references')); before(() => esArchiver.load('saved_objects/references'));
after(() => kibanaServer.importExport.unload('saved_objects/references')); after(() => esArchiver.unload('saved_objects/references'));
it('search for a reference', async () => { it('search for a reference', async () => {
await supertest await supertest
@ -118,8 +119,8 @@ export default function ({ getService }: FtrProviderContext) {
const objects = resp.body.saved_objects; const objects = resp.body.saved_objects;
expect(objects.map((obj: any) => obj.id)).to.eql([ expect(objects.map((obj: any) => obj.id)).to.eql([
'only-ref-1', 'only-ref-1',
'only-ref-2',
'ref-1-and-ref-2', 'ref-1-and-ref-2',
'only-ref-2',
]); ]);
}); });
}); });
@ -144,6 +145,88 @@ export default function ({ getService }: FtrProviderContext) {
}); });
}); });
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return 200 with empty response', async () =>
await supertest
.get('/api/kibana/management/saved_objects/_find?type=visualization')
.expect(200)
.then((resp: Response) => {
expect(resp.body).to.eql({
page: 1,
per_page: 20,
total: 0,
saved_objects: [],
});
}));
describe('unknown type', () => {
it('should return 200 with empty response', async () =>
await supertest
.get('/api/kibana/management/saved_objects/_find?type=wigwags')
.expect(200)
.then((resp: Response) => {
expect(resp.body).to.eql({
page: 1,
per_page: 20,
total: 0,
saved_objects: [],
});
}));
});
describe('missing type', () => {
it('should return 400', async () =>
await supertest
.get('/api/kibana/management/saved_objects/_find')
.expect(400)
.then((resp: Response) => {
expect(resp.body).to.eql({
error: 'Bad Request',
message:
'[request query.type]: expected at least one defined value but got [undefined]',
statusCode: 400,
});
}));
});
describe('page beyond total', () => {
it('should return 200 with empty response', async () =>
await supertest
.get(
'/api/kibana/management/saved_objects/_find?type=visualization&page=100&perPage=100'
)
.expect(200)
.then((resp: Response) => {
expect(resp.body).to.eql({
page: 100,
per_page: 100,
total: 0,
saved_objects: [],
});
}));
});
describe('unknown search field', () => {
it('should return 400 when using searchFields', async () =>
await supertest
.get('/api/kibana/management/saved_objects/_find?type=url&searchFields=a')
.expect(400)
.then((resp: Response) => {
expect(resp.body).to.eql({
statusCode: 400,
error: 'Bad Request',
message: '[request query.searchFields]: definition for this key is missing',
});
}));
});
});
describe('meta attributes injected properly', () => { describe('meta attributes injected properly', () => {
before(() => esArchiver.load('management/saved_objects/search')); before(() => esArchiver.load('management/saved_objects/search'));
after(() => esArchiver.unload('management/saved_objects/search')); after(() => esArchiver.unload('management/saved_objects/search'));

View file

@ -11,15 +11,17 @@ import { Response } from 'supertest';
import { FtrProviderContext } from '../../ftr_provider_context'; import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const esDeleteAllIndices = getService('esDeleteAllIndices');
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
describe('get', () => { describe('get', () => {
const existingObject = 'visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab'; const existingObject = 'visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab';
const nonexistentObject = 'wigwags/foo'; const nonexistentObject = 'wigwags/foo';
before(() => kibanaServer.importExport.load('saved_objects/basic')); describe('with kibana index', () => {
after(() => kibanaServer.importExport.unload('saved_objects/basic')); before(() => esArchiver.load('saved_objects/basic'));
after(() => esArchiver.unload('saved_objects/basic'));
it('should return 200 for object that exists and inject metadata', async () => it('should return 200 for object that exists and inject metadata', async () =>
await supertest await supertest
@ -34,6 +36,20 @@ export default function ({ getService }: FtrProviderContext) {
})); }));
it('should return 404 for object that does not exist', async () => it('should return 404 for object that does not exist', async () =>
await supertest.get(`/api/kibana/management/saved_objects/${nonexistentObject}`).expect(404)); await supertest
.get(`/api/kibana/management/saved_objects/${nonexistentObject}`)
.expect(404));
});
describe('without kibana index', () => {
before(
async () =>
// just in case the kibana server has recreated it
await esDeleteAllIndices('.kibana*')
);
it('should return 404 for object that no longer exists', async () =>
await supertest.get(`/api/kibana/management/saved_objects/${existingObject}`).expect(404));
});
}); });
} }

View file

@ -12,7 +12,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) { export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const relationSchema = schema.object({ const relationSchema = schema.object({
id: schema.string(), id: schema.string(),
@ -43,8 +43,12 @@ export default function ({ getService }: FtrProviderContext) {
}); });
describe('relationships', () => { describe('relationships', () => {
before(() => kibanaServer.importExport.load('management/saved_objects/relationships')); before(async () => {
after(() => kibanaServer.importExport.unload('management/saved_objects/relationships')); await esArchiver.load('management/saved_objects/relationships');
});
after(async () => {
await esArchiver.unload('management/saved_objects/relationships');
});
const baseApiUrl = `/api/kibana/management/saved_objects/relationships`; const baseApiUrl = `/api/kibana/management/saved_objects/relationships`;
const defaultTypes = ['visualization', 'index-pattern', 'search', 'dashboard']; const defaultTypes = ['visualization', 'index-pattern', 'search', 'dashboard'];

View file

@ -99,6 +99,26 @@ export default function ({ getService }: FtrProviderContext) {
expect(resp.body.message).to.contain('banana not found'); expect(resp.body.message).to.contain('banana not found');
}); });
it('should return 400 when index type is provided in OSS', async () => {
const resp = await supertest
.post(`/internal/search/es`)
.send({
indexType: 'baad',
params: {
body: {
query: {
match_all: {},
},
},
},
})
.expect(400);
verifyErrorResponse(resp.body, 400);
expect(resp.body.message).to.contain('Unsupported index pattern');
});
it('should return 400 with illegal ES argument', async () => { it('should return 400 with illegal ES argument', async () => {
const resp = await supertest const resp = await supertest
.post(`/internal/search/es`) .post(`/internal/search/es`)

View file

@ -9,12 +9,12 @@
import expect from '@kbn/expect'; import expect from '@kbn/expect';
export default function ({ getService }) { export default function ({ getService }) {
const esArchiver = getService('esArchiver');
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer');
describe('url shortener', () => { describe('url shortener', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic')); before(() => esArchiver.load('saved_objects/basic'));
after(() => kibanaServer.importExport.unload('saved_objects/basic')); after(() => esArchiver.unload('saved_objects/basic'));
it('generates shortened urls', async () => { it('generates shortened urls', async () => {
const resp = await supertest const resp = await supertest

View file

@ -44,11 +44,11 @@ const assertStatsAndMetrics = (body) => {
export default function ({ getService }) { export default function ({ getService }) {
const supertest = getService('supertest'); const supertest = getService('supertest');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
describe('kibana stats api', () => { describe('kibana stats api', () => {
before(() => kibanaServer.importExport.load('saved_objects/basic')); before('make sure there are some saved objects', () => esArchiver.load('saved_objects/basic'));
after(() => kibanaServer.importExport.unload('saved_objects/basic')); after('cleanup saved objects changes', () => esArchiver.unload('saved_objects/basic'));
describe('basic', () => { describe('basic', () => {
it('should return the stats without cluster_uuid with no query string params', () => { it('should return the stats without cluster_uuid with no query string params', () => {

View file

@ -8,17 +8,16 @@
export default function ({ getService }) { export default function ({ getService }) {
const esArchiver = getService('esArchiver'); const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const supertest = getService('supertest'); const supertest = getService('supertest');
describe('Suggestions API', function () { describe('Suggestions API', function () {
before(async () => { before(async () => {
await esArchiver.load('index_patterns/basic_index'); await esArchiver.load('index_patterns/basic_index');
await kibanaServer.importExport.load('index_patterns/basic_kibana'); await esArchiver.load('index_patterns/basic_kibana');
}); });
after(async () => { after(async () => {
await esArchiver.unload('index_patterns/basic_index'); await esArchiver.unload('index_patterns/basic_index');
await kibanaServer.importExport.unload('index_patterns/basic_kibana'); await esArchiver.unload('index_patterns/basic_kibana');
}); });
it('should return 200 with special characters', () => it('should return 200 with special characters', () =>

View file

@ -8,6 +8,7 @@
export default function ({ loadTestFile }) { export default function ({ loadTestFile }) {
describe('Telemetry', () => { describe('Telemetry', () => {
loadTestFile(require.resolve('./telemetry_local'));
loadTestFile(require.resolve('./opt_in')); loadTestFile(require.resolve('./opt_in'));
loadTestFile(require.resolve('./telemetry_optin_notice_seen')); loadTestFile(require.resolve('./telemetry_optin_notice_seen'));
}); });

View file

@ -0,0 +1,331 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import expect from '@kbn/expect';
import supertestAsPromised from 'supertest-as-promised';
import { omit } from 'lodash';
import { basicUiCounters } from './__fixtures__/ui_counters';
import { basicUsageCounters } from './__fixtures__/usage_counters';
import type { FtrProviderContext } from '../../ftr_provider_context';
import type { SavedObject } from '../../../../src/core/server';
import ossRootTelemetrySchema from '../../../../src/plugins/telemetry/schema/oss_root.json';
import ossPluginsTelemetrySchema from '../../../../src/plugins/telemetry/schema/oss_plugins.json';
import { assertTelemetryPayload, flatKeys } from './utils';
async function retrieveTelemetry(
supertest: supertestAsPromised.SuperTest<supertestAsPromised.Test>
) {
const { body } = await supertest
.post('/api/telemetry/v2/clusters/_stats')
.set('kbn-xsrf', 'xxx')
.send({ unencrypted: true })
.expect(200);
expect(body.length).to.be(1);
return body[0];
}
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const es = getService('es');
const esArchiver = getService('esArchiver');
describe('/api/telemetry/v2/clusters/_stats', () => {
before('make sure there are some saved objects', () => esArchiver.load('saved_objects/basic'));
after('cleanup saved objects changes', () => esArchiver.unload('saved_objects/basic'));
before('create some telemetry-data tracked indices', async () => {
await es.indices.create({ index: 'filebeat-telemetry_tests_logs' });
});
after('cleanup telemetry-data tracked indices', async () => {
await es.indices.delete({ index: 'filebeat-telemetry_tests_logs' });
});
describe('validate data types', () => {
let stats: Record<string, any>;
before('pull local stats', async () => {
stats = await retrieveTelemetry(supertest);
});
it('should pass the schema validation', () => {
try {
assertTelemetryPayload(
{ root: ossRootTelemetrySchema, plugins: ossPluginsTelemetrySchema },
stats
);
} catch (err) {
err.message = `The telemetry schemas in 'src/plugins/telemetry/schema/' are out-of-date, please update it as required: ${err.message}`;
throw err;
}
});
it('should pass ad-hoc enforced validations', () => {
expect(stats.collection).to.be('local');
expect(stats.collectionSource).to.be('local');
expect(stats.license).to.be(undefined); // OSS cannot get the license
expect(stats.stack_stats.kibana.count).to.be.a('number');
expect(stats.stack_stats.kibana.indices).to.be.a('number');
expect(stats.stack_stats.kibana.os.platforms[0].platform).to.be.a('string');
expect(stats.stack_stats.kibana.os.platforms[0].count).to.be(1);
expect(stats.stack_stats.kibana.os.platformReleases[0].platformRelease).to.be.a('string');
expect(stats.stack_stats.kibana.os.platformReleases[0].count).to.be(1);
expect(stats.stack_stats.kibana.plugins.telemetry.opt_in_status).to.be(false);
expect(stats.stack_stats.kibana.plugins.telemetry.usage_fetcher).to.be.a('string');
expect(stats.stack_stats.kibana.plugins.stack_management).to.be.an('object');
expect(stats.stack_stats.kibana.plugins.ui_metric).to.be.an('object');
expect(stats.stack_stats.kibana.plugins.ui_counters).to.be.an('object');
expect(stats.stack_stats.kibana.plugins.application_usage).to.be.an('object');
expect(stats.stack_stats.kibana.plugins.kql.defaultQueryLanguage).to.be.a('string');
expect(stats.stack_stats.kibana.plugins.localization).to.be.an('object');
expect(stats.stack_stats.kibana.plugins.csp.strict).to.be(false);
expect(stats.stack_stats.kibana.plugins.csp.warnLegacyBrowsers).to.be(true);
expect(stats.stack_stats.kibana.plugins.csp.rulesChangedFromDefault).to.be(false);
expect(stats.stack_stats.kibana.plugins.kibana_config_usage).to.be.an('object');
// non-default kibana configs. Configs set at 'test/api_integration/config.js'.
expect(omit(stats.stack_stats.kibana.plugins.kibana_config_usage, 'server.port')).to.eql({
'elasticsearch.username': '[redacted]',
'elasticsearch.password': '[redacted]',
'elasticsearch.hosts': '[redacted]',
'elasticsearch.healthCheck.delay': 3600000,
'plugins.paths': '[redacted]',
'logging.json': false,
'server.xsrf.disableProtection': true,
'server.compression.referrerWhitelist': '[redacted]',
'server.maxPayload': 1679958,
'status.allowAnonymous': true,
'home.disableWelcomeScreen': true,
'data.search.aggs.shardDelay.enabled': true,
'security.showInsecureClusterWarning': false,
'telemetry.banner': false,
'telemetry.url': '[redacted]',
'telemetry.optInStatusUrl': '[redacted]',
'telemetry.optIn': false,
'newsfeed.service.urlRoot': '[redacted]',
'newsfeed.service.pathTemplate': '[redacted]',
'savedObjects.maxImportPayloadBytes': 10485760,
'savedObjects.maxImportExportSize': 10001,
'usageCollection.usageCounters.bufferDuration': 0,
});
expect(stats.stack_stats.kibana.plugins.kibana_config_usage['server.port']).to.be.a(
'number'
);
// Testing stack_stats.data
expect(stats.stack_stats.data).to.be.an('object');
expect(stats.stack_stats.data).to.be.an('array');
expect(stats.stack_stats.data[0]).to.be.an('object');
expect(stats.stack_stats.data[0].pattern_name).to.be('filebeat');
expect(stats.stack_stats.data[0].shipper).to.be('filebeat');
expect(stats.stack_stats.data[0].index_count).to.be(1);
expect(stats.stack_stats.data[0].doc_count).to.be(0);
expect(stats.stack_stats.data[0].ecs_index_count).to.be(0);
expect(stats.stack_stats.data[0].size_in_bytes).to.be.a('number');
expect(stats.stack_stats.kibana.plugins.saved_objects_counts).to.be.an('object');
expect(stats.stack_stats.kibana.plugins.saved_objects_counts.by_type).to.be.an('array');
expect(stats.stack_stats.kibana.plugins.saved_objects_counts.by_type).to.eql([
{ type: 'config', count: 2 },
{ type: 'dashboard', count: 2 },
{ type: 'index-pattern', count: 2 },
{ type: 'visualization', count: 2 },
]);
});
it('should validate mandatory fields exist', () => {
const actual = flatKeys(stats);
expect(actual).to.be.an('array');
const expected = [
'cluster_name',
'cluster_stats.cluster_uuid',
'cluster_stats.indices.analysis',
'cluster_stats.indices.completion',
'cluster_stats.indices.count',
'cluster_stats.indices.docs',
'cluster_stats.indices.fielddata',
'cluster_stats.indices.mappings',
'cluster_stats.indices.query_cache',
'cluster_stats.indices.segments',
'cluster_stats.indices.shards',
'cluster_stats.indices.store',
'cluster_stats.nodes.count',
'cluster_stats.nodes.discovery_types',
'cluster_stats.nodes.fs',
'cluster_stats.nodes.ingest',
'cluster_stats.nodes.jvm',
'cluster_stats.nodes.network_types',
'cluster_stats.nodes.os',
'cluster_stats.nodes.packaging_types',
'cluster_stats.nodes.plugins',
'cluster_stats.nodes.process',
'cluster_stats.nodes.versions',
'cluster_stats.nodes.usage',
'cluster_stats.status',
'cluster_stats.timestamp',
'cluster_uuid',
'collection',
'collectionSource',
'stack_stats.kibana.count',
'stack_stats.kibana.indices',
'stack_stats.kibana.os',
'stack_stats.kibana.plugins',
'stack_stats.kibana.versions',
'timestamp',
'version',
];
expect(expected.every((m) => actual.includes(m))).to.be.ok();
});
});
describe('UI Counters telemetry', () => {
before('Add UI Counters saved objects', () => esArchiver.load('saved_objects/ui_counters'));
after('cleanup saved objects changes', () => esArchiver.unload('saved_objects/ui_counters'));
it('returns ui counters aggregated by day', async () => {
const stats = await retrieveTelemetry(supertest);
expect(stats.stack_stats.kibana.plugins.ui_counters).to.eql(basicUiCounters);
});
});
describe('Usage Counters telemetry', () => {
before('Add UI Counters saved objects', () =>
esArchiver.load('saved_objects/usage_counters')
);
after('cleanup saved objects changes', () =>
esArchiver.unload('saved_objects/usage_counters')
);
it('returns usage counters aggregated by day', async () => {
const stats = await retrieveTelemetry(supertest);
expect(stats.stack_stats.kibana.plugins.usage_counters).to.eql(basicUsageCounters);
});
});
describe('application usage limits', () => {
function createSavedObject(viewId?: string) {
return supertest
.post('/api/saved_objects/application_usage_daily')
.send({
attributes: {
appId: 'test-app',
viewId,
minutesOnScreen: 10.33,
numberOfClicks: 10,
timestamp: new Date().toISOString(),
},
})
.expect(200)
.then((resp) => resp.body.id);
}
describe('basic behaviour', () => {
let savedObjectIds: string[] = [];
before('create application usage entries', async () => {
await esArchiver.emptyKibanaIndex();
savedObjectIds = await Promise.all([
createSavedObject(),
createSavedObject('appView1'),
createSavedObject(),
]);
});
after('cleanup', async () => {
await Promise.all(
savedObjectIds.map((savedObjectId) => {
return supertest
.delete(`/api/saved_objects/application_usage_daily/${savedObjectId}`)
.expect(200);
})
);
});
it('should return application_usage data', async () => {
const stats = await retrieveTelemetry(supertest);
expect(stats.stack_stats.kibana.plugins.application_usage).to.eql({
'test-app': {
appId: 'test-app',
viewId: 'main',
clicks_total: 20,
clicks_7_days: 20,
clicks_30_days: 20,
clicks_90_days: 20,
minutes_on_screen_total: 20.66,
minutes_on_screen_7_days: 20.66,
minutes_on_screen_30_days: 20.66,
minutes_on_screen_90_days: 20.66,
views: [
{
appId: 'test-app',
viewId: 'appView1',
clicks_total: 10,
clicks_7_days: 10,
clicks_30_days: 10,
clicks_90_days: 10,
minutes_on_screen_total: 10.33,
minutes_on_screen_7_days: 10.33,
minutes_on_screen_30_days: 10.33,
minutes_on_screen_90_days: 10.33,
},
],
},
});
});
});
describe('10k + 1', () => {
const savedObjectIds = [];
before('create 10k + 1 entries for application usage', async () => {
await supertest
.post('/api/saved_objects/_bulk_create')
.send(
new Array(10001).fill(0).map(() => ({
type: 'application_usage_daily',
attributes: {
appId: 'test-app',
minutesOnScreen: 1,
numberOfClicks: 1,
timestamp: new Date().toISOString(),
},
}))
)
.expect(200)
.then((resp) =>
resp.body.saved_objects.forEach(({ id }: SavedObject) => savedObjectIds.push(id))
);
});
after('clean them all', async () => {
// The SavedObjects API does not allow bulk deleting, and deleting one by one takes ages and the tests timeout
await es.deleteByQuery({
index: '.kibana',
body: { query: { term: { type: 'application_usage_daily' } } },
conflicts: 'proceed',
});
});
it("should only use the first 10k docs for the application_usage data (they'll be rolled up in a later process)", async () => {
const stats = await retrieveTelemetry(supertest);
expect(stats.stack_stats.kibana.plugins.application_usage).to.eql({
'test-app': {
appId: 'test-app',
viewId: 'main',
clicks_total: 10000,
clicks_7_days: 10000,
clicks_30_days: 10000,
clicks_90_days: 10000,
minutes_on_screen_total: 10000,
minutes_on_screen_7_days: 10000,
minutes_on_screen_30_days: 10000,
minutes_on_screen_90_days: 10000,
views: [],
},
});
});
});
});
});
}

View file

@ -31,7 +31,6 @@ export default async function ({ readConfigFile }) {
'--server.xsrf.disableProtection=true', '--server.xsrf.disableProtection=true',
'--server.compression.referrerWhitelist=["some-host.com"]', '--server.compression.referrerWhitelist=["some-host.com"]',
`--savedObjects.maxImportExportSize=10001`, `--savedObjects.maxImportExportSize=10001`,
'--savedObjects.maxImportPayloadBytes=30000000',
// for testing set buffer duration to 0 to immediately flush counters into saved objects. // for testing set buffer duration to 0 to immediately flush counters into saved objects.
'--usageCollection.usageCounters.bufferDuration=0', '--usageCollection.usageCounters.bufferDuration=0',
], ],

View file

@ -0,0 +1,15 @@
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "index-pattern:91200a00-9efd-11e7-acb3-3dab96693fab",
"source": {
"type": "index-pattern",
"updated_at": "2017-09-21T18:49:16.270Z",
"index-pattern": {
"title": "basic_index",
"fields": "[{\"name\":\"bar\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"baz\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"baz.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"foo\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"nestedField.child\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"nested\":{\"path\":\"nestedField\"}}}]"
}
}
}
}

View file

@ -0,0 +1,253 @@
{
"type": "index",
"value": {
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
},
"defaultIndex": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"dashboard": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"search": {
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"timelion-sheet": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"namespace": {
"type": "keyword"
},
"type": {
"type": "keyword"
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
}
}
}
}
}

View file

@ -0,0 +1,190 @@
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "timelion-sheet:190f3e90-2ec3-11e8-ba48-69fc4e41e1f6",
"source": {
"type": "timelion-sheet",
"updated_at": "2018-03-23T17:53:30.872Z",
"timelion-sheet": {
"title": "New TimeLion Sheet",
"hits": 0,
"description": "",
"timelion_sheet": [
".es(*)"
],
"timelion_interval": "auto",
"timelion_chart_height": 275,
"timelion_columns": 2,
"timelion_rows": 2,
"version": 1
}
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "index-pattern:8963ca30-3224-11e8-a572-ffca06da1357",
"source": {
"type": "index-pattern",
"updated_at": "2018-03-28T01:08:34.290Z",
"index-pattern": {
"title": "saved_objects*",
"fields": "[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]"
}
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "config:7.0.0-alpha1",
"source": {
"type": "config",
"updated_at": "2018-03-28T01:08:39.248Z",
"config": {
"buildNum": 8467,
"telemetry:optIn": false,
"defaultIndex": "8963ca30-3224-11e8-a572-ffca06da1357"
}
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "search:960372e0-3224-11e8-a572-ffca06da1357",
"source": {
"type": "search",
"updated_at": "2018-03-28T01:08:55.182Z",
"search": {
"title": "OneRecord",
"description": "",
"hits": 0,
"columns": [
"_source"
],
"sort": [
"_score",
"desc"
],
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"8963ca30-3224-11e8-a572-ffca06da1357\",\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"id:3\",\"language\":\"lucene\"},\"filter\":[]}"
}
}
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:a42c0580-3224-11e8-a572-ffca06da1357",
"source": {
"type": "visualization",
"updated_at": "2018-03-28T01:09:18.936Z",
"visualization": {
"title": "VisualizationFromSavedSearch",
"visState": "{\"title\":\"VisualizationFromSavedSearch\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMeticsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}",
"uiStateJSON": "{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}",
"description": "",
"savedSearchId": "960372e0-3224-11e8-a572-ffca06da1357",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
}
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:add810b0-3224-11e8-a572-ffca06da1357",
"source": {
"type": "visualization",
"updated_at": "2018-03-28T01:09:35.163Z",
"visualization": {
"title": "Visualization",
"visState": "{\"title\":\"Visualization\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"metric\",\"metric\":{\"percentageMode\":false,\"useRanges\":false,\"colorSchema\":\"Green to Red\",\"metricColorMode\":\"None\",\"colorsRange\":[{\"from\":0,\"to\":10000}],\"labels\":{\"show\":true},\"invertColors\":false,\"style\":{\"bgFill\":\"#000\",\"bgColor\":false,\"labelColor\":false,\"subText\":\"\",\"fontSize\":60}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}",
"uiStateJSON": "{}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"8963ca30-3224-11e8-a572-ffca06da1357\",\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
}
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "dashboard:b70c7ae0-3224-11e8-a572-ffca06da1357",
"source": {
"type": "dashboard",
"updated_at": "2018-03-28T01:09:50.606Z",
"dashboard": {
"title": "Dashboard",
"hits": 0,
"description": "",
"panelsJSON": "[{\"gridData\":{\"w\":24,\"h\":15,\"x\":0,\"y\":0,\"i\":\"1\"},\"version\":\"7.0.0-alpha1\",\"panelIndex\":\"1\",\"type\":\"visualization\",\"id\":\"add810b0-3224-11e8-a572-ffca06da1357\",\"embeddableConfig\":{}},{\"gridData\":{\"w\":24,\"h\":15,\"x\":24,\"y\":0,\"i\":\"2\"},\"version\":\"7.0.0-alpha1\",\"panelIndex\":\"2\",\"type\":\"visualization\",\"id\":\"a42c0580-3224-11e8-a572-ffca06da1357\",\"embeddableConfig\":{}}]",
"optionsJSON": "{\"darkTheme\":false,\"useMargins\":true,\"hidePanelTitles\":false}",
"version": 1,
"timeRestore": false,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[],\"highlightAll\":true,\"version\":true}"
}
}
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "dashboard:invalid-refs",
"source": {
"type": "dashboard",
"updated_at": "2018-03-28T01:09:50.606Z",
"dashboard": {
"title": "Dashboard",
"hits": 0,
"description": "",
"panelsJSON": "[]",
"optionsJSON": "{}",
"version": 1,
"timeRestore": false,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{}"
}
},
"references": [
{
"type":"visualization",
"id": "add810b0-3224-11e8-a572-ffca06da1357",
"name": "valid-ref"
},
{
"type":"visualization",
"id": "invalid-vis",
"name": "missing-ref"
}
]
}
}
}

View file

@ -0,0 +1,297 @@
{
"type": "index",
"value": {
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "1",
"auto_expand_replicas": "0-1",
"number_of_replicas": "0"
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
},
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
},
"defaultIndex": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"telemetry:optIn": {
"type": "boolean"
}
}
},
"dashboard": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"graph-workspace": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"numLinks": {
"type": "integer"
},
"numVertices": {
"type": "integer"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
},
"wsState": {
"type": "text"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"search": {
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"timelion-sheet": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"type": {
"type": "keyword"
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
}
}
}
}
}

View file

@ -0,0 +1,253 @@
{
"type": "index",
"value": {
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
},
"defaultIndex": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"dashboard": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"search": {
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"timelion-sheet": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"namespace": {
"type": "keyword"
},
"type": {
"type": "keyword"
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
}
}
}
}
}

View file

@ -0,0 +1,267 @@
{
"type": "index",
"value": {
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
},
"defaultIndex": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"dashboard": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"search": {
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"timelion-sheet": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"namespace": {
"type": "keyword"
},
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
},
"type": {
"type": "keyword"
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
}
}
}
}
}

View file

@ -0,0 +1,93 @@
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:title-with-dash",
"source": {
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"visualization": {
"title": "my-visualization",
"visState": "{}",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
},
"references": []
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:title-with-asterisk",
"source": {
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"visualization": {
"title": "some*visualization",
"visState": "{}",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
},
"references": []
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:noise-1",
"source": {
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"visualization": {
"title": "Just some noise in the dataset",
"visState": "{}",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
},
"references": []
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:noise-2",
"source": {
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"visualization": {
"title": "Just some noise in the dataset",
"visState": "{}",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
},
"references": []
}
}
}

View file

@ -0,0 +1,267 @@
{
"type": "index",
"value": {
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
},
"defaultIndex": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"dashboard": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"search": {
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"timelion-sheet": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"namespace": {
"type": "keyword"
},
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
},
"type": {
"type": "keyword"
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
}
}
}
}
}

View file

@ -0,0 +1,120 @@
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:only-ref-1",
"source": {
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"visualization": {
"title": "Vis with ref to ref-1",
"visState": "{}",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
},
"references": [
{
"type": "ref-type",
"id": "ref-1",
"name": "ref-1"
}
]
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:ref-1-and-ref-2",
"source": {
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"visualization": {
"title": "Vis with ref to ref-1 and ref-2",
"visState": "{}",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
},
"references": [
{
"type": "ref-type",
"id": "ref-1",
"name": "ref-1"
},
{
"type": "ref-type",
"id": "ref-2",
"name": "ref-2"
}
]
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:only-ref-2",
"source": {
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"visualization": {
"title": "Vis with ref to ref-2",
"visState": "{}",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
},
"references": [
{
"type": "ref-type",
"id": "ref-2",
"name": "ref-2"
}
]
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "visualization:only-ref-3",
"source": {
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"visualization": {
"title": "Vis with ref to ref-3",
"visState": "{}",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
}
},
"references": [
{
"type": "ref-type",
"id": "ref-3",
"name": "ref-3"
}
]
}
}
}

View file

@ -0,0 +1,267 @@
{
"type": "index",
"value": {
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"config": {
"dynamic": "true",
"properties": {
"buildNum": {
"type": "keyword"
},
"defaultIndex": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"dashboard": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
}
}
},
"search": {
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"timelion-sheet": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"namespace": {
"type": "keyword"
},
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
},
"type": {
"type": "keyword"
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
}
}
}
}
}

View file

@ -1,15 +0,0 @@
{
"attributes": {
"fields": "[{\"name\":\"bar\",\"type\":\"boolean\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"baz\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"baz.keyword\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"foo\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"nestedField.child\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true,\"subType\":{\"nested\":{\"path\":\"nestedField\"}}}]",
"title": "basic_index"
},
"coreMigrationVersion": "7.14.0",
"id": "91200a00-9efd-11e7-acb3-3dab96693fab",
"migrationVersion": {
"index-pattern": "7.11.0"
},
"references": [],
"type": "index-pattern",
"updated_at": "2017-09-21T18:49:16.270Z",
"version": "WzEsMl0="
}

View file

@ -1,200 +0,0 @@
{
"attributes": {
"description": "",
"hits": 0,
"timelion_chart_height": 275,
"timelion_columns": 2,
"timelion_interval": "auto",
"timelion_rows": 2,
"timelion_sheet": [
".es(*)"
],
"title": "New TimeLion Sheet",
"version": 1
},
"coreMigrationVersion": "8.0.0",
"id": "190f3e90-2ec3-11e8-ba48-69fc4e41e1f6",
"references": [],
"type": "timelion-sheet",
"updated_at": "2018-03-23T17:53:30.872Z",
"version": "WzgsMl0="
}
{
"attributes": {
"fields": "[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]",
"title": "saved_objects*"
},
"coreMigrationVersion": "8.0.0",
"id": "8963ca30-3224-11e8-a572-ffca06da1357",
"migrationVersion": {
"index-pattern": "7.11.0"
},
"references": [],
"type": "index-pattern",
"updated_at": "2018-03-28T01:08:34.290Z",
"version": "WzksMl0="
}
{
"attributes": {
"columns": [
"_source"
],
"description": "",
"hits": 0,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"highlightAll\":true,\"version\":true,\"query\":{\"query\":\"id:3\",\"language\":\"lucene\"},\"filter\":[],\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"
},
"sort": [
[
"_score",
"desc"
]
],
"title": "OneRecord",
"version": 1
},
"coreMigrationVersion": "8.0.0",
"id": "960372e0-3224-11e8-a572-ffca06da1357",
"migrationVersion": {
"search": "7.9.3"
},
"references": [
{
"id": "8963ca30-3224-11e8-a572-ffca06da1357",
"name": "kibanaSavedObjectMeta.searchSourceJSON.index",
"type": "index-pattern"
}
],
"type": "search",
"updated_at": "2018-03-28T01:08:55.182Z",
"version": "WzExLDJd"
}
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
},
"savedSearchRefName": "search_0",
"title": "VisualizationFromSavedSearch",
"uiStateJSON": "{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}",
"version": 1,
"visState": "{\"title\":\"VisualizationFromSavedSearch\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMeticsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\",\"showToolbar\":true},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}"
},
"coreMigrationVersion": "8.0.0",
"id": "a42c0580-3224-11e8-a572-ffca06da1357",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [
{
"id": "960372e0-3224-11e8-a572-ffca06da1357",
"name": "search_0",
"type": "search"
}
],
"type": "visualization",
"updated_at": "2018-03-28T01:09:18.936Z",
"version": "WzEyLDJd"
}
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"
},
"title": "Visualization",
"uiStateJSON": "{}",
"version": 1,
"visState": "{\"title\":\"Visualization\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"metric\",\"metric\":{\"percentageMode\":false,\"useRanges\":false,\"colorSchema\":\"Green to Red\",\"metricColorMode\":\"None\",\"colorsRange\":[{\"from\":0,\"to\":10000}],\"labels\":{\"show\":true},\"invertColors\":false,\"style\":{\"bgFill\":\"#000\",\"bgColor\":false,\"labelColor\":false,\"subText\":\"\",\"fontSize\":60}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}"
},
"coreMigrationVersion": "8.0.0",
"id": "add810b0-3224-11e8-a572-ffca06da1357",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [
{
"id": "8963ca30-3224-11e8-a572-ffca06da1357",
"name": "kibanaSavedObjectMeta.searchSourceJSON.index",
"type": "index-pattern"
}
],
"type": "visualization",
"updated_at": "2018-03-28T01:09:35.163Z",
"version": "WzEzLDJd"
}
{
"attributes": {
"description": "",
"hits": 0,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[],\"highlightAll\":true,\"version\":true}"
},
"optionsJSON": "{\"darkTheme\":false,\"useMargins\":true,\"hidePanelTitles\":false}",
"panelsJSON": "[{\"version\":\"7.0.0-alpha1\",\"gridData\":{\"w\":24,\"h\":15,\"x\":0,\"y\":0,\"i\":\"1\"},\"panelIndex\":\"1\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_0\"},{\"version\":\"7.0.0-alpha1\",\"gridData\":{\"w\":24,\"h\":15,\"x\":24,\"y\":0,\"i\":\"2\"},\"panelIndex\":\"2\",\"embeddableConfig\":{\"enhancements\":{}},\"panelRefName\":\"panel_1\"}]",
"timeRestore": false,
"title": "Dashboard",
"version": 1
},
"coreMigrationVersion": "8.0.0",
"id": "b70c7ae0-3224-11e8-a572-ffca06da1357",
"migrationVersion": {
"dashboard": "7.11.0"
},
"references": [
{
"id": "add810b0-3224-11e8-a572-ffca06da1357",
"name": "panel_0",
"type": "visualization"
},
{
"id": "a42c0580-3224-11e8-a572-ffca06da1357",
"name": "panel_1",
"type": "visualization"
}
],
"type": "dashboard",
"updated_at": "2018-03-28T01:09:50.606Z",
"version": "WzE0LDJd"
}
{
"attributes": {
"description": "",
"hits": 0,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"kuery\"}}"
},
"optionsJSON": "{}",
"panelsJSON": "[]",
"timeRestore": false,
"title": "Dashboard",
"version": 1
},
"coreMigrationVersion": "8.0.0",
"id": "invalid-refs",
"migrationVersion": {
"dashboard": "7.11.0"
},
"references": [
{
"id": "add810b0-3224-11e8-a572-ffca06da1357",
"name": "valid-ref",
"type": "visualization"
},
{
"id": "invalid-vis",
"name": "missing-ref",
"type": "visualization"
}
],
"type": "dashboard",
"updated_at": "2018-03-28T01:09:50.606Z",
"version": "WzE1LDJd"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,87 +0,0 @@
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
},
"title": "Just some noise in the dataset",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"version": 1,
"visState": "{}"
},
"coreMigrationVersion": "8.0.0",
"id": "noise-1",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [],
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"version": "WzYsMl0="
}
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
},
"title": "Just some noise in the dataset",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"version": 1,
"visState": "{}"
},
"coreMigrationVersion": "8.0.0",
"id": "noise-2",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [],
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"version": "WzcsMl0="
}
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
},
"title": "some*visualization",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"version": 1,
"visState": "{}"
},
"coreMigrationVersion": "8.0.0",
"id": "title-with-asterisk",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [],
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"version": "WzUsMl0="
}
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
},
"title": "my-visualization",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"version": 1,
"visState": "{}"
},
"coreMigrationVersion": "8.0.0",
"id": "title-with-dash",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [],
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"version": "WzQsMl0="
}

View file

@ -1,116 +0,0 @@
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
},
"title": "Vis with ref to ref-1",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"version": 1,
"visState": "{}"
},
"coreMigrationVersion": "8.0.0",
"id": "only-ref-1",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [
{
"id": "ref-1",
"name": "ref-1",
"type": "ref-type"
}
],
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"version": "WzQsMl0="
}
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
},
"title": "Vis with ref to ref-2",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"version": 1,
"visState": "{}"
},
"coreMigrationVersion": "8.0.0",
"id": "only-ref-2",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [
{
"id": "ref-2",
"name": "ref-2",
"type": "ref-type"
}
],
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"version": "WzYsMl0="
}
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
},
"title": "Vis with ref to ref-3",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"version": 1,
"visState": "{}"
},
"coreMigrationVersion": "8.0.0",
"id": "only-ref-3",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [
{
"id": "ref-3",
"name": "ref-3",
"type": "ref-type"
}
],
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"version": "WzcsMl0="
}
{
"attributes": {
"description": "",
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
},
"title": "Vis with ref to ref-1 and ref-2",
"uiStateJSON": "{\"spy\":{\"mode\":{\"name\":null,\"fill\":false}}}",
"version": 1,
"visState": "{}"
},
"coreMigrationVersion": "8.0.0",
"id": "ref-1-and-ref-2",
"migrationVersion": {
"visualization": "7.13.0"
},
"references": [
{
"id": "ref-1",
"name": "ref-1",
"type": "ref-type"
},
{
"id": "ref-2",
"name": "ref-2",
"type": "ref-type"
}
],
"type": "visualization",
"updated_at": "2017-09-21T18:51:23.794Z",
"version": "WzUsMl0="
}

View file

@ -29,6 +29,14 @@ export class DeploymentService extends FtrService {
return getUrl.baseUrl(this.config.get('servers.elasticsearch')); return getUrl.baseUrl(this.config.get('servers.elasticsearch'));
} }
/**
* Helper to detect an OSS licensed Kibana
* Useful for functional testing in cloud environment
*/
async isOss() {
return this.config.get('kbnTestServer.serverArgs').indexOf('--oss') > -1;
}
async isCloud(): Promise<boolean> { async isCloud(): Promise<boolean> {
const baseUrl = this.getHostPort(); const baseUrl = this.getHostPort();
const username = this.config.get('servers.kibana.username'); const username = this.config.get('servers.kibana.username');

View file

@ -50,9 +50,6 @@ export default async function ({ readConfigFile }) {
esArchiver: { esArchiver: {
directory: path.resolve(__dirname, '../es_archives'), directory: path.resolve(__dirname, '../es_archives'),
}, },
kbnArchiver: {
directory: path.resolve(__dirname, '../functional/fixtures/kbn_archiver'),
},
screenshots: functionalConfig.get('screenshots'), screenshots: functionalConfig.get('screenshots'),
junit: { junit: {
reportName: 'Example plugin functional tests', reportName: 'Example plugin functional tests',

View file

@ -93,7 +93,6 @@ export const testDashboardInput = {
// eslint-disable-next-line import/no-default-export // eslint-disable-next-line import/no-default-export
export default function ({ getService, getPageObjects }: PluginFunctionalProviderContext) { export default function ({ getService, getPageObjects }: PluginFunctionalProviderContext) {
const esArchiver = getService('esArchiver'); const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const pieChart = getService('pieChart'); const pieChart = getService('pieChart');
const browser = getService('browser'); const browser = getService('browser');
@ -103,14 +102,12 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
describe('dashboard container', () => { describe('dashboard container', () => {
before(async () => { before(async () => {
await esArchiver.loadIfNeeded('../functional/fixtures/es_archiver/dashboard/current/data'); await esArchiver.loadIfNeeded('../functional/fixtures/es_archiver/dashboard/current/data');
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.loadIfNeeded('../functional/fixtures/es_archiver/dashboard/current/kibana');
await PageObjects.common.navigateToApp('dashboardEmbeddableExamples'); await PageObjects.common.navigateToApp('dashboardEmbeddableExamples');
await testSubjects.click('dashboardEmbeddableByValue'); await testSubjects.click('dashboardEmbeddableByValue');
await updateInput(JSON.stringify(testDashboardInput, null, 4)); await updateInput(JSON.stringify(testDashboardInput, null, 4));
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('pie charts', async () => { it('pie charts', async () => {
await pieChart.expectPieSliceCount(5); await pieChart.expectPieSliceCount(5);
}); });

View file

@ -22,7 +22,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
await retry.try(async () => { await retry.try(async () => {
const text = await testSubjects.getVisibleText('expressionResult'); const text = await testSubjects.getVisibleText('expressionResult');
expect(text).to.be( expect(text).to.be(
'{\n "type": "render",\n "as": "markdown",\n "value": {\n "content": "## expressions explorer",\n "font": {\n "type": "style",\n "spec": {\n "fontFamily": "\'Open Sans\', Helvetica, Arial, sans-serif",\n "fontWeight": "normal",\n "fontStyle": "normal",\n "textDecoration": "none",\n "textAlign": "left",\n "fontSize": "14px",\n "lineHeight": "1"\n },\n "css": "font-family:\'Open Sans\', Helvetica, Arial, sans-serif;font-weight:normal;font-style:normal;text-decoration:none;text-align:left;font-size:14px;line-height:1"\n },\n "openLinksInNewTab": false\n }\n}' '{\n "type": "error",\n "error": {\n "message": "Function markdown could not be found.",\n "name": "fn not found"\n }\n}'
); );
}); });
}); });
@ -30,7 +30,7 @@ export default function ({ getService }: PluginFunctionalProviderContext) {
it('renders expression', async () => { it('renders expression', async () => {
await retry.try(async () => { await retry.try(async () => {
const text = await testSubjects.getVisibleText('expressionRender'); const text = await testSubjects.getVisibleText('expressionRender');
expect(text).to.be('expressions explorer rendering'); expect(text).to.be('Function markdown could not be found.');
}); });
}); });

View file

@ -14,6 +14,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const esArchiver = getService('esArchiver');
const find = getService('find'); const find = getService('find');
const PageObjects = getPageObjects([ const PageObjects = getPageObjects([
@ -39,7 +40,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('dashboard panel copy to', function viewEditModeTests() { describe('dashboard panel copy to', function viewEditModeTests() {
before(async function () { before(async function () {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -60,7 +61,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after(async function () { after(async function () {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
await kibanaServer.importExport.unload('dashboard/current/kibana');
}); });
it('does not show the new dashboard option when on a new dashboard', async () => { it('does not show the new dashboard option when on a new dashboard', async () => {

View file

@ -16,12 +16,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry'); const retry = getService('retry');
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']); const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
const browser = getService('browser'); const browser = getService('browser');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
describe('create and add embeddables', () => { describe('create and add embeddables', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -30,8 +31,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.loadSavedDashboard('few panels'); await PageObjects.dashboard.loadSavedDashboard('few panels');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
describe('add new visualization link', () => { describe('add new visualization link', () => {
it('adds new visualization via the top nav link', async () => { it('adds new visualization via the top nav link', async () => {
const originalPanelCount = await PageObjects.dashboard.getPanelCount(); const originalPanelCount = await PageObjects.dashboard.getPanelCount();

View file

@ -10,13 +10,14 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context'; import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize', 'timePicker']); const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize', 'timePicker']);
const browser = getService('browser'); const browser = getService('browser');
describe('dashboard back button', () => { describe('dashboard back button', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.loadIfNeeded('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -24,8 +25,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.preserveCrossAppState(); await PageObjects.dashboard.preserveCrossAppState();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('after navigation from listing page to dashboard back button works', async () => { it('after navigation from listing page to dashboard back button works', async () => {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.loadSavedDashboard('dashboard with everything'); await PageObjects.dashboard.loadSavedDashboard('dashboard with everything');

View file

@ -9,7 +9,7 @@
import { FtrProviderContext } from '../../ftr_provider_context'; import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const PageObjects = getPageObjects(['dashboard', 'header', 'common']); const PageObjects = getPageObjects(['dashboard', 'header', 'common']);
const browser = getService('browser'); const browser = getService('browser');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
@ -19,15 +19,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
*/ */
describe('dashboard error handling', () => { describe('dashboard error handling', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.loadIfNeeded('dashboard/current/kibana');
await PageObjects.common.navigateToApp('dashboard'); await PageObjects.common.navigateToApp('dashboard');
await kibanaServer.savedObjects.delete({
type: 'index-pattern',
id: 'to-be-removed',
}); });
});
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
// wrapping into own describe to make sure new tab is cleaned up even if test failed // wrapping into own describe to make sure new tab is cleaned up even if test failed
// see: https://github.com/elastic/kibana/pull/67280#discussion_r430528122 // see: https://github.com/elastic/kibana/pull/67280#discussion_r430528122

View file

@ -17,6 +17,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const filterBar = getService('filterBar'); const filterBar = getService('filterBar');
const pieChart = getService('pieChart'); const pieChart = getService('pieChart');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const browser = getService('browser'); const browser = getService('browser');
const PageObjects = getPageObjects([ const PageObjects = getPageObjects([
@ -30,15 +31,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('dashboard filter bar', () => { describe('dashboard filter bar', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
await PageObjects.common.navigateToApp('dashboard'); await PageObjects.common.navigateToApp('dashboard');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
describe('Add a filter bar', function () { describe('Add a filter bar', function () {
before(async () => { before(async () => {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
@ -201,10 +200,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('bad filters are loaded properly', function () { describe('bad filters are loaded properly', function () {
before(async () => { before(async () => {
await kibanaServer.savedObjects.delete({
type: 'index-pattern',
id: 'to-be-removed',
});
await filterBar.ensureFieldEditorModalIsClosed(); await filterBar.ensureFieldEditorModalIsClosed();
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.loadSavedDashboard('dashboard with bad filters'); await PageObjects.dashboard.loadSavedDashboard('dashboard with bad filters');

View file

@ -22,6 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const renderable = getService('renderable'); const renderable = getService('renderable');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const filterBar = getService('filterBar'); const filterBar = getService('filterBar');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const security = getService('security'); const security = getService('security');
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
@ -53,7 +54,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
}; };
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']); await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']);
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
@ -65,7 +66,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after(async () => { after(async () => {
await security.testUser.restoreDefaults(); await security.testUser.restoreDefaults();
await kibanaServer.importExport.unload('dashboard/current/kibana');
}); });
describe('adding a filter that excludes all data', () => { describe('adding a filter that excludes all data', () => {

View file

@ -12,13 +12,14 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const browser = getService('browser'); const browser = getService('browser');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const PageObjects = getPageObjects(['common', 'dashboard']); const PageObjects = getPageObjects(['common', 'dashboard']);
describe('dashboard grid', function () { describe('dashboard grid', function () {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -28,8 +29,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.switchToEditMode(); await PageObjects.dashboard.switchToEditMode();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
describe('move panel', () => { describe('move panel', () => {
// Specific test after https://github.com/elastic/kibana/issues/14764 fix // Specific test after https://github.com/elastic/kibana/issues/14764 fix
it('Can move panel from bottom to top row', async () => { it('Can move panel from bottom to top row', async () => {

View file

@ -12,6 +12,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry'); const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'dashboard']); const PageObjects = getPageObjects(['common', 'dashboard']);
@ -19,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
let originalTitles: string[] = []; let originalTitles: string[] = [];
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -30,8 +31,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
originalTitles = await PageObjects.dashboard.getPanelTitles(); originalTitles = await PageObjects.dashboard.getPanelTitles();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('should be able to hide all panel titles', async () => { it('should be able to hide all panel titles', async () => {
await PageObjects.dashboard.checkHideTitle(); await PageObjects.dashboard.checkHideTitle();
await retry.try(async () => { await retry.try(async () => {

View file

@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('dashboard query bar', () => { describe('dashboard query bar', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -29,8 +29,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.loadSavedDashboard('dashboard with filter'); await PageObjects.dashboard.loadSavedDashboard('dashboard with filter');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('causes panels to reload when refresh is clicked', async () => { it('causes panels to reload when refresh is clicked', async () => {
await esArchiver.unload('dashboard/current/data'); await esArchiver.unload('dashboard/current/data');

View file

@ -11,6 +11,7 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context'; import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker']); const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker']);
const browser = getService('browser'); const browser = getService('browser');
@ -20,15 +21,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('dashboard saved queries', function describeIndexTests() { describe('dashboard saved queries', function describeIndexTests() {
before(async function () { before(async function () {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
await PageObjects.common.navigateToApp('dashboard'); await PageObjects.common.navigateToApp('dashboard');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
describe('saved query management component functionality', function () { describe('saved query management component functionality', function () {
before(async () => { before(async () => {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();

View file

@ -18,13 +18,14 @@ export default function ({
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'common', 'timePicker']); const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'common', 'timePicker']);
const screenshot = getService('screenshots'); const screenshot = getService('screenshots');
const browser = getService('browser'); const browser = getService('browser');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
describe('dashboard snapshots', function describeIndexTests() { describe('dashboard snapshots', function describeIndexTests() {
before(async function () { before(async function () {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -37,7 +38,6 @@ export default function ({
after(async function () { after(async function () {
await browser.setWindowSize(1300, 900); await browser.setWindowSize(1300, 900);
await kibanaServer.importExport.unload('dashboard/current/kibana');
}); });
it('compare TSVB snapshot', async () => { it('compare TSVB snapshot', async () => {

View file

@ -12,6 +12,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']); const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
@ -35,7 +36,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
}; };
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -43,8 +44,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.preserveCrossAppState(); await PageObjects.dashboard.preserveCrossAppState();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('lists unsaved changes to existing dashboards', async () => { it('lists unsaved changes to existing dashboards', async () => {
await PageObjects.dashboard.loadSavedDashboard(dashboardTitle); await PageObjects.dashboard.loadSavedDashboard(dashboardTitle);
await PageObjects.dashboard.switchToEditMode(); await PageObjects.dashboard.switchToEditMode();

View file

@ -12,6 +12,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']); const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
const esArchiver = getService('esArchiver');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
@ -22,7 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
// FLAKY: https://github.com/elastic/kibana/issues/91191 // FLAKY: https://github.com/elastic/kibana/issues/91191
describe.skip('dashboard unsaved panels', () => { describe.skip('dashboard unsaved panels', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -33,8 +34,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
originalPanelCount = await PageObjects.dashboard.getPanelCount(); originalPanelCount = await PageObjects.dashboard.getPanelCount();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('does not show unsaved changes badge when there are no unsaved changes', async () => { it('does not show unsaved changes badge when there are no unsaved changes', async () => {
await testSubjects.missingOrFail('dashboardUnsavedChangesBadge'); await testSubjects.missingOrFail('dashboardUnsavedChangesBadge');
}); });

View file

@ -12,6 +12,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry'); const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker']); const PageObjects = getPageObjects(['common', 'dashboard', 'timePicker']);
@ -20,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
let originalPanelTitles: string[]; let originalPanelTitles: string[];
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -30,8 +31,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.waitForRenderComplete(); await PageObjects.dashboard.waitForRenderComplete();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('should have time picker with data-shared-timefilter-duration', async () => { it('should have time picker with data-shared-timefilter-duration', async () => {
await retry.try(async () => { await retry.try(async () => {
const sharedData = await PageObjects.timePicker.getTimeDurationForSharing(); const sharedData = await PageObjects.timePicker.getTimeDurationForSharing();

View file

@ -12,13 +12,14 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']); const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
describe('edit embeddable redirects', () => { describe('edit embeddable redirects', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -28,8 +29,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.switchToEditMode(); await PageObjects.dashboard.switchToEditMode();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('redirects via save and return button after edit', async () => { it('redirects via save and return button after edit', async () => {
await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.openContextMenu();
await dashboardPanelActions.clickEdit(); await dashboardPanelActions.clickEdit();

View file

@ -10,6 +10,7 @@ import expect from '@kbn/expect';
export default function ({ getService, getPageObjects }) { export default function ({ getService, getPageObjects }) {
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'common', 'visEditor']); const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'common', 'visEditor']);
const esArchiver = getService('esArchiver');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu'); const appsMenu = getService('appsMenu');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
@ -43,15 +44,13 @@ export default function ({ getService, getPageObjects }) {
describe('edit visualizations from dashboard', () => { describe('edit visualizations from dashboard', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
await PageObjects.common.navigateToApp('dashboard'); await PageObjects.common.navigateToApp('dashboard');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('save button returns to dashboard after editing visualization with changes saved', async () => { it('save button returns to dashboard after editing visualization with changes saved', async () => {
const title = 'test save'; const title = 'test save';
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();

View file

@ -13,6 +13,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const retry = getService('retry'); const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['dashboard', 'common']); const PageObjects = getPageObjects(['dashboard', 'common']);
const browser = getService('browser'); const browser = getService('browser');
@ -27,7 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
]; ];
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -36,8 +37,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.loadSavedDashboard('few panels'); await PageObjects.dashboard.loadSavedDashboard('few panels');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('hides the chrome', async () => { it('hides the chrome', async () => {
const globalNavShown = await globalNav.exists(); const globalNavShown = await globalNav.exists();
expect(globalNavShown).to.be(true); expect(globalNavShown).to.be(true);

View file

@ -23,7 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before(async () => { before(async () => {
await esArchiver.loadIfNeeded('logstash_functional'); await esArchiver.loadIfNeeded('logstash_functional');
await esArchiver.loadIfNeeded('dashboard/current/data'); await esArchiver.loadIfNeeded('dashboard/current/data');
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.loadIfNeeded('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
'doc_table:legacy': false, 'doc_table:legacy': false,
@ -36,8 +36,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search'); await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('should expand the detail row when the toggle arrow is clicked', async function () { it('should expand the detail row when the toggle arrow is clicked', async function () {
await retry.try(async function () { await retry.try(async function () {
await dataGrid.clickRowToggle({ isAnchorRow: false, rowIndex: 0 }); await dataGrid.clickRowToggle({ isAnchorRow: false, rowIndex: 0 });

View file

@ -12,6 +12,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']); const PageObjects = getPageObjects(['dashboard', 'header', 'visualize', 'settings', 'common']);
const esArchiver = getService('esArchiver');
const find = getService('find'); const find = getService('find');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
@ -20,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('embeddable library', () => { describe('embeddable library', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -29,8 +30,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.clickNewDashboard(); await PageObjects.dashboard.clickNewDashboard();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('unlink visualize panel from embeddable library', async () => { it('unlink visualize panel from embeddable library', async () => {
// add heatmap panel from library // add heatmap panel from library
await dashboardAddPanel.clickOpenAddPanel(); await dashboardAddPanel.clickOpenAddPanel();

View file

@ -21,6 +21,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const find = getService('find'); const find = getService('find');
const browser = getService('browser'); const browser = getService('browser');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const pieChart = getService('pieChart'); const pieChart = getService('pieChart');
const security = getService('security'); const security = getService('security');
@ -93,7 +94,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe.skip('dashboard embeddable rendering', function describeIndexTests() { describe.skip('dashboard embeddable rendering', function describeIndexTests() {
before(async () => { before(async () => {
await security.testUser.setRoles(['kibana_admin', 'animals', 'test_logstash_reader']); await security.testUser.setRoles(['kibana_admin', 'animals', 'test_logstash_reader']);
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -112,7 +113,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const newUrl = currentUrl.replace(/\?.*$/, ''); const newUrl = currentUrl.replace(/\?.*$/, '');
await browser.get(newUrl, false); await browser.get(newUrl, false);
await security.testUser.restoreDefaults(); await security.testUser.restoreDefaults();
await kibanaServer.importExport.unload('dashboard/current/kibana');
}); });
it('adding visualizations', async () => { it('adding visualizations', async () => {

View file

@ -12,6 +12,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
const dashboardVisualizations = getService('dashboardVisualizations'); const dashboardVisualizations = getService('dashboardVisualizations');
@ -20,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('empty dashboard', () => { describe('empty dashboard', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -32,7 +33,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after(async () => { after(async () => {
await dashboardAddPanel.closeAddPanel(); await dashboardAddPanel.closeAddPanel();
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
await kibanaServer.importExport.unload('dashboard/current/kibana');
}); });
it('should display empty widget', async () => { it('should display empty widget', async () => {

View file

@ -12,6 +12,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry'); const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const PageObjects = getPageObjects(['dashboard', 'common']); const PageObjects = getPageObjects(['dashboard', 'common']);
@ -19,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('full screen mode', () => { describe('full screen mode', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -28,8 +29,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.loadSavedDashboard('few panels'); await PageObjects.dashboard.loadSavedDashboard('few panels');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('option not available in edit mode', async () => { it('option not available in edit mode', async () => {
await PageObjects.dashboard.switchToEditMode(); await PageObjects.dashboard.switchToEditMode();
const exists = await PageObjects.dashboard.fullScreenModeMenuItemExists(); const exists = await PageObjects.dashboard.fullScreenModeMenuItemExists();

View file

@ -23,7 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const log = getService('log'); const log = getService('log');
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
const listingTable = getService('listingTable'); const listingTable = getService('listingTable');
const kibanaServer = getService('kibanaServer'); const esArchiver = getService('esArchiver');
const security = getService('security'); const security = getService('security');
let kibanaLegacyBaseUrl: string; let kibanaLegacyBaseUrl: string;
@ -33,7 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('legacy urls', function describeIndexTests() { describe('legacy urls', function describeIndexTests() {
before(async function () { before(async function () {
await security.testUser.setRoles(['kibana_admin', 'animals']); await security.testUser.setRoles(['kibana_admin', 'animals']);
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await PageObjects.common.navigateToApp('dashboard'); await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.clickNewDashboard(); await PageObjects.dashboard.clickNewDashboard();
await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie'); await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie');
@ -53,7 +53,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
await listingTable.deleteItem('legacyTest', testDashboardId); await listingTable.deleteItem('legacyTest', testDashboardId);
await security.testUser.restoreDefaults(); await security.testUser.restoreDefaults();
await kibanaServer.importExport.unload('dashboard/current/kibana');
}); });
describe('kibana link redirect', () => { describe('kibana link redirect', () => {

View file

@ -13,13 +13,14 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry'); const retry = getService('retry');
const browser = getService('browser'); const browser = getService('browser');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardPanelActions = getService('dashboardPanelActions'); const dashboardPanelActions = getService('dashboardPanelActions');
const PageObjects = getPageObjects(['dashboard', 'visualize', 'header', 'common']); const PageObjects = getPageObjects(['dashboard', 'visualize', 'header', 'common']);
describe('expanding a panel', () => { describe('expanding a panel', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -28,8 +29,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.loadSavedDashboard('few panels'); await PageObjects.dashboard.loadSavedDashboard('few panels');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('hides other panels', async () => { it('hides other panels', async () => {
await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.openContextMenu();
await dashboardPanelActions.clickExpandPanelToggle(); await dashboardPanelActions.clickExpandPanelToggle();

View file

@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before(async () => { before(async () => {
await esArchiver.loadIfNeeded('logstash_functional'); await esArchiver.loadIfNeeded('logstash_functional');
await esArchiver.loadIfNeeded('dashboard/current/data'); await esArchiver.loadIfNeeded('dashboard/current/data');
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.loadIfNeeded('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -35,8 +35,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
); );
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('highlighting on filtering works', async function () { it('highlighting on filtering works', async function () {
await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search'); await dashboardAddPanel.addSavedSearch('Rendering-Test:-saved-search');
await filterBar.addFilter('agent', 'is', 'Mozilla'); await filterBar.addFilter('agent', 'is', 'Mozilla');

View file

@ -10,12 +10,13 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context'; import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['dashboard', 'common', 'share']); const PageObjects = getPageObjects(['dashboard', 'common', 'share']);
describe('share dashboard', () => { describe('share dashboard', () => {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -24,8 +25,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.loadSavedDashboard('few panels'); await PageObjects.dashboard.loadSavedDashboard('few panels');
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('has "panels" state when sharing a snapshot', async () => { it('has "panels" state when sharing a snapshot', async () => {
await PageObjects.share.clickShareTopNavButton(); await PageObjects.share.clickShareTopNavButton();
const sharedUrl = await PageObjects.share.getSharedUrl(); const sharedUrl = await PageObjects.share.getSharedUrl();

View file

@ -13,6 +13,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const pieChart = getService('pieChart'); const pieChart = getService('pieChart');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects([ const PageObjects = getPageObjects([
'dashboard', 'dashboard',
@ -26,7 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
this.tags('includeFirefox'); this.tags('includeFirefox');
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -43,7 +44,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after(async () => { after(async () => {
await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC' }); await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC' });
await kibanaServer.importExport.unload('dashboard/current/kibana');
}); });
it('Exported dashboard adjusts EST time to UTC', async () => { it('Exported dashboard adjusts EST time to UTC', async () => {

View file

@ -18,6 +18,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'timePicker', 'timePicker',
'visChart', 'visChart',
]); ]);
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
const browser = getService('browser'); const browser = getService('browser');
@ -38,7 +39,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
// FLAKY: https://github.com/elastic/kibana/issues/79463 // FLAKY: https://github.com/elastic/kibana/issues/79463
describe.skip('Changing field formatter to Url', () => { describe.skip('Changing field formatter to Url', () => {
before(async function () { before(async function () {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -51,8 +52,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await settings.controlChangeSave(); await settings.controlChangeSave();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('applied on dashboard', async () => { it('applied on dashboard', async () => {
await common.navigateToApp('dashboard'); await common.navigateToApp('dashboard');
await dashboard.loadSavedDashboard('dashboard with everything'); await dashboard.loadSavedDashboard('dashboard with everything');

View file

@ -12,6 +12,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const queryBar = getService('queryBar'); const queryBar = getService('queryBar');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const dashboardAddPanel = getService('dashboardAddPanel'); const dashboardAddPanel = getService('dashboardAddPanel');
const testSubjects = getService('testSubjects'); const testSubjects = getService('testSubjects');
@ -21,7 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('dashboard view edit mode', function viewEditModeTests() { describe('dashboard view edit mode', function viewEditModeTests() {
before(async () => { before(async () => {
await kibanaServer.importExport.load('dashboard/current/kibana'); await esArchiver.load('dashboard/current/kibana');
await kibanaServer.uiSettings.replace({ await kibanaServer.uiSettings.replace({
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
}); });
@ -29,8 +30,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.preserveCrossAppState(); await PageObjects.dashboard.preserveCrossAppState();
}); });
after(() => kibanaServer.importExport.unload('dashboard/current/kibana'));
it('create new dashboard opens in edit mode', async function () { it('create new dashboard opens in edit mode', async function () {
await PageObjects.dashboard.gotoDashboardLandingPage(); await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.clickNewDashboard(); await PageObjects.dashboard.clickNewDashboard();

View file

@ -11,7 +11,6 @@ import expect from '@kbn/expect';
export default function ({ getService, getPageObjects }) { export default function ({ getService, getPageObjects }) {
const browser = getService('browser'); const browser = getService('browser');
const globalNav = getService('globalNav'); const globalNav = getService('globalNav');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['common', 'header', 'home']); const PageObjects = getPageObjects(['common', 'header', 'home']);
describe('Kibana takes you home', function describeIndexTests() { describe('Kibana takes you home', function describeIndexTests() {
@ -26,8 +25,7 @@ export default function ({ getService, getPageObjects }) {
}); });
it('clicking on console on homepage should take you to console app', async () => { it('clicking on console on homepage should take you to console app', async () => {
await PageObjects.common.navigateToUrl('home'); await PageObjects.home.clickSynopsis('console');
await testSubjects.click('homeDevTools');
const url = await browser.getCurrentUrl(); const url = await browser.getCurrentUrl();
expect(url.includes('/app/dev_tools#/console')).to.be(true); expect(url.includes('/app/dev_tools#/console')).to.be(true);
}); });

View file

@ -11,6 +11,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService, getPageObjects }: FtrProviderContext) { export default function ({ getService, getPageObjects }: FtrProviderContext) {
const globalNav = getService('globalNav'); const globalNav = getService('globalNav');
const deployment = getService('deployment');
const PageObjects = getPageObjects(['newsfeed']); const PageObjects = getPageObjects(['newsfeed']);
describe('Newsfeed', () => { describe('Newsfeed', () => {
@ -37,9 +38,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('shows all news from newsfeed', async () => { it('shows all news from newsfeed', async () => {
const objects = await PageObjects.newsfeed.getNewsfeedList(); const objects = await PageObjects.newsfeed.getNewsfeedList();
if (await deployment.isOss()) {
expect(objects).to.eql([
'21 June 2019\nYou are functionally testing the newsfeed widget with fixtures!\nSee test/common/fixtures/plugins/newsfeed/newsfeed_simulation\nGeneric feed-viewer could go here',
'21 June 2019\nStaging too!\nHello world\nGeneric feed-viewer could go here',
]);
} else {
// can't shim the API in cloud so going to check that at least something is rendered // can't shim the API in cloud so going to check that at least something is rendered
// to test that the API was called and returned something that could be rendered // to test that the API was called and returned something that could be rendered
expect(objects.length).to.be.above(0); expect(objects.length).to.be.above(0);
}
}); });
it('clicking on newsfeed icon should close opened newsfeed', async () => { it('clicking on newsfeed icon should close opened newsfeed', async () => {

View file

@ -27,6 +27,7 @@ import expect from '@kbn/expect';
export default function ({ getService, getPageObjects }) { export default function ({ getService, getPageObjects }) {
const esArchiver = getService('esArchiver'); const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const deployment = getService('deployment');
const log = getService('log'); const log = getService('log');
const browser = getService('browser'); const browser = getService('browser');
const retry = getService('retry'); const retry = getService('retry');
@ -186,14 +187,16 @@ export default function ({ getService, getPageObjects }) {
}); });
it('should visualize scripted field in vertical bar chart', async function () { it('should visualize scripted field in vertical bar chart', async function () {
const isOss = await deployment.isOss();
if (!isOss) {
await filterBar.removeAllFilters(); await filterBar.removeAllFilters();
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName); await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName);
await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization // verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain( expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'@timestamp', 'Average of ram_Pain1'
'Median of ram_Pain1'
); );
}
}); });
}); });
@ -274,12 +277,15 @@ export default function ({ getService, getPageObjects }) {
}); });
it('should visualize scripted field in vertical bar chart', async function () { it('should visualize scripted field in vertical bar chart', async function () {
const isOss = await deployment.isOss();
if (!isOss) {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2); await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization // verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain( expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Top values of painString' 'Top values of painString'
); );
}
}); });
}); });
@ -361,12 +367,15 @@ export default function ({ getService, getPageObjects }) {
}); });
it('should visualize scripted field in vertical bar chart', async function () { it('should visualize scripted field in vertical bar chart', async function () {
const isOss = await deployment.isOss();
if (!isOss) {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2); await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization // verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain( expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'Top values of painBool' 'Top values of painBool'
); );
}
}); });
}); });
@ -451,10 +460,15 @@ export default function ({ getService, getPageObjects }) {
}); });
it('should visualize scripted field in vertical bar chart', async function () { it('should visualize scripted field in vertical bar chart', async function () {
const isOss = await deployment.isOss();
if (!isOss) {
await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2); await PageObjects.discover.clickFieldListItemVisualize(scriptedPainlessFieldName2);
await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.header.waitUntilLoadingHasFinished();
// verify Lens opens a visualization // verify Lens opens a visualization
expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain('painDate'); expect(await testSubjects.getVisibleTextAll('lns-dimensionTrigger')).to.contain(
'painDate'
);
}
}); });
}); });
}); });

View file

@ -35,7 +35,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.visualize.clickAggBasedVisualizations(); await PageObjects.visualize.clickAggBasedVisualizations();
const expectedChartTypes = [ const expectedChartTypes = [
'Area', 'Area',
'Coordinate Map',
'Data table', 'Data table',
'Gauge', 'Gauge',
'Goal', 'Goal',
@ -44,7 +43,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'Line', 'Line',
'Metric', 'Metric',
'Pie', 'Pie',
'Region Map',
'Tag cloud', 'Tag cloud',
'Timelion', 'Timelion',
'Vertical bar', 'Vertical bar',

View file

@ -125,26 +125,26 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('Fit data bounds should zoom to level 3', async function () { it('Fit data bounds should zoom to level 3', async function () {
const expectedPrecision2DataTable = [ const expectedPrecision2DataTable = [
['-', 'dn', '1,429', { lat: 36, lon: -85 }], ['-', 'dr4', '127', { lat: 40, lon: -76 }],
['-', 'dp', '1,418', { lat: 41, lon: -85 }], ['-', 'dr7', '92', { lat: 41, lon: -74 }],
['-', '9y', '1,215', { lat: 36, lon: -96 }], ['-', '9q5', '91', { lat: 34, lon: -119 }],
['-', '9z', '1,099', { lat: 42, lon: -96 }], ['-', '9qc', '89', { lat: 38, lon: -122 }],
['-', 'dr', '1,076', { lat: 42, lon: -74 }], ['-', 'drk', '87', { lat: 41, lon: -73 }],
['-', 'dj', '982', { lat: 31, lon: -85 }], ['-', 'dps', '82', { lat: 42, lon: -84 }],
['-', '9v', '938', { lat: 31, lon: -96 }], ['-', 'dph', '82', { lat: 40, lon: -84 }],
['-', '9q', '722', { lat: 36, lon: -120 }], ['-', 'dp3', '79', { lat: 41, lon: -88 }],
['-', '9w', '475', { lat: 36, lon: -107 }], ['-', 'dpe', '78', { lat: 42, lon: -86 }],
['-', 'cb', '457', { lat: 46, lon: -96 }], ['-', 'dp8', '77', { lat: 43, lon: -90 }],
['-', 'c2', '453', { lat: 47, lon: -120 }], ['-', 'dp6', '74', { lat: 41, lon: -87 }],
['-', '9x', '420', { lat: 41, lon: -107 }], ['-', 'djv', '74', { lat: 33, lon: -83 }],
['-', 'dq', '399', { lat: 37, lon: -78 }], ['-', '9qh', '74', { lat: 34, lon: -118 }],
['-', '9r', '396', { lat: 41, lon: -120 }], ['-', 'dpq', '73', { lat: 41, lon: -81 }],
['-', '9t', '274', { lat: 32, lon: -107 }], ['-', 'dpp', '73', { lat: 40, lon: -80 }],
['-', 'c8', '271', { lat: 47, lon: -107 }], ['-', '9y7', '73', { lat: 35, lon: -97 }],
['-', 'dh', '214', { lat: 26, lon: -82 }], ['-', '9vg', '73', { lat: 32, lon: -97 }],
['-', 'b6', '207', { lat: 60, lon: -162 }], ['-', 'drs', '71', { lat: 42, lon: -73 }],
['-', 'bd', '206', { lat: 59, lon: -153 }], ['-', '9ys', '71', { lat: 37, lon: -95 }],
['-', 'b7', '167', { lat: 64, lon: -163 }], ['-', '9yn', '71', { lat: 34, lon: -93 }],
]; ];
await PageObjects.tileMap.clickMapFitDataBounds(); await PageObjects.tileMap.clickMapFitDataBounds();

View file

@ -14,6 +14,8 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
const log = getService('log'); const log = getService('log');
const esArchiver = getService('esArchiver'); const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer'); const kibanaServer = getService('kibanaServer');
const deployment = getService('deployment');
let isOss = true;
describe('visualize app', () => { describe('visualize app', () => {
before(async () => { before(async () => {
@ -26,6 +28,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
defaultIndex: 'logstash-*', defaultIndex: 'logstash-*',
[UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b', [UI_SETTINGS.FORMAT_BYTES_DEFAULT_PATTERN]: '0,0.[000]b',
}); });
isOss = await deployment.isOss();
}); });
// TODO: Remove when vislib is removed // TODO: Remove when vislib is removed
@ -63,7 +66,11 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_data_table')); loadTestFile(require.resolve('./_data_table'));
loadTestFile(require.resolve('./_data_table_nontimeindex')); loadTestFile(require.resolve('./_data_table_nontimeindex'));
loadTestFile(require.resolve('./_data_table_notimeindex_filters')); loadTestFile(require.resolve('./_data_table_notimeindex_filters'));
// this check is not needed when the CI doesn't run anymore for the OSS
if (!isOss) {
loadTestFile(require.resolve('./_chart_types')); loadTestFile(require.resolve('./_chart_types'));
}
}); });
describe('', function () { describe('', function () {
@ -91,8 +98,11 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_linked_saved_searches')); loadTestFile(require.resolve('./_linked_saved_searches'));
loadTestFile(require.resolve('./_visualize_listing')); loadTestFile(require.resolve('./_visualize_listing'));
loadTestFile(require.resolve('./_add_to_dashboard.ts')); loadTestFile(require.resolve('./_add_to_dashboard.ts'));
if (isOss) {
loadTestFile(require.resolve('./_tile_map')); loadTestFile(require.resolve('./_tile_map'));
loadTestFile(require.resolve('./_region_map')); loadTestFile(require.resolve('./_region_map'));
}
}); });
describe('', function () { describe('', function () {

View file

@ -14,7 +14,6 @@ export default async function ({ readConfigFile }) {
return { return {
testFiles: [ testFiles: [
require.resolve('./apps/status_page'),
require.resolve('./apps/bundles'), require.resolve('./apps/bundles'),
require.resolve('./apps/console'), require.resolve('./apps/console'),
require.resolve('./apps/context'), require.resolve('./apps/context'),
@ -24,6 +23,7 @@ export default async function ({ readConfigFile }) {
require.resolve('./apps/home'), require.resolve('./apps/home'),
require.resolve('./apps/management'), require.resolve('./apps/management'),
require.resolve('./apps/saved_objects_management'), require.resolve('./apps/saved_objects_management'),
require.resolve('./apps/status_page'),
require.resolve('./apps/timelion'), require.resolve('./apps/timelion'),
require.resolve('./apps/visualize'), require.resolve('./apps/visualize'),
], ],
@ -36,15 +36,13 @@ export default async function ({ readConfigFile }) {
...commonConfig.get('esTestCluster'), ...commonConfig.get('esTestCluster'),
serverArgs: ['xpack.security.enabled=false'], serverArgs: ['xpack.security.enabled=false'],
}, },
kbnTestServer: { kbnTestServer: {
...commonConfig.get('kbnTestServer'), ...commonConfig.get('kbnTestServer'),
serverArgs: [ serverArgs: [
...commonConfig.get('kbnTestServer.serverArgs'), ...commonConfig.get('kbnTestServer.serverArgs'),
'--oss',
'--telemetry.optIn=false', '--telemetry.optIn=false',
'--xpack.security.enabled=false',
'--savedObjects.maxImportPayloadBytes=10485760', '--savedObjects.maxImportPayloadBytes=10485760',
'--xpack.maps.showMapVisualizationTypes=true',
], ],
}, },

View file

@ -0,0 +1,490 @@
{
"type": "index",
"value": {
"aliases": {
".kibana": {
}
},
"index": ".kibana_1",
"mappings": {
"_meta": {
"migrationMappingPropertyHashes": {
"application_usage_totals": "c897e4310c5f24b07caaff3db53ae2c1",
"application_usage_transactional": "965839e75f809fefe04f92dc4d99722a",
"config": "ae24d22d5986d04124cc6568f771066f",
"dashboard": "d00f614b29a80360e1190193fd333bab",
"index-pattern": "66eccb05066c5a89924f48a9e9736499",
"kql-telemetry": "d12a98a6f19a2d273696597547e064ee",
"migrationVersion": "4a1746014a75ade3a714e1db5763276f",
"namespace": "2f4316de49999235636386fe51dc06c1",
"namespaces": "2f4316de49999235636386fe51dc06c1",
"query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9",
"references": "7997cf5a56cc02bdc9c93361bde732b0",
"sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4",
"search": "181661168bbadd1eff5902361e2a0d5c",
"telemetry": "36a616f7026dfa617d6655df850fe16d",
"timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf",
"tsvb-validation-telemetry": "3a37ef6c8700ae6fc97d5c7da00e9215",
"type": "2f4316de49999235636386fe51dc06c1",
"ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3",
"updated_at": "00da57df13e94e9d98437d13ace4bfe0",
"url": "b675c3be8d76ecf029294d51dc7ec65d",
"visualization": "52d7a13ad68a150c4525b292d23e12cc"
}
},
"dynamic": "strict",
"properties": {
"application_usage_totals": {
"properties": {
"appId": {
"type": "keyword"
},
"minutesOnScreen": {
"type": "float"
},
"numberOfClicks": {
"type": "long"
}
}
},
"application_usage_transactional": {
"properties": {
"appId": {
"type": "keyword"
},
"minutesOnScreen": {
"type": "float"
},
"numberOfClicks": {
"type": "long"
},
"timestamp": {
"type": "date"
}
}
},
"config": {
"dynamic": "true",
"properties": {
"accessibility:disableAnimations": {
"type": "boolean"
},
"buildNum": {
"type": "keyword"
},
"dateFormat:tz": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"defaultIndex": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"notifications:lifetime:banner": {
"type": "long"
},
"notifications:lifetime:error": {
"type": "long"
},
"notifications:lifetime:info": {
"type": "long"
},
"notifications:lifetime:warning": {
"type": "long"
},
"xPackMonitoring:showBanner": {
"type": "boolean"
}
}
},
"dashboard": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
},
"type": {
"type": "keyword"
},
"typeMeta": {
"type": "keyword"
}
}
},
"kql-telemetry": {
"properties": {
"optInCount": {
"type": "long"
},
"optOutCount": {
"type": "long"
}
}
},
"migrationVersion": {
"dynamic": "true",
"properties": {
"dashboard": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"index-pattern": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"search": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"visualization": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"namespace": {
"type": "keyword"
},
"namespaces": {
"type": "keyword"
},
"query": {
"properties": {
"description": {
"type": "text"
},
"filters": {
"enabled": false,
"type": "object"
},
"query": {
"properties": {
"language": {
"type": "keyword"
},
"query": {
"index": false,
"type": "keyword"
}
}
},
"timefilter": {
"enabled": false,
"type": "object"
},
"title": {
"type": "text"
}
}
},
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
},
"sample-data-telemetry": {
"properties": {
"installCount": {
"type": "long"
},
"unInstallCount": {
"type": "long"
}
}
},
"search": {
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"telemetry": {
"properties": {
"allowChangingOptInStatus": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
"lastReported": {
"type": "date"
},
"lastVersionChecked": {
"type": "keyword"
},
"reportFailureCount": {
"type": "integer"
},
"reportFailureVersion": {
"type": "keyword"
},
"sendUsageFrom": {
"type": "keyword"
},
"userHasSeenNotice": {
"type": "boolean"
}
}
},
"timelion-sheet": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"tsvb-validation-telemetry": {
"properties": {
"failedRequests": {
"type": "long"
}
}
},
"type": {
"type": "keyword"
},
"ui-metric": {
"properties": {
"count": {
"type": "integer"
}
}
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"fields": {
"keyword": {
"type": "keyword"
}
},
"type": "text"
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchRefName": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
}
}
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}

View file

@ -0,0 +1,141 @@
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "test-export-transform:type_1-obj_1",
"source": {
"test-export-transform": {
"title": "test_1-obj_1",
"enabled": true
},
"type": "test-export-transform",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z"
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "test-export-transform:type_1-obj_2",
"source": {
"test-export-transform": {
"title": "test_1-obj_2",
"enabled": true
},
"type": "test-export-transform",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z"
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "test-export-add:type_2-obj_1",
"source": {
"test-export-add": {
"title": "test_2-obj_1"
},
"type": "test-export-add",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z"
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "test-export-add:type_2-obj_2",
"source": {
"test-export-add": {
"title": "test_2-obj_2"
},
"type": "test-export-add",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z"
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "test-export-add-dep:type_dep-obj_1",
"source": {
"test-export-add-dep": {
"title": "type_dep-obj_1"
},
"type": "test-export-add-dep",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z",
"references": [
{
"type": "test-export-add",
"id": "type_2-obj_1"
}
]
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "test-export-add-dep:type_dep-obj_2",
"source": {
"test-export-add-dep": {
"title": "type_dep-obj_2"
},
"type": "test-export-add-dep",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z",
"references": [
{
"type": "test-export-add",
"id": "type_2-obj_2"
}
]
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "test-export-invalid-transform:type_3-obj_1",
"source": {
"test-export-invalid-transform": {
"title": "test_2-obj_1"
},
"type": "test-export-invalid-transform",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z"
}
}
}
{
"type": "doc",
"value": {
"index": ".kibana",
"id": "test-export-transform-error:type_4-obj_1",
"source": {
"test-export-transform-error": {
"title": "test_2-obj_1"
},
"type": "test-export-transform-error",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z"
}
}
}

View file

@ -0,0 +1,499 @@
{
"type": "index",
"value": {
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "1",
"auto_expand_replicas": "0-1",
"number_of_replicas": "0"
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"test-export-transform": {
"properties": {
"title": { "type": "text" },
"enabled": { "type": "boolean" }
}
},
"test-export-add": {
"properties": {
"title": { "type": "text" }
}
},
"test-export-add-dep": {
"properties": {
"title": { "type": "text" }
}
},
"test-export-transform-error": {
"properties": {
"title": { "type": "text" }
}
},
"test-export-invalid-transform": {
"properties": {
"title": { "type": "text" }
}
},
"apm-telemetry": {
"properties": {
"has_any_services": {
"type": "boolean"
},
"services_per_agent": {
"properties": {
"go": {
"type": "long",
"null_value": 0
},
"java": {
"type": "long",
"null_value": 0
},
"js-base": {
"type": "long",
"null_value": 0
},
"nodejs": {
"type": "long",
"null_value": 0
},
"python": {
"type": "long",
"null_value": 0
},
"ruby": {
"type": "long",
"null_value": 0
}
}
}
}
},
"canvas-workpad": {
"dynamic": "false",
"properties": {
"@created": {
"type": "date"
},
"@timestamp": {
"type": "date"
},
"id": {
"type": "text",
"index": false
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
},
"config": {
"dynamic": "true",
"properties": {
"accessibility:disableAnimations": {
"type": "boolean"
},
"buildNum": {
"type": "keyword"
},
"dateFormat:tz": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"defaultIndex": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"telemetry:optIn": {
"type": "boolean"
}
}
},
"dashboard": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"map": {
"properties": {
"bounds": {
"type": "geo_shape",
"tree": "quadtree"
},
"description": {
"type": "text"
},
"layerListJSON": {
"type": "text"
},
"mapStateJSON": {
"type": "text"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"graph-workspace": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"numLinks": {
"type": "integer"
},
"numVertices": {
"type": "integer"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
},
"wsState": {
"type": "text"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
},
"type": {
"type": "keyword"
},
"typeMeta": {
"type": "keyword"
}
}
},
"kql-telemetry": {
"properties": {
"optInCount": {
"type": "long"
},
"optOutCount": {
"type": "long"
}
}
},
"migrationVersion": {
"dynamic": "true",
"properties": {
"index-pattern": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"space": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"namespace": {
"type": "keyword"
},
"search": {
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"space": {
"properties": {
"_reserved": {
"type": "boolean"
},
"color": {
"type": "keyword"
},
"description": {
"type": "text"
},
"disabledFeatures": {
"type": "keyword"
},
"initials": {
"type": "keyword"
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"spaceId": {
"type": "keyword"
},
"telemetry": {
"properties": {
"enabled": {
"type": "boolean"
}
}
},
"timelion-sheet": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"type": {
"type": "keyword"
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
},
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
}
}
}
}
}

View file

@ -1,42 +1,42 @@
{ {
"attributes": { "type": "doc",
"timeFieldName": "@timestamp", "value": {
"title": "logstash-*" "index": ".kibana",
}, "id": "test-actions-export-hidden:obj_1",
"coreMigrationVersion": "7.14.0", "source": {
"id": "logstash-*", "test-actions-export-hidden": {
"migrationVersion": {
"index-pattern": "7.11.0"
},
"references": [],
"type": "index-pattern",
"updated_at": "2017-09-21T18:49:16.270Z",
"version": "WzgsMl0="
}
{
"id": "obj_1",
"attributes": {
"title": "hidden object 1" "title": "hidden object 1"
}, },
"references": [],
"type": "test-actions-export-hidden", "type": "test-actions-export-hidden",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z" "updated_at": "2018-12-21T00:43:07.096Z"
} }
}
}
{ {
"id": "obj_2", "type": "doc",
"attributes": { "value": {
"index": ".kibana",
"id": "test-actions-export-hidden:obj_2",
"source": {
"test-actions-export-hidden": {
"title": "hidden object 2" "title": "hidden object 2"
}, },
"references": [],
"type": "test-actions-export-hidden", "type": "test-actions-export-hidden",
"migrationVersion": {},
"updated_at": "2018-12-21T00:43:07.096Z" "updated_at": "2018-12-21T00:43:07.096Z"
} }
}
}
{ {
"id": "75c3e060-1e7c-11e9-8488-65449e65d0ed", "type": "doc",
"attributes": { "value": {
"index": ".kibana",
"id": "visualization:75c3e060-1e7c-11e9-8488-65449e65d0ed",
"source": {
"visualization": {
"title": "A Pie", "title": "A Pie",
"visState": "{\"title\":\"A Pie\",\"type\":\"pie\",\"params\":{\"type\":\"pie\",\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":true,\"labels\":{\"show\":false,\"values\":true,\"last_level\":true,\"truncate\":100},\"dimensions\":{\"metric\":{\"accessor\":0,\"format\":{\"id\":\"number\"},\"params\":{},\"aggType\":\"count\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"geo.src\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\"}}]}", "visState": "{\"title\":\"A Pie\",\"type\":\"pie\",\"params\":{\"type\":\"pie\",\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"isDonut\":true,\"labels\":{\"show\":false,\"values\":true,\"last_level\":true,\"truncate\":100},\"dimensions\":{\"metric\":{\"accessor\":0,\"format\":{\"id\":\"number\"},\"params\":{},\"aggType\":\"count\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"geo.src\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\"}}]}",
"uiStateJSON": "{}", "uiStateJSON": "{}",
@ -46,20 +46,26 @@
"searchSourceJSON": "{\"index\":\"logstash-*\",\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}" "searchSourceJSON": "{\"index\":\"logstash-*\",\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}"
} }
}, },
"type": "visualization",
"updated_at": "2019-01-22T19:32:31.206Z"
},
"references" : [ "references" : [
{ {
"name" : "kibanaSavedObjectMeta.searchSourceJSON.index", "name" : "kibanaSavedObjectMeta.searchSourceJSON.index",
"type" : "index-pattern", "type" : "index-pattern",
"id" : "logstash-*" "id" : "logstash-*"
} }
], ]
"type": "visualization", }
"updated_at": "2019-01-22T19:32:31.206Z"
} }
{ {
"id": "i-exist", "type": "doc",
"attributes": { "value": {
"index": ".kibana",
"id": "dashboard:i-exist",
"source": {
"dashboard": {
"title": "A Dashboard", "title": "A Dashboard",
"hits": 0, "hits": 0,
"description": "", "description": "",
@ -71,7 +77,8 @@
"searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}" "searchSourceJSON": "{\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"filter\":[]}"
} }
}, },
"references": [],
"type": "dashboard", "type": "dashboard",
"updated_at": "2019-01-22T19:32:47.232Z" "updated_at": "2019-01-22T19:32:47.232Z"
} }
}
}

View file

@ -0,0 +1,518 @@
{
"type": "index",
"value": {
"index": ".kibana",
"settings": {
"index": {
"number_of_shards": "1",
"auto_expand_replicas": "0-1",
"number_of_replicas": "0"
}
},
"mappings": {
"dynamic": "strict",
"properties": {
"test-actions-export-hidden": {
"properties": {
"title": { "type": "text" }
}
},
"test-export-transform": {
"properties": {
"title": { "type": "text" },
"enabled": { "type": "boolean" }
}
},
"test-export-add": {
"properties": {
"title": { "type": "text" }
}
},
"test-export-add-dep": {
"properties": {
"title": { "type": "text" }
}
},
"test-export-transform-error": {
"properties": {
"title": { "type": "text" }
}
},
"test-export-invalid-transform": {
"properties": {
"title": { "type": "text" }
}
},
"apm-telemetry": {
"properties": {
"has_any_services": {
"type": "boolean"
},
"services_per_agent": {
"properties": {
"go": {
"type": "long",
"null_value": 0
},
"java": {
"type": "long",
"null_value": 0
},
"js-base": {
"type": "long",
"null_value": 0
},
"nodejs": {
"type": "long",
"null_value": 0
},
"python": {
"type": "long",
"null_value": 0
},
"ruby": {
"type": "long",
"null_value": 0
}
}
}
}
},
"canvas-workpad": {
"dynamic": "false",
"properties": {
"@created": {
"type": "date"
},
"@timestamp": {
"type": "date"
},
"id": {
"type": "text",
"index": false
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
},
"config": {
"dynamic": "true",
"properties": {
"accessibility:disableAnimations": {
"type": "boolean"
},
"buildNum": {
"type": "keyword"
},
"dateFormat:tz": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"defaultIndex": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"telemetry:optIn": {
"type": "boolean"
}
}
},
"dashboard": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"optionsJSON": {
"type": "text"
},
"panelsJSON": {
"type": "text"
},
"refreshInterval": {
"properties": {
"display": {
"type": "keyword"
},
"pause": {
"type": "boolean"
},
"section": {
"type": "integer"
},
"value": {
"type": "integer"
}
}
},
"timeFrom": {
"type": "keyword"
},
"timeRestore": {
"type": "boolean"
},
"timeTo": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"map": {
"properties": {
"bounds": {
"type": "geo_shape",
"tree": "quadtree"
},
"description": {
"type": "text"
},
"layerListJSON": {
"type": "text"
},
"mapStateJSON": {
"type": "text"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"graph-workspace": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"numLinks": {
"type": "integer"
},
"numVertices": {
"type": "integer"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
},
"wsState": {
"type": "text"
}
}
},
"index-pattern": {
"properties": {
"fieldFormatMap": {
"type": "text"
},
"fields": {
"type": "text"
},
"intervalName": {
"type": "keyword"
},
"notExpandable": {
"type": "boolean"
},
"sourceFilters": {
"type": "text"
},
"timeFieldName": {
"type": "keyword"
},
"title": {
"type": "text"
},
"type": {
"type": "keyword"
},
"typeMeta": {
"type": "keyword"
}
}
},
"kql-telemetry": {
"properties": {
"optInCount": {
"type": "long"
},
"optOutCount": {
"type": "long"
}
}
},
"migrationVersion": {
"dynamic": "true",
"properties": {
"index-pattern": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"space": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"namespace": {
"type": "keyword"
},
"search": {
"properties": {
"columns": {
"type": "keyword"
},
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"sort": {
"type": "keyword"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"server": {
"properties": {
"uuid": {
"type": "keyword"
}
}
},
"space": {
"properties": {
"_reserved": {
"type": "boolean"
},
"color": {
"type": "keyword"
},
"description": {
"type": "text"
},
"disabledFeatures": {
"type": "keyword"
},
"initials": {
"type": "keyword"
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"spaceId": {
"type": "keyword"
},
"telemetry": {
"properties": {
"enabled": {
"type": "boolean"
}
}
},
"timelion-sheet": {
"properties": {
"description": {
"type": "text"
},
"hits": {
"type": "integer"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"timelion_chart_height": {
"type": "integer"
},
"timelion_columns": {
"type": "integer"
},
"timelion_interval": {
"type": "keyword"
},
"timelion_other_interval": {
"type": "keyword"
},
"timelion_rows": {
"type": "integer"
},
"timelion_sheet": {
"type": "text"
},
"title": {
"type": "text"
},
"version": {
"type": "integer"
}
}
},
"type": {
"type": "keyword"
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 2048
}
}
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"type": "text"
}
}
},
"savedSearchId": {
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"type": "text"
}
}
},
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
},
"test-hidden-non-importable-exportable": {
"properties": {
"title": {
"type": "text"
}
}
},
"test-hidden-importable-exportable": {
"properties": {
"title": {
"type": "text"
}
}
}
}
}
}
}

File diff suppressed because one or more lines are too long

View file

@ -1,91 +0,0 @@
{
"id": "type_1-obj_1",
"attributes": {
"title": "test_1-obj_1",
"enabled": true
},
"references": [],
"type": "test-export-transform",
"updated_at": "2018-12-21T00:43:07.096Z"
}
{
"id": "type_1-obj_2",
"attributes": {
"title": "test_1-obj_2",
"enabled": true
},
"references": [],
"type": "test-export-transform",
"updated_at": "2018-12-21T00:43:07.096Z"
}
{
"id": "type_2-obj_1",
"attributes": {
"title": "test_2-obj_1"
},
"references": [],
"type": "test-export-add",
"updated_at": "2018-12-21T00:43:07.096Z"
}
{
"id": "type_2-obj_2",
"attributes": {
"title": "test_2-obj_2"
},
"references": [],
"type": "test-export-add",
"updated_at": "2018-12-21T00:43:07.096Z"
}
{
"id": "type_dep-obj_1",
"attributes": {
"title": "type_dep-obj_1"
},
"references": [
{
"id": "type_2-obj_1",
"type": "test-export-add"
}
],
"type": "test-export-add-dep",
"updated_at": "2018-12-21T00:43:07.096Z"
}
{
"id": "type_dep-obj_2",
"attributes": {
"title": "type_dep-obj_2"
},
"references": [
{
"id": "type_2-obj_2",
"type": "test-export-add"
}
],
"type": "test-export-add-dep",
"updated_at": "2018-12-21T00:43:07.096Z"
}
{
"id": "type_3-obj_1",
"attributes": {
"title": "test_2-obj_1"
},
"references": [],
"type": "test-export-invalid-transform",
"updated_at": "2018-12-21T00:43:07.096Z"
}
{
"id": "type_4-obj_1",
"attributes": {
"title": "test_2-obj_1"
},
"references": [],
"type": "test-export-transform-error",
"updated_at": "2018-12-21T00:43:07.096Z"
}

Some files were not shown because too many files have changed in this diff Show more