[kbn/config] don't include x-pack/examples with --oss (#79032) (#79381)

Co-authored-by: spalger <spalger@users.noreply.github.com>

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Spencer 2020-10-02 19:55:25 -07:00 committed by GitHub
parent ea1e323254
commit 9eeff6d893
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View file

@ -198,6 +198,18 @@ test('pluginSearchPaths contains x-pack/examples plugins path if --run-examples
expect(env.pluginSearchPaths).toContain('/some/home/dir/x-pack/examples');
});
test('pluginSearchPaths does not contain x-pack/examples plugins path if --oss flag is true', () => {
const env = new Env(
'/some/home/dir',
packageInfos,
getEnvOptions({
cliArgs: { runExamples: true, oss: true },
})
);
expect(env.pluginSearchPaths).not.toContain('/some/home/dir/x-pack/examples');
});
test('pluginSearchPaths does not contains examples plugins path if --run-examples flag is false', () => {
const env = new Env(
'/some/home/dir',

View file

@ -123,8 +123,9 @@ export class Env {
resolve(this.homeDir, 'src', 'plugins'),
...(options.cliArgs.oss ? [] : [resolve(this.homeDir, 'x-pack', 'plugins')]),
resolve(this.homeDir, 'plugins'),
...(options.cliArgs.runExamples
? [resolve(this.homeDir, 'examples'), resolve(this.homeDir, 'x-pack', 'examples')]
...(options.cliArgs.runExamples ? [resolve(this.homeDir, 'examples')] : []),
...(options.cliArgs.runExamples && !options.cliArgs.oss
? [resolve(this.homeDir, 'x-pack', 'examples')]
: []),
resolve(this.homeDir, '..', 'kibana-extra'),
];