mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* [esArchiver] drop support for --dir, use repo-relative paths instead (#101345) Co-authored-by: spalger <spalger@users.noreply.github.com> # Conflicts: # test/api_integration/apis/suggestions/suggestions.js # test/functional/apps/discover/_large_string.ts # test/functional/apps/visualize/index.ts # x-pack/test/functional/apps/infra/feature_controls/logs_security.ts # x-pack/test/functional/apps/saved_objects_management/import_saved_objects_between_versions_6.x_7.x.ts # x-pack/test/functional/apps/upgrade_assistant/upgrade_assistant.ts * convert references to `saved_objects/basic` archive * adapt other `saved_objects/*` archives * update management/saved_obejcts/relationships archives * replace old monitoring setup() usage * remove reference to `empty_kibana` archive Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
parent
81d67b3df9
commit
bcdeccb39b
729 changed files with 2608 additions and 1888 deletions
|
@ -229,9 +229,9 @@ export default function ({ getService, getPageObject }) {
|
|||
before(async () => {
|
||||
await Promise.all([
|
||||
// start with an empty .kibana index
|
||||
esArchiver.load('empty_kibana'),
|
||||
esArchiver.load('test/functional/fixtures/es_archiver/empty_kibana'),
|
||||
// load some basic log data only if the index doesn't exist
|
||||
esArchiver.loadIfNeeded('makelogs')
|
||||
esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/makelogs')
|
||||
]);
|
||||
// go to the page described by `apps.visualize` in the config
|
||||
await PageObjects.common.navigateTo('visualize');
|
||||
|
@ -243,7 +243,7 @@ export default function ({ getService, getPageObject }) {
|
|||
// we unload the empty_kibana archive but not the makelogs
|
||||
// archive because we don't make any changes to it, and subsequent
|
||||
// suites could use it if they call `.loadIfNeeded()`.
|
||||
await esArchiver.unload('empty_kibana');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/empty_kibana');
|
||||
});
|
||||
|
||||
// This series of tests illustrate how tests generally verify
|
||||
|
@ -370,9 +370,9 @@ await testSubjects.click(‘containerButton’);
|
|||
* Source: link:{kib-repo}tree/{branch}/test/common/services/es_archiver.ts[test/common/services/es_archiver.ts]
|
||||
* Load/unload archives created with the `esArchiver`
|
||||
* Popular methods:
|
||||
** `esArchiver.load(name)`
|
||||
** `esArchiver.loadIfNeeded(name)`
|
||||
** `esArchiver.unload(name)`
|
||||
** `esArchiver.load(path)`
|
||||
** `esArchiver.loadIfNeeded(path)`
|
||||
** `esArchiver.unload(path)`
|
||||
|
||||
Full list of services that are used in functional tests can be found here: link:{kib-repo}tree/{branch}/test/functional/services[test/functional/services]
|
||||
|
||||
|
|
|
@ -58,11 +58,6 @@ export default async function ({ readConfigFile }) {
|
|||
}
|
||||
},
|
||||
|
||||
// choose where esArchiver should load archives from
|
||||
esArchiver: {
|
||||
directory: resolve(__dirname, './es_archives'),
|
||||
},
|
||||
|
||||
// choose where screenshots should be saved
|
||||
screenshots: {
|
||||
directory: resolve(__dirname, './tmp/screenshots'),
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { resolve, relative } from 'path';
|
||||
import { relative } from 'path';
|
||||
import Fs from 'fs';
|
||||
import { createGunzip, createGzip, Z_BEST_COMPRESSION } from 'zlib';
|
||||
import { createGunzip, createGzip, constants } from 'zlib';
|
||||
import { promisify } from 'util';
|
||||
import globby from 'globby';
|
||||
import { ToolingLog } from '@kbn/dev-utils';
|
||||
|
@ -17,24 +17,22 @@ import { createPromiseFromStreams } from '@kbn/utils';
|
|||
const unlinkAsync = promisify(Fs.unlink);
|
||||
|
||||
export async function editAction({
|
||||
prefix,
|
||||
dataDir,
|
||||
path,
|
||||
log,
|
||||
handler,
|
||||
}: {
|
||||
prefix: string;
|
||||
dataDir: string;
|
||||
path: string;
|
||||
log: ToolingLog;
|
||||
handler: () => Promise<any>;
|
||||
}) {
|
||||
const archives = (
|
||||
await globby('**/*.gz', {
|
||||
cwd: prefix ? resolve(dataDir, prefix) : dataDir,
|
||||
cwd: path,
|
||||
absolute: true,
|
||||
})
|
||||
).map((path) => ({
|
||||
path,
|
||||
rawPath: path.slice(0, -3),
|
||||
).map((found) => ({
|
||||
path: found,
|
||||
rawPath: found.slice(0, -3),
|
||||
}));
|
||||
|
||||
await Promise.all(
|
||||
|
@ -61,7 +59,7 @@ export async function editAction({
|
|||
archives.map(async (archive) => {
|
||||
await createPromiseFromStreams([
|
||||
Fs.createReadStream(archive.rawPath),
|
||||
createGzip({ level: Z_BEST_COMPRESSION }),
|
||||
createGzip({ level: constants.Z_BEST_COMPRESSION }),
|
||||
Fs.createWriteStream(archive.path),
|
||||
]);
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { resolve } from 'path';
|
||||
import { resolve, relative } from 'path';
|
||||
import { createReadStream } from 'fs';
|
||||
import { Readable } from 'stream';
|
||||
import { ToolingLog } from '@kbn/dev-utils';
|
||||
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
|
||||
import { KbnClient } from '@kbn/test';
|
||||
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
|
||||
import { createPromiseFromStreams, concatStreamProviders } from '@kbn/utils';
|
||||
|
@ -37,23 +37,21 @@ const pipeline = (...streams: Readable[]) =>
|
|||
);
|
||||
|
||||
export async function loadAction({
|
||||
name,
|
||||
inputDir,
|
||||
skipExisting,
|
||||
useCreate,
|
||||
client,
|
||||
dataDir,
|
||||
log,
|
||||
kbnClient,
|
||||
}: {
|
||||
name: string;
|
||||
inputDir: string;
|
||||
skipExisting: boolean;
|
||||
useCreate: boolean;
|
||||
client: KibanaClient;
|
||||
dataDir: string;
|
||||
log: ToolingLog;
|
||||
kbnClient: KbnClient;
|
||||
}) {
|
||||
const inputDir = resolve(dataDir, name);
|
||||
const name = relative(REPO_ROOT, inputDir);
|
||||
const stats = createStats(name, log);
|
||||
const files = prioritizeMappings(await readDirectory(inputDir));
|
||||
const kibanaPluginIds = await kbnClient.plugins.getEnabledIds();
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { resolve, dirname, relative } from 'path';
|
||||
import { resolve, relative } from 'path';
|
||||
import { stat, Stats, rename, createReadStream, createWriteStream } from 'fs';
|
||||
import { Readable, Writable } from 'stream';
|
||||
import { fromNode } from 'bluebird';
|
||||
import { ToolingLog } from '@kbn/dev-utils';
|
||||
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
|
||||
import { createPromiseFromStreams } from '@kbn/utils';
|
||||
import {
|
||||
prioritizeMappings,
|
||||
|
@ -25,15 +25,7 @@ async function isDirectory(path: string): Promise<boolean> {
|
|||
return stats.isDirectory();
|
||||
}
|
||||
|
||||
export async function rebuildAllAction({
|
||||
dataDir,
|
||||
log,
|
||||
rootDir = dataDir,
|
||||
}: {
|
||||
dataDir: string;
|
||||
log: ToolingLog;
|
||||
rootDir?: string;
|
||||
}) {
|
||||
export async function rebuildAllAction({ dataDir, log }: { dataDir: string; log: ToolingLog }) {
|
||||
const childNames = prioritizeMappings(await readDirectory(dataDir));
|
||||
for (const childName of childNames) {
|
||||
const childPath = resolve(dataDir, childName);
|
||||
|
@ -42,13 +34,12 @@ export async function rebuildAllAction({
|
|||
await rebuildAllAction({
|
||||
dataDir: childPath,
|
||||
log,
|
||||
rootDir,
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
const archiveName = dirname(relative(rootDir, childPath));
|
||||
log.info(`${archiveName} Rebuilding ${childName}`);
|
||||
const archiveName = relative(REPO_ROOT, childPath);
|
||||
log.info('[%s] Rebuilding %j', archiveName, childName);
|
||||
const gzip = isGzip(childPath);
|
||||
const tempFile = childPath + (gzip ? '.rebuilding.gz' : '.rebuilding');
|
||||
|
||||
|
@ -60,6 +51,6 @@ export async function rebuildAllAction({
|
|||
] as [Readable, ...Writable[]]);
|
||||
|
||||
await fromNode((cb) => rename(tempFile, childPath, cb));
|
||||
log.info(`${archiveName} Rebuilt ${childName}`);
|
||||
log.info('[%s] Rebuilt %j', archiveName, childName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { resolve } from 'path';
|
||||
import { resolve, relative } from 'path';
|
||||
import { createWriteStream, mkdirSync } from 'fs';
|
||||
import { Readable, Writable } from 'stream';
|
||||
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
|
||||
import { ToolingLog } from '@kbn/dev-utils';
|
||||
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
|
||||
import { createListStream, createPromiseFromStreams } from '@kbn/utils';
|
||||
|
||||
import {
|
||||
|
@ -22,23 +22,21 @@ import {
|
|||
} from '../lib';
|
||||
|
||||
export async function saveAction({
|
||||
name,
|
||||
outputDir,
|
||||
indices,
|
||||
client,
|
||||
dataDir,
|
||||
log,
|
||||
raw,
|
||||
query,
|
||||
}: {
|
||||
name: string;
|
||||
outputDir: string;
|
||||
indices: string | string[];
|
||||
client: KibanaClient;
|
||||
dataDir: string;
|
||||
log: ToolingLog;
|
||||
raw: boolean;
|
||||
query?: Record<string, any>;
|
||||
}) {
|
||||
const outputDir = resolve(dataDir, name);
|
||||
const name = relative(REPO_ROOT, outputDir);
|
||||
const stats = createStats(name, log);
|
||||
|
||||
log.info('[%s] Creating archive of %j', name, indices);
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { resolve } from 'path';
|
||||
import { resolve, relative } from 'path';
|
||||
import { createReadStream } from 'fs';
|
||||
import { Readable, Writable } from 'stream';
|
||||
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
|
||||
import { ToolingLog } from '@kbn/dev-utils';
|
||||
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
|
||||
import { KbnClient } from '@kbn/test';
|
||||
import { createPromiseFromStreams } from '@kbn/utils';
|
||||
|
||||
|
@ -25,19 +25,17 @@ import {
|
|||
} from '../lib';
|
||||
|
||||
export async function unloadAction({
|
||||
name,
|
||||
inputDir,
|
||||
client,
|
||||
dataDir,
|
||||
log,
|
||||
kbnClient,
|
||||
}: {
|
||||
name: string;
|
||||
inputDir: string;
|
||||
client: KibanaClient;
|
||||
dataDir: string;
|
||||
log: ToolingLog;
|
||||
kbnClient: KbnClient;
|
||||
}) {
|
||||
const inputDir = resolve(dataDir, name);
|
||||
const name = relative(REPO_ROOT, inputDir);
|
||||
const stats = createStats(name, log);
|
||||
const kibanaPluginIds = await kbnClient.plugins.getEnabledIds();
|
||||
|
||||
|
|
|
@ -30,13 +30,12 @@ export function runCli() {
|
|||
new RunWithCommands({
|
||||
description: 'CLI to manage archiving/restoring data in elasticsearch',
|
||||
globalFlags: {
|
||||
string: ['es-url', 'kibana-url', 'dir', 'config', 'es-ca', 'kibana-ca'],
|
||||
string: ['es-url', 'kibana-url', 'config', 'es-ca', 'kibana-ca'],
|
||||
help: `
|
||||
--config path to an FTR config file that sets --es-url, --kibana-url, and --dir
|
||||
--config path to an FTR config file that sets --es-url and --kibana-url
|
||||
default: ${defaultConfigPath}
|
||||
--es-url url for Elasticsearch, prefer the --config flag
|
||||
--kibana-url url for Kibana, prefer the --config flag
|
||||
--dir where arechives are stored, prefer the --config flag
|
||||
--kibana-ca if Kibana url points to https://localhost we default to the CA from @kbn/dev-utils, customize the CA with this flag
|
||||
--es-ca if Elasticsearch url points to https://localhost we default to the CA from @kbn/dev-utils, customize the CA with this flag
|
||||
`,
|
||||
|
@ -104,17 +103,6 @@ export function runCli() {
|
|||
}
|
||||
}
|
||||
|
||||
let dir = flags.dir;
|
||||
if (dir && typeof dir !== 'string') {
|
||||
throw createFlagError('--dir must be a string');
|
||||
}
|
||||
if (!dir && config) {
|
||||
dir = Path.resolve(config.get('esArchiver.directory'));
|
||||
}
|
||||
if (!dir) {
|
||||
throw createFlagError('--dir or --config must be defined');
|
||||
}
|
||||
|
||||
const client = new Client({
|
||||
node: esUrl,
|
||||
ssl: esCa ? { ca: esCa } : undefined,
|
||||
|
@ -130,7 +118,7 @@ export function runCli() {
|
|||
const esArchiver = new EsArchiver({
|
||||
log,
|
||||
client,
|
||||
dataDir: dir,
|
||||
baseDir: process.cwd(),
|
||||
kbnClient,
|
||||
});
|
||||
|
||||
|
@ -141,16 +129,16 @@ export function runCli() {
|
|||
})
|
||||
.command({
|
||||
name: 'save',
|
||||
usage: 'save [name] [...indices]',
|
||||
usage: 'save [path] [...indices]',
|
||||
description: `
|
||||
archive the [indices ...] into the --dir with [name]
|
||||
archive the [indices ...] into a directory at [path]
|
||||
|
||||
Example:
|
||||
Save all [logstash-*] indices from http://localhost:9200 to [snapshots/my_test_data] directory
|
||||
Save all [logstash-*] indices from http://localhost:9200 to the [test/functional/es_archives/my_test_data] directory
|
||||
|
||||
WARNING: If the [my_test_data] snapshot exists it will be deleted!
|
||||
WARNING: If the [test/functional/es_archives/my_test_data] snapshot exists it will be deleted!
|
||||
|
||||
$ node scripts/es_archiver save my_test_data logstash-* --dir snapshots
|
||||
$ node scripts/es_archiver save test/functional/es_archives/my_test_data logstash-*
|
||||
`,
|
||||
flags: {
|
||||
boolean: ['raw'],
|
||||
|
@ -161,9 +149,9 @@ export function runCli() {
|
|||
`,
|
||||
},
|
||||
async run({ flags, esArchiver }) {
|
||||
const [name, ...indices] = flags._;
|
||||
if (!name) {
|
||||
throw createFlagError('missing [name] argument');
|
||||
const [path, ...indices] = flags._;
|
||||
if (!path) {
|
||||
throw createFlagError('missing [path] argument');
|
||||
}
|
||||
if (!indices.length) {
|
||||
throw createFlagError('missing [...indices] arguments');
|
||||
|
@ -184,22 +172,22 @@ export function runCli() {
|
|||
}
|
||||
}
|
||||
|
||||
await esArchiver.save(name, indices, { raw, query: parsedQuery });
|
||||
await esArchiver.save(path, indices, { raw, query: parsedQuery });
|
||||
},
|
||||
})
|
||||
.command({
|
||||
name: 'load',
|
||||
usage: 'load [name]',
|
||||
usage: 'load [path]',
|
||||
description: `
|
||||
load the archive in --dir with [name]
|
||||
load the archive stored at [path]
|
||||
|
||||
Example:
|
||||
Load the [my_test_data] snapshot from the archive directory and elasticsearch instance defined
|
||||
in the [test/functional/config.js] config file
|
||||
Load the [my_test_data] snapshot from the local directory and elasticsearch instance defined
|
||||
in the [../config.js] config file
|
||||
|
||||
WARNING: If the indices exist already they will be deleted!
|
||||
|
||||
$ node scripts/es_archiver load my_test_data --config test/functional/config.js
|
||||
$ node scripts/es_archiver load my_test_data --config ../config.js
|
||||
`,
|
||||
flags: {
|
||||
boolean: ['use-create'],
|
||||
|
@ -208,9 +196,9 @@ export function runCli() {
|
|||
`,
|
||||
},
|
||||
async run({ flags, esArchiver }) {
|
||||
const [name] = flags._;
|
||||
if (!name) {
|
||||
throw createFlagError('missing [name] argument');
|
||||
const [path] = flags._;
|
||||
if (!path) {
|
||||
throw createFlagError('missing [path] argument');
|
||||
}
|
||||
if (flags._.length > 1) {
|
||||
throw createFlagError(`unknown extra arguments: [${flags._.slice(1).join(', ')}]`);
|
||||
|
@ -221,40 +209,40 @@ export function runCli() {
|
|||
throw createFlagError('--use-create does not take a value');
|
||||
}
|
||||
|
||||
await esArchiver.load(name, { useCreate });
|
||||
await esArchiver.load(path, { useCreate });
|
||||
},
|
||||
})
|
||||
.command({
|
||||
name: 'unload',
|
||||
usage: 'unload [name]',
|
||||
description: 'remove indices created by the archive in --dir with [name]',
|
||||
usage: 'unload [path]',
|
||||
description: 'remove indices created by the archive at [path]',
|
||||
async run({ flags, esArchiver }) {
|
||||
const [name] = flags._;
|
||||
if (!name) {
|
||||
throw createFlagError('missing [name] argument');
|
||||
const [path] = flags._;
|
||||
if (!path) {
|
||||
throw createFlagError('missing [path] argument');
|
||||
}
|
||||
if (flags._.length > 1) {
|
||||
throw createFlagError(`unknown extra arguments: [${flags._.slice(1).join(', ')}]`);
|
||||
}
|
||||
|
||||
await esArchiver.unload(name);
|
||||
await esArchiver.unload(path);
|
||||
},
|
||||
})
|
||||
.command({
|
||||
name: 'edit',
|
||||
usage: 'edit [prefix]',
|
||||
usage: 'edit [path]',
|
||||
description:
|
||||
'extract the archives under the prefix, wait for edits to be completed, and then recompress the archives',
|
||||
'extract the archives within or at [path], wait for edits to be completed, and then recompress the archives',
|
||||
async run({ flags, esArchiver }) {
|
||||
const [prefix] = flags._;
|
||||
if (!prefix) {
|
||||
throw createFlagError('missing [prefix] argument');
|
||||
const [path] = flags._;
|
||||
if (!path) {
|
||||
throw createFlagError('missing [path] argument');
|
||||
}
|
||||
if (flags._.length > 1) {
|
||||
throw createFlagError(`unknown extra arguments: [${flags._.slice(1).join(', ')}]`);
|
||||
}
|
||||
|
||||
await esArchiver.edit(prefix, async () => {
|
||||
await esArchiver.edit(path, async () => {
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
|
@ -278,10 +266,19 @@ export function runCli() {
|
|||
},
|
||||
})
|
||||
.command({
|
||||
name: 'rebuild-all',
|
||||
description: '[internal] read and write all archives in --dir to remove any inconsistencies',
|
||||
async run({ esArchiver }) {
|
||||
await esArchiver.rebuildAll();
|
||||
name: 'rebuild-all [dir]',
|
||||
description:
|
||||
'[internal] read and write all archives within [dir] to remove any inconsistencies',
|
||||
async run({ flags, esArchiver }) {
|
||||
const [dir] = flags._;
|
||||
if (!dir) {
|
||||
throw createFlagError('missing [dir] argument');
|
||||
}
|
||||
if (flags._.length > 1) {
|
||||
throw createFlagError(`unknown extra arguments: [${flags._.slice(1).join(', ')}]`);
|
||||
}
|
||||
|
||||
await esArchiver.rebuildAll(dir);
|
||||
},
|
||||
})
|
||||
.execute();
|
||||
|
|
|
@ -6,8 +6,11 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import Fs from 'fs';
|
||||
import Path from 'path';
|
||||
|
||||
import type { KibanaClient } from '@elastic/elasticsearch/api/kibana';
|
||||
import { ToolingLog } from '@kbn/dev-utils';
|
||||
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
|
||||
import { KbnClient } from '@kbn/test';
|
||||
|
||||
import {
|
||||
|
@ -21,139 +24,128 @@ import {
|
|||
|
||||
interface Options {
|
||||
client: KibanaClient;
|
||||
dataDir: string;
|
||||
baseDir?: string;
|
||||
log: ToolingLog;
|
||||
kbnClient: KbnClient;
|
||||
}
|
||||
|
||||
export class EsArchiver {
|
||||
private readonly client: KibanaClient;
|
||||
private readonly dataDir: string;
|
||||
private readonly baseDir: string;
|
||||
private readonly log: ToolingLog;
|
||||
private readonly kbnClient: KbnClient;
|
||||
|
||||
constructor(options: Options) {
|
||||
this.client = options.client;
|
||||
this.dataDir = options.dataDir;
|
||||
this.baseDir = options.baseDir ?? REPO_ROOT;
|
||||
this.log = options.log;
|
||||
this.kbnClient = options.kbnClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract data and mappings from an elasticsearch index and store
|
||||
* it in the dataDir so it can be used later to recreate the index.
|
||||
* Extract data and mappings from an elasticsearch index and store
|
||||
* it in the baseDir so it can be used later to recreate the index.
|
||||
*
|
||||
* @param {String} name - the name of this archive, used to determine filename
|
||||
* @param {String|Array<String>} indices - the indices to archive
|
||||
* @param {Object} options
|
||||
* @property {Boolean} options.raw - should the archive be raw (unzipped) or not
|
||||
* @return Promise<Stats>
|
||||
* @param {String} path - relative path to the archive, resolved relative to this.baseDir which defaults to REPO_ROOT
|
||||
* @param {String|Array<String>} indices - the indices to archive
|
||||
* @param {Object} options
|
||||
* @property {Boolean} options.raw - should the archive be raw (unzipped) or not
|
||||
*/
|
||||
async save(
|
||||
name: string,
|
||||
path: string,
|
||||
indices: string | string[],
|
||||
{ raw = false, query }: { raw?: boolean; query?: Record<string, any> } = {}
|
||||
) {
|
||||
return await saveAction({
|
||||
name,
|
||||
outputDir: Path.resolve(this.baseDir, path),
|
||||
indices,
|
||||
raw,
|
||||
client: this.client,
|
||||
dataDir: this.dataDir,
|
||||
log: this.log,
|
||||
query,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an index from an archive
|
||||
* Load an index from an archive
|
||||
*
|
||||
* @param {String} name - the name of the archive to load
|
||||
* @param {Object} options
|
||||
* @property {Boolean} options.skipExisting - should existing indices
|
||||
* @param {String} path - relative path to the archive to load, resolved relative to this.baseDir which defaults to REPO_ROOT
|
||||
* @param {Object} options
|
||||
* @property {Boolean} options.skipExisting - should existing indices
|
||||
* be ignored or overwritten
|
||||
* @property {Boolean} options.useCreate - use a create operation instead of index for documents
|
||||
* @return Promise<Stats>
|
||||
* @property {Boolean} options.useCreate - use a create operation instead of index for documents
|
||||
*/
|
||||
async load(
|
||||
name: string,
|
||||
path: string,
|
||||
{
|
||||
skipExisting = false,
|
||||
useCreate = false,
|
||||
}: { skipExisting?: boolean; useCreate?: boolean } = {}
|
||||
) {
|
||||
return await loadAction({
|
||||
name,
|
||||
inputDir: this.findArchive(path),
|
||||
skipExisting: !!skipExisting,
|
||||
useCreate: !!useCreate,
|
||||
client: this.client,
|
||||
dataDir: this.dataDir,
|
||||
log: this.log,
|
||||
kbnClient: this.kbnClient,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the indexes in elasticsearch that have data in an archive.
|
||||
* Remove the indexes in elasticsearch that have data in an archive.
|
||||
*
|
||||
* @param {String} name
|
||||
* @return Promise<Stats>
|
||||
* @param {String} path - relative path to the archive to unload, resolved relative to this.baseDir which defaults to REPO_ROOT
|
||||
*/
|
||||
async unload(name: string) {
|
||||
async unload(path: string) {
|
||||
return await unloadAction({
|
||||
name,
|
||||
inputDir: this.findArchive(path),
|
||||
client: this.client,
|
||||
dataDir: this.dataDir,
|
||||
log: this.log,
|
||||
kbnClient: this.kbnClient,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse and reformat all of the archives. This is primarily helpful
|
||||
* for working on the esArchiver.
|
||||
* Parse and reformat all of the archives. This is primarily helpful
|
||||
* for working on the esArchiver.
|
||||
*
|
||||
* @return Promise<Stats>
|
||||
* @param {String} dir - relative path to a directory which contains archives, resolved relative to this.baseDir which defaults to REPO_ROOT
|
||||
*/
|
||||
async rebuildAll() {
|
||||
async rebuildAll(dir: string) {
|
||||
return await rebuildAllAction({
|
||||
dataDir: this.dataDir,
|
||||
dataDir: Path.resolve(this.baseDir, dir),
|
||||
log: this.log,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the gzipped files in an archive, then call the handler. When it
|
||||
* resolves re-archive the gzipped files.
|
||||
* Extract the gzipped files in an archive, then call the handler. When it
|
||||
* resolves re-archive the gzipped files.
|
||||
*
|
||||
* @param {String} prefix optional prefix to limit archives that are extracted
|
||||
* @param {() => Promise<any>} handler
|
||||
* @return Promise<void>
|
||||
* @param {String} path optional prefix to limit archives that are extracted
|
||||
* @param {() => Promise<any>} handler
|
||||
*/
|
||||
async edit(prefix: string, handler: () => Promise<void>) {
|
||||
async edit(path: string, handler: () => Promise<void>) {
|
||||
return await editAction({
|
||||
prefix,
|
||||
path: Path.resolve(this.baseDir, path),
|
||||
log: this.log,
|
||||
dataDir: this.dataDir,
|
||||
handler,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Just like load, but skips any existing index
|
||||
* Just like load, but skips any existing index
|
||||
*
|
||||
* @param {String} name
|
||||
* @return Promise<Stats>
|
||||
* @param name
|
||||
*/
|
||||
async loadIfNeeded(name: string) {
|
||||
return await this.load(name, { skipExisting: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete any Kibana indices, and initialize the Kibana index as Kibana would do
|
||||
* on startup.
|
||||
*
|
||||
* @return Promise
|
||||
* Delete any Kibana indices, and initialize the Kibana index as Kibana would do
|
||||
* on startup.
|
||||
*/
|
||||
async emptyKibanaIndex() {
|
||||
return await emptyKibanaIndexAction({
|
||||
|
@ -162,4 +154,33 @@ export class EsArchiver {
|
|||
kbnClient: this.kbnClient,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a path relative to the baseDir
|
||||
*
|
||||
* @param relativePath
|
||||
*/
|
||||
private findArchive(relativePath: string) {
|
||||
const path = Path.resolve(this.baseDir, relativePath);
|
||||
let stats;
|
||||
try {
|
||||
stats = Fs.statSync(path);
|
||||
} catch (error) {
|
||||
if (error.code === 'ENOENT') {
|
||||
throw new Error(
|
||||
`Attempt to reference an esArchive with relative path [${relativePath}] could not be resolved. This path was resolved relative to [${this.baseDir}].`
|
||||
);
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
return path;
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
`Attempt to reference an esArchive with relative path [${relativePath}] resolved to a file instead of a directory containing data/mapping files. This path was resolved relative to [${this.baseDir}].`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,13 +209,6 @@ export const schema = Joi.object()
|
|||
// definition of apps that work with `common.navigateToApp()`
|
||||
apps: Joi.object().pattern(ID_PATTERN, appUrlPartsSchema()).default(),
|
||||
|
||||
// settings for the esArchiver module
|
||||
esArchiver: Joi.object()
|
||||
.keys({
|
||||
directory: Joi.string().default(defaultRelativeToConfigPath('fixtures/es_archiver')),
|
||||
})
|
||||
.default(),
|
||||
|
||||
// settings for the saved objects svc
|
||||
kbnArchiver: Joi.object()
|
||||
.keys({
|
||||
|
|
|
@ -785,8 +785,8 @@ To do that we'll write a Jest integration test using `TestUtils` to start
|
|||
Kibana and esArchiver to load fixture data into Elasticsearch.
|
||||
|
||||
1. Create the fixtures data you need in Elasticsearch
|
||||
2. Create a fixtures archive with `node scripts/es_archiver save <name> [index patterns...]`
|
||||
3. Load the fixtures in your test using esArchiver `esArchiver.load('name')`;
|
||||
2. Create a fixtures archive with `node scripts/es_archiver save <path> [index patterns...]`
|
||||
3. Load the fixtures in your test using esArchiver `esArchiver.load('path from root of repo')`;
|
||||
|
||||
_todo: fully worked out example_
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('Discover a11y tests', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('discover');
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/discover');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await kibanaServer.uiSettings.update({
|
||||
defaultIndex: 'logstash-*',
|
||||
'doc_table:legacy': true,
|
||||
|
@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('logstash_functional');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
});
|
||||
|
||||
it('Discover main page', async () => {
|
||||
|
|
|
@ -16,8 +16,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('Management', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('discover');
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/discover');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await kibanaServer.uiSettings.update({
|
||||
defaultIndex: 'logstash-*',
|
||||
});
|
||||
|
@ -25,7 +25,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('logstash_functional');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
});
|
||||
|
||||
it('main view', async () => {
|
||||
|
|
|
@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('Visualize', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('discover');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover');
|
||||
await PageObjects.common.navigateToApp('visualize');
|
||||
});
|
||||
|
||||
|
|
|
@ -27,12 +27,14 @@ export default function ({ getService }) {
|
|||
let indexNotFoundError;
|
||||
let docNotFoundError;
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
indexNotFoundError = await getIndexNotFoundError(es);
|
||||
docNotFoundError = await getDocNotFoundError(es);
|
||||
});
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
});
|
||||
|
||||
describe('isEsIndexNotFoundError()', () => {
|
||||
|
|
|
@ -18,7 +18,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
let indexPattern: any;
|
||||
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
|
||||
indexPattern = (
|
||||
await supertest.post('/api/index_patterns/index_pattern').send({
|
||||
|
@ -30,7 +30,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
|
||||
if (indexPattern) {
|
||||
await supertest.delete('/api/index_patterns/index_pattern/' + indexPattern.id);
|
||||
|
|
|
@ -13,8 +13,12 @@ export default function ({ getService }) {
|
|||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('pattern', () => {
|
||||
before(() => esArchiver.load('index_patterns/daily_index'));
|
||||
after(() => esArchiver.unload('index_patterns/daily_index'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/daily_index')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/daily_index')
|
||||
);
|
||||
|
||||
it('matches indices with compatible patterns', () =>
|
||||
supertest
|
||||
|
|
|
@ -13,8 +13,12 @@ export default function ({ getService }) {
|
|||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('query params', () => {
|
||||
before(() => esArchiver.load('index_patterns/daily_index'));
|
||||
after(() => esArchiver.unload('index_patterns/daily_index'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/daily_index')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/daily_index')
|
||||
);
|
||||
|
||||
it('requires `pattern` query param', () =>
|
||||
supertest
|
||||
|
|
|
@ -13,8 +13,12 @@ export default function ({ getService }) {
|
|||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('conflicts', () => {
|
||||
before(() => esArchiver.load('index_patterns/conflicts'));
|
||||
after(() => esArchiver.unload('index_patterns/conflicts'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/conflicts')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/conflicts')
|
||||
);
|
||||
|
||||
it('flags fields with mismatched types as conflicting', () =>
|
||||
supertest
|
||||
|
|
|
@ -12,8 +12,12 @@ export default function ({ getService }) {
|
|||
const randomness = getService('randomness');
|
||||
|
||||
describe('params', () => {
|
||||
before(() => esArchiver.load('index_patterns/basic_index'));
|
||||
after(() => esArchiver.unload('index_patterns/basic_index'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/basic_index')
|
||||
);
|
||||
|
||||
it('requires a pattern query param', () =>
|
||||
supertest.get('/api/index_patterns/_fields_for_wildcard').query({}).expect(400));
|
||||
|
|
|
@ -67,8 +67,12 @@ export default function ({ getService }) {
|
|||
];
|
||||
|
||||
describe('fields_for_wildcard_route response', () => {
|
||||
before(() => esArchiver.load('index_patterns/basic_index'));
|
||||
after(() => esArchiver.unload('index_patterns/basic_index'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/index_patterns/basic_index')
|
||||
);
|
||||
|
||||
it('returns a flattened version of the fields in es', async () => {
|
||||
await supertest
|
||||
|
|
|
@ -78,11 +78,15 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('creating fields', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
});
|
||||
|
||||
it('can specify optional fields attribute when creating an index pattern', async () => {
|
||||
|
|
|
@ -15,11 +15,13 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('main', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
});
|
||||
|
||||
it('can create a new scripted field', async () => {
|
||||
|
|
|
@ -18,7 +18,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
let indexPattern: any;
|
||||
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
|
||||
indexPattern = (
|
||||
await supertest.post('/api/index_patterns/index_pattern').send({
|
||||
|
@ -30,7 +30,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
|
||||
if (indexPattern) {
|
||||
await supertest.delete('/api/index_patterns/index_pattern/' + indexPattern.id);
|
||||
|
|
|
@ -15,11 +15,13 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('main', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
});
|
||||
|
||||
it('can remove a scripted field', async () => {
|
||||
|
|
|
@ -18,7 +18,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
let indexPattern: any;
|
||||
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
|
||||
indexPattern = (
|
||||
await supertest.post('/api/index_patterns/index_pattern').send({
|
||||
|
@ -30,7 +30,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
|
||||
if (indexPattern) {
|
||||
await supertest.delete('/api/index_patterns/index_pattern/' + indexPattern.id);
|
||||
|
|
|
@ -15,11 +15,13 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('main', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
});
|
||||
|
||||
it('can fetch a scripted field', async () => {
|
||||
|
|
|
@ -15,11 +15,13 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('main', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
});
|
||||
|
||||
it('can overwrite an existing field', async () => {
|
||||
|
|
|
@ -15,11 +15,13 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('main', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
});
|
||||
|
||||
it('can update an existing field', async () => {
|
||||
|
|
|
@ -17,8 +17,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const es = getService('es');
|
||||
|
||||
describe('telemetry API', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() => esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic'));
|
||||
after(() => esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic'));
|
||||
|
||||
it('should increment the opt *in* counter in the .kibana/kql-telemetry document', async () => {
|
||||
await supertest
|
||||
|
|
|
@ -41,8 +41,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 200 with individual responses', async () =>
|
||||
await supertest
|
||||
|
|
|
@ -38,8 +38,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 200 with individual responses', async () =>
|
||||
await supertest
|
||||
|
|
|
@ -17,8 +17,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('bulkUpdate', () => {
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
it('should return 200', async () => {
|
||||
const response = await supertest
|
||||
.put(`/api/saved_objects/_bulk_update`)
|
||||
|
|
|
@ -24,8 +24,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
it('should return 200', async () => {
|
||||
await supertest
|
||||
.post(`/api/saved_objects/visualization`)
|
||||
|
|
|
@ -16,8 +16,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('delete', () => {
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 200 when deleting a doc', async () =>
|
||||
await supertest
|
||||
|
|
|
@ -27,8 +27,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('with kibana index', () => {
|
||||
describe('basic amount of saved objects', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return objects in dependency order', async () => {
|
||||
await supertest
|
||||
|
@ -265,8 +269,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('10,000 objects', () => {
|
||||
before(() => esArchiver.load('saved_objects/10k'));
|
||||
after(() => esArchiver.unload('saved_objects/10k'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/10k')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/10k')
|
||||
);
|
||||
|
||||
it('should return 400 when exporting without type or objects passed in', async () => {
|
||||
await supertest
|
||||
|
@ -493,7 +501,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
describe('10,001 objects', () => {
|
||||
let customVisId: string;
|
||||
before(async () => {
|
||||
await esArchiver.load('saved_objects/10k');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/10k');
|
||||
await supertest
|
||||
.post('/api/saved_objects/visualization')
|
||||
.send({
|
||||
|
@ -508,7 +516,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
after(async () => {
|
||||
await supertest.delete(`/api/saved_objects/visualization/${customVisId}`).expect(200);
|
||||
await esArchiver.unload('saved_objects/10k');
|
||||
await esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/10k');
|
||||
});
|
||||
|
||||
it('should allow exporting more than 10,000 objects if permitted by maxImportExportSize', async () => {
|
||||
|
|
|
@ -17,8 +17,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('find', () => {
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 200 with individual responses', async () =>
|
||||
await supertest
|
||||
|
@ -240,8 +244,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('`has_reference` and `has_reference_operator` parameters', () => {
|
||||
before(() => esArchiver.load('saved_objects/references'));
|
||||
after(() => esArchiver.unload('saved_objects/references'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/references')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/references')
|
||||
);
|
||||
|
||||
it('search for a reference', async () => {
|
||||
await supertest
|
||||
|
@ -303,8 +311,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('searching for special characters', () => {
|
||||
before(() => esArchiver.load('saved_objects/find_edgecases'));
|
||||
after(() => esArchiver.unload('saved_objects/find_edgecases'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/find_edgecases')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/find_edgecases')
|
||||
);
|
||||
|
||||
it('can search for objects with dashes', async () =>
|
||||
await supertest
|
||||
|
|
|
@ -23,8 +23,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 200', async () =>
|
||||
await supertest
|
||||
|
|
|
@ -44,8 +44,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('with kibana index', () => {
|
||||
describe('with basic data existing', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 415 when no file passed in', async () => {
|
||||
await supertest
|
||||
|
|
|
@ -23,8 +23,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 200', async () =>
|
||||
await supertest
|
||||
|
|
|
@ -244,8 +244,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('with kibana index', () => {
|
||||
describe('with basic data existing', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 200 when skipping all the records', async () => {
|
||||
await supertest
|
||||
|
|
|
@ -16,8 +16,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('update', () => {
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
it('should return 200', async () => {
|
||||
await supertest
|
||||
.put(`/api/saved_objects/visualization/dd7caf20-9efd-11e7-acb3-3dab96693fab`)
|
||||
|
|
|
@ -26,8 +26,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 200 with individual responses', async () =>
|
||||
await supertest
|
||||
|
@ -86,8 +90,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('`hasReference` and `hasReferenceOperator` parameters', () => {
|
||||
before(() => esArchiver.load('saved_objects/references'));
|
||||
after(() => esArchiver.unload('saved_objects/references'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/references')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/references')
|
||||
);
|
||||
|
||||
it('search for a reference', async () => {
|
||||
await supertest
|
||||
|
@ -228,8 +236,14 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('meta attributes injected properly', () => {
|
||||
before(() => esArchiver.load('management/saved_objects/search'));
|
||||
after(() => esArchiver.unload('management/saved_objects/search'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/management/saved_objects/search')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/management/saved_objects/search'
|
||||
)
|
||||
);
|
||||
|
||||
it('should inject meta attributes for searches', async () =>
|
||||
await supertest
|
||||
|
|
|
@ -20,8 +20,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const nonexistentObject = 'wigwags/foo';
|
||||
|
||||
describe('with kibana index', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after(() =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
it('should return 200 for object that exists and inject metadata', async () =>
|
||||
await supertest
|
||||
|
|
|
@ -44,10 +44,14 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('relationships', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('management/saved_objects/relationships');
|
||||
await esArchiver.load(
|
||||
'test/api_integration/fixtures/es_archiver/management/saved_objects/relationships'
|
||||
);
|
||||
});
|
||||
after(async () => {
|
||||
await esArchiver.unload('management/saved_objects/relationships');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/management/saved_objects/relationships'
|
||||
);
|
||||
});
|
||||
|
||||
const baseApiUrl = `/api/kibana/management/saved_objects/relationships`;
|
||||
|
|
|
@ -19,10 +19,14 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('scroll_count', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('management/saved_objects/scroll_count');
|
||||
await esArchiver.load(
|
||||
'test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count'
|
||||
);
|
||||
});
|
||||
after(async () => {
|
||||
await esArchiver.unload('management/saved_objects/scroll_count');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/management/saved_objects/scroll_count'
|
||||
);
|
||||
});
|
||||
|
||||
it('returns the count for each included types', async () => {
|
||||
|
|
|
@ -193,13 +193,11 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('painless', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded(
|
||||
'../../../functional/fixtures/es_archiver/logstash_functional'
|
||||
);
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('../../../functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
});
|
||||
it('should return 400 "search_phase_execution_exception" for Painless error in "es" strategy', async () => {
|
||||
const resp = await supertest.post(`/internal/bsearch`).send({
|
||||
|
|
|
@ -18,11 +18,11 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
describe('search', () => {
|
||||
before(async () => {
|
||||
await esArchiver.emptyKibanaIndex();
|
||||
await esArchiver.loadIfNeeded('../../../functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await esArchiver.unload('../../../functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
});
|
||||
describe('post', () => {
|
||||
it('should return 200 when correctly formatted searches are provided', async () => {
|
||||
|
|
|
@ -13,8 +13,8 @@ export default function ({ getService }) {
|
|||
const supertest = getService('supertest');
|
||||
|
||||
describe('url shortener', () => {
|
||||
before(() => esArchiver.load('saved_objects/basic'));
|
||||
after(() => esArchiver.unload('saved_objects/basic'));
|
||||
before(() => esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic'));
|
||||
after(() => esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic'));
|
||||
|
||||
it('generates shortened urls', async () => {
|
||||
const resp = await supertest
|
||||
|
|
|
@ -47,8 +47,12 @@ export default function ({ getService }) {
|
|||
const esArchiver = getService('esArchiver');
|
||||
|
||||
describe('kibana stats api', () => {
|
||||
before('make sure there are some saved objects', () => esArchiver.load('saved_objects/basic'));
|
||||
after('cleanup saved objects changes', () => esArchiver.unload('saved_objects/basic'));
|
||||
before('make sure there are some saved objects', () =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after('cleanup saved objects changes', () =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
describe('basic', () => {
|
||||
it('should return the stats without cluster_uuid with no query string params', () => {
|
||||
|
|
|
@ -12,12 +12,18 @@ export default function ({ getService }) {
|
|||
|
||||
describe('Suggestions API', function () {
|
||||
before(async () => {
|
||||
await esArchiver.load('index_patterns/basic_index');
|
||||
await esArchiver.load('index_patterns/basic_kibana');
|
||||
await esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/basic_index');
|
||||
await esArchiver.load(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_kibana'
|
||||
);
|
||||
});
|
||||
after(async () => {
|
||||
await esArchiver.unload('index_patterns/basic_index');
|
||||
await esArchiver.unload('index_patterns/basic_kibana');
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_index'
|
||||
);
|
||||
await esArchiver.unload(
|
||||
'test/api_integration/fixtures/es_archiver/index_patterns/basic_kibana'
|
||||
);
|
||||
});
|
||||
|
||||
it('should return 200 with special characters', () =>
|
||||
|
|
|
@ -36,8 +36,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
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('make sure there are some saved objects', () =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
after('cleanup saved objects changes', () =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/basic')
|
||||
);
|
||||
|
||||
before('create some telemetry-data tracked indices', async () => {
|
||||
await es.indices.create({ index: 'filebeat-telemetry_tests_logs' });
|
||||
|
@ -185,8 +189,12 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
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'));
|
||||
before('Add UI Counters saved objects', () =>
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/ui_counters')
|
||||
);
|
||||
after('cleanup saved objects changes', () =>
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/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);
|
||||
|
@ -195,10 +203,10 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
describe('Usage Counters telemetry', () => {
|
||||
before('Add UI Counters saved objects', () =>
|
||||
esArchiver.load('saved_objects/usage_counters')
|
||||
esArchiver.load('test/api_integration/fixtures/es_archiver/saved_objects/usage_counters')
|
||||
);
|
||||
after('cleanup saved objects changes', () =>
|
||||
esArchiver.unload('saved_objects/usage_counters')
|
||||
esArchiver.unload('test/api_integration/fixtures/es_archiver/saved_objects/usage_counters')
|
||||
);
|
||||
|
||||
it('returns usage counters aggregated by day', async () => {
|
||||
|
|
|
@ -19,15 +19,8 @@ export function EsArchiverProvider({ getService }: FtrProviderContext): EsArchiv
|
|||
const kibanaServer = getService('kibanaServer');
|
||||
const retry = getService('retry');
|
||||
|
||||
if (!config.get('esArchiver')) {
|
||||
throw new Error(`esArchiver can't be used unless you specify it's config in your config file`);
|
||||
}
|
||||
|
||||
const dataDir = config.get('esArchiver.directory');
|
||||
|
||||
const esArchiver = new EsArchiver({
|
||||
client,
|
||||
dataDir,
|
||||
log,
|
||||
kbnClient: kibanaServer,
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import path, { resolve } from 'path';
|
||||
import { resolve } from 'path';
|
||||
import { services } from '../plugin_functional/services';
|
||||
import fs from 'fs';
|
||||
import { KIBANA_ROOT } from '@kbn/test';
|
||||
|
@ -47,9 +47,6 @@ export default async function ({ readConfigFile }) {
|
|||
serverArgs: ['xpack.security.enabled=false'],
|
||||
},
|
||||
apps: functionalConfig.get('apps'),
|
||||
esArchiver: {
|
||||
directory: path.resolve(__dirname, '../es_archives'),
|
||||
},
|
||||
screenshots: functionalConfig.get('screenshots'),
|
||||
junit: {
|
||||
reportName: 'Example plugin functional tests',
|
||||
|
|
|
@ -102,8 +102,10 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
|
|||
|
||||
describe('dashboard container', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('../functional/fixtures/es_archiver/dashboard/current/data');
|
||||
await esArchiver.loadIfNeeded('../functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||
await esArchiver.loadIfNeeded(
|
||||
'test/functional/fixtures/es_archiver/dashboard/current/kibana'
|
||||
);
|
||||
await PageObjects.common.navigateToApp('dashboardEmbeddableExamples');
|
||||
await testSubjects.click('dashboardEmbeddableByValue');
|
||||
await updateInput(JSON.stringify(testDashboardInput, null, 4));
|
||||
|
|
|
@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
describe('context view for date_nanos', () => {
|
||||
before(async function () {
|
||||
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos']);
|
||||
await esArchiver.loadIfNeeded('date_nanos');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/date_nanos');
|
||||
await kibanaServer.uiSettings.replace({ defaultIndex: TEST_INDEX_PATTERN });
|
||||
await kibanaServer.uiSettings.update({
|
||||
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
|
||||
|
@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
after(async function unloadMakelogs() {
|
||||
await security.testUser.restoreDefaults();
|
||||
await esArchiver.unload('date_nanos');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos');
|
||||
});
|
||||
|
||||
it('displays predessors - anchor - successors in right order ', async function () {
|
||||
|
|
|
@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
describe('context view for date_nanos with custom timestamp', () => {
|
||||
before(async function () {
|
||||
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos_custom']);
|
||||
await esArchiver.loadIfNeeded('date_nanos_custom');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/date_nanos_custom');
|
||||
await kibanaServer.uiSettings.replace({ defaultIndex: TEST_INDEX_PATTERN });
|
||||
await kibanaServer.uiSettings.update({
|
||||
'context:defaultSize': `${TEST_DEFAULT_CONTEXT_SIZE}`,
|
||||
|
@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
after(async function () {
|
||||
await security.testUser.restoreDefaults();
|
||||
await esArchiver.unload('date_nanos_custom');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos_custom');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -17,14 +17,14 @@ export default function ({ getService, getPageObjects, loadTestFile }) {
|
|||
|
||||
before(async function () {
|
||||
await browser.setWindowSize(1200, 800);
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.load('visualize');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/visualize');
|
||||
await kibanaServer.uiSettings.replace({ defaultIndex: 'logstash-*' });
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
});
|
||||
|
||||
after(function unloadMakelogs() {
|
||||
return esArchiver.unload('logstash_functional');
|
||||
return esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
});
|
||||
|
||||
loadTestFile(require.resolve('./_context_navigation'));
|
||||
|
|
|
@ -40,7 +40,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('dashboard panel copy to', function viewEditModeTests() {
|
||||
before(async function () {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('create and add embeddables', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -17,7 +17,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('dashboard back button', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('dashboard/current/kibana');
|
||||
await esArchiver.loadIfNeeded(
|
||||
'test/functional/fixtures/es_archiver/dashboard/current/kibana'
|
||||
);
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -19,7 +19,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
*/
|
||||
describe('dashboard error handling', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('dashboard/current/kibana');
|
||||
await esArchiver.loadIfNeeded(
|
||||
'test/functional/fixtures/es_archiver/dashboard/current/kibana'
|
||||
);
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
});
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('dashboard filter bar', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -54,7 +54,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
};
|
||||
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader', 'animals']);
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
|
|
|
@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('dashboard grid', function () {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
let originalTitles: string[] = [];
|
||||
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('dashboard query bar', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('causes panels to reload when refresh is clicked', async () => {
|
||||
await esArchiver.unload('dashboard/current/data');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||
|
||||
await queryBar.clickQuerySubmitButton();
|
||||
await retry.tryForTime(5000, async () => {
|
||||
|
|
|
@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('dashboard saved queries', function describeIndexTests() {
|
||||
before(async function () {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -25,7 +25,7 @@ export default function ({
|
|||
|
||||
describe('dashboard snapshots', function describeIndexTests() {
|
||||
before(async function () {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -36,7 +36,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
};
|
||||
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -23,7 +23,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
// FLAKY: https://github.com/elastic/kibana/issues/91191
|
||||
describe.skip('dashboard unsaved panels', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
let originalPanelTitles: string[];
|
||||
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('edit embeddable redirects', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -44,7 +44,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
describe('edit visualizations from dashboard', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
];
|
||||
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -21,9 +21,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('dashboard embeddable data grid', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('dashboard/current/data');
|
||||
await esArchiver.loadIfNeeded('dashboard/current/kibana');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||
await esArchiver.loadIfNeeded(
|
||||
'test/functional/fixtures/es_archiver/dashboard/current/kibana'
|
||||
);
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
'doc_table:legacy': false,
|
||||
|
|
|
@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('embeddable library', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -94,7 +94,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
describe.skip('dashboard embeddable rendering', function describeIndexTests() {
|
||||
before(async () => {
|
||||
await security.testUser.setRoles(['kibana_admin', 'animals', 'test_logstash_reader']);
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('empty dashboard', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('full screen mode', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -15,21 +15,21 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
|
|||
|
||||
async function loadCurrentData() {
|
||||
await browser.setWindowSize(1300, 900);
|
||||
await esArchiver.unload('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('dashboard/current/data');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||
}
|
||||
|
||||
async function unloadCurrentData() {
|
||||
await esArchiver.unload('dashboard/current/data');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||
}
|
||||
|
||||
async function loadLogstash() {
|
||||
await browser.setWindowSize(1200, 900);
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
}
|
||||
|
||||
async function unloadLogstash() {
|
||||
await esArchiver.unload('logstash_functional');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
}
|
||||
|
||||
describe('dashboard app', function () {
|
||||
|
|
|
@ -33,7 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
describe('legacy urls', function describeIndexTests() {
|
||||
before(async function () {
|
||||
await security.testUser.setRoles(['kibana_admin', 'animals']);
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await PageObjects.common.navigateToApp('dashboard');
|
||||
await PageObjects.dashboard.clickNewDashboard();
|
||||
await dashboardAddPanel.addVisualization('Rendering-Test:-animal-sounds-pie');
|
||||
|
|
|
@ -19,7 +19,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('expanding a panel', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -19,9 +19,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('dashboard saved search embeddable', () => {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('dashboard/current/data');
|
||||
await esArchiver.loadIfNeeded('dashboard/current/kibana');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/dashboard/current/data');
|
||||
await esArchiver.loadIfNeeded(
|
||||
'test/functional/fixtures/es_archiver/dashboard/current/kibana'
|
||||
);
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('share dashboard', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -27,7 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
this.tags('includeFirefox');
|
||||
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -39,7 +39,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
// FLAKY: https://github.com/elastic/kibana/issues/79463
|
||||
describe.skip('Changing field formatter to Url', () => {
|
||||
before(async function () {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('dashboard view edit mode', function viewEditModeTests() {
|
||||
before(async () => {
|
||||
await esArchiver.load('dashboard/current/kibana');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/dashboard/current/kibana');
|
||||
await kibanaServer.uiSettings.replace({
|
||||
defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c',
|
||||
});
|
||||
|
|
|
@ -25,7 +25,7 @@ export default function ({
|
|||
before(async function () {
|
||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||
await kibanaServer.importExport.load('discover');
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
||||
|
|
|
@ -37,7 +37,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
before(async () => {
|
||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||
await kibanaServer.importExport.load('discover');
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||
await kibanaServer.uiSettings.update(defaultSettings);
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
|
|
|
@ -21,8 +21,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('discover data grid doc link', function () {
|
||||
beforeEach(async function () {
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('discover');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover');
|
||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||
await kibanaServer.uiSettings.update(defaultSettings);
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
|
|
|
@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
log.debug('load kibana index with default index pattern');
|
||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||
await kibanaServer.importExport.load('discover');
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
|
|
|
@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
before(async function () {
|
||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||
await kibanaServer.importExport.load('discover');
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||
await kibanaServer.uiSettings.update(defaultSettings);
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
|
|
|
@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('date_nanos', function () {
|
||||
before(async function () {
|
||||
await esArchiver.loadIfNeeded('date_nanos');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/date_nanos');
|
||||
await kibanaServer.uiSettings.replace({ defaultIndex: 'date-nanos' });
|
||||
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos']);
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
|
@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
after(async function unloadMakelogs() {
|
||||
await security.testUser.restoreDefaults();
|
||||
await esArchiver.unload('date_nanos');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos');
|
||||
});
|
||||
|
||||
it('should show a timestamp with nanoseconds in the first result row', async function () {
|
||||
|
|
|
@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('date_nanos_mixed', function () {
|
||||
before(async function () {
|
||||
await esArchiver.loadIfNeeded('date_nanos_mixed');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/date_nanos_mixed');
|
||||
await kibanaServer.uiSettings.replace({ defaultIndex: 'timestamp-*' });
|
||||
await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos_mixed']);
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
|
@ -29,7 +29,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
after(async () => {
|
||||
await security.testUser.restoreDefaults();
|
||||
esArchiver.unload('date_nanos_mixed');
|
||||
esArchiver.unload('test/functional/fixtures/es_archiver/date_nanos_mixed');
|
||||
});
|
||||
|
||||
it('shows a list of records of indices with date & date_nanos fields in the right order', async function () {
|
||||
|
|
|
@ -36,7 +36,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
);
|
||||
|
||||
// and load a set of makelogs data
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
await PageObjects.timePicker.setDefaultAbsoluteRange();
|
||||
|
|
|
@ -24,7 +24,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
log.debug('load kibana index with default index pattern');
|
||||
await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
|
||||
await kibanaServer.importExport.load('discover');
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||
log.debug('discover');
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
|
|
|
@ -25,16 +25,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('discover histogram', function describeIndexTests() {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.load('long_window_logstash');
|
||||
await esArchiver.load('long_window_logstash_index_pattern');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.load('test/functional/fixtures/es_archiver/long_window_logstash');
|
||||
await esArchiver.load(
|
||||
'test/functional/fixtures/es_archiver/long_window_logstash_index_pattern'
|
||||
);
|
||||
await security.testUser.setRoles(['kibana_admin', 'long_window_logstash']);
|
||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||
await PageObjects.common.navigateToApp('discover');
|
||||
});
|
||||
after(async () => {
|
||||
await esArchiver.unload('long_window_logstash');
|
||||
await esArchiver.unload('long_window_logstash_index_pattern');
|
||||
await esArchiver.unload('test/functional/fixtures/es_archiver/long_window_logstash');
|
||||
await esArchiver.unload(
|
||||
'test/functional/fixtures/es_archiver/long_window_logstash_index_pattern'
|
||||
);
|
||||
await security.testUser.restoreDefaults();
|
||||
});
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
|
||||
describe('doc link in discover', function contextSize() {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('discover');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/discover');
|
||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||
await kibanaServer.uiSettings.update({
|
||||
'doc_table:legacy': true,
|
||||
|
|
|
@ -33,7 +33,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await kibanaServer.importExport.load('discover');
|
||||
|
||||
// and load a set of makelogs data
|
||||
await esArchiver.loadIfNeeded('logstash_functional');
|
||||
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
|
||||
await kibanaServer.uiSettings.replace(defaultSettings);
|
||||
await PageObjects.timePicker.setDefaultAbsoluteRangeViaUiSettings();
|
||||
log.debug('discover doc table');
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue