Skip to content

Commit

Permalink
Migrate security and spaces integration test plugins to Kibana Platfo…
Browse files Browse the repository at this point in the history
…rm (#66415)
  • Loading branch information
jportner committed May 13, 2020
1 parent 65a0b44 commit 9186133
Show file tree
Hide file tree
Showing 22 changed files with 144 additions and 288 deletions.
5 changes: 1 addition & 4 deletions x-pack/test/saved_object_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
...config.xpack.api.get('kbnTestServer.serverArgs'),
'--optimize.enabled=false',
'--server.xsrf.disableProtection=true',
`--plugin-path=${path.join(__dirname, 'fixtures', 'isolated_type_plugin')}`,
`--plugin-path=${path.join(__dirname, 'fixtures', 'namespace_agnostic_type_plugin')}`,
`--plugin-path=${path.join(__dirname, 'fixtures', 'hidden_type_plugin')}`,
`--plugin-path=${path.join(__dirname, 'fixtures', 'shared_type_plugin')}`,
`--plugin-path=${path.join(__dirname, 'fixtures', 'saved_object_test_plugin')}`,
...disabledPlugins.map(key => `--xpack.${key}.enabled=false`),
],
},
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "savedObjectTestPlugin",
"version": "kibana",
"server": true,
"ui": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { Plugin } from './plugin';

export function plugin() {
return new Plugin();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { CoreSetup, SavedObject } from 'kibana/server';

export class Plugin {
constructor() {}

public setup(core: CoreSetup) {
// called when plugin is setting up during Kibana's startup sequence
const management = {
importableAndExportable: true,
getTitle(obj: SavedObject<any>) {
return obj.attributes.title;
},
};
const mappings = {
properties: {
title: { type: 'text' },
},
};

core.savedObjects.registerType({
name: 'isolatedtype',
hidden: false,
namespaceType: 'single',
management,
mappings: {
properties: {
description: { type: 'text' },
kibanaSavedObjectMeta: {
properties: {
searchSourceJSON: { type: 'text' },
},
},
savedSearchId: { type: 'keyword' },
title: { type: 'text' },
uiStateJSON: { type: 'text' },
version: { type: 'integer' },
visState: { type: 'text' },
},
},
});
core.savedObjects.registerType({
name: 'sharedtype',
hidden: false,
namespaceType: 'multiple',
mappings,
});
core.savedObjects.registerType({
name: 'globaltype',
hidden: false,
namespaceType: 'agnostic',
management,
mappings,
});
core.savedObjects.registerType({
name: 'hiddentype',
hidden: true,
namespaceType: 'single',
mappings,
});
}

public start() {
// called after all plugins are set up
}

public stop() {
// called when plugin is torn down during Kibana's shutdown sequence
}
}

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion x-pack/test/spaces_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
// disable anonymouse access so that we're testing both on and off in different suites
'--status.allowAnonymous=false',
'--server.xsrf.disableProtection=true',
`--plugin-path=${path.join(__dirname, 'fixtures', 'shared_type_plugin')}`,
`--plugin-path=${path.join(__dirname, 'fixtures', 'spaces_test_plugin')}`,
...disabledPlugins.map(key => `--xpack.${key}.enabled=false`),
],
},
Expand Down

This file was deleted.

Loading

0 comments on commit 9186133

Please sign in to comment.