mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* [Code] bundle git repo for functional test * adjustment
This commit is contained in:
parent
124f91c48b
commit
c1fa654325
18 changed files with 1191 additions and 689 deletions
|
@ -4,14 +4,16 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { REPO_ROOT } from '@kbn/dev-utils';
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
import { load as repoLoad, unload as repoUnload } from './repo_archiver';
|
||||
|
||||
export default function codeIntelligenceFunctionalTests({
|
||||
getService,
|
||||
getPageObjects,
|
||||
}: FtrProviderContext) {
|
||||
// const esArchiver = getService('esArchiver');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const retry = getService('retry');
|
||||
const log = getService('log');
|
||||
|
@ -77,58 +79,21 @@ export default function codeIntelligenceFunctionalTests({
|
|||
};
|
||||
|
||||
before(async () => {
|
||||
// Navigate to the code app.
|
||||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Prepare a git repository for the test
|
||||
await PageObjects.code.fillImportRepositoryUrlInputBox(
|
||||
'https://github.com/elastic/TypeScript-Node-Starter'
|
||||
await repoLoad(
|
||||
'github.com/elastic/TypeScript-Node-Starter',
|
||||
'typescript_node_starter',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
// Click the import repository button.
|
||||
await PageObjects.code.clickImportRepositoryButton();
|
||||
|
||||
await retry.tryForTime(300000, async () => {
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(1);
|
||||
expect(await repositoryItems[0].getVisibleText()).to.equal(
|
||||
'elastic/TypeScript-Node-Starter'
|
||||
);
|
||||
|
||||
// Wait for the index to start.
|
||||
await retry.try(async () => {
|
||||
expect(await exists('repositoryIndexOngoing')).to.be(true);
|
||||
});
|
||||
// Wait for the index to end.
|
||||
await retry.try(async () => {
|
||||
expect(await exists('repositoryIndexDone')).to.be(true);
|
||||
});
|
||||
});
|
||||
await esArchiver.load('code/repositories/typescript_node_starter');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
// Navigate to the code app.
|
||||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Clean up the imported repository
|
||||
await PageObjects.code.clickDeleteRepositoryButton();
|
||||
await retry.try(async () => {
|
||||
expect(await exists('confirmModalConfirmButton')).to.be(true);
|
||||
});
|
||||
|
||||
await testSubjects.click('confirmModalConfirmButton');
|
||||
|
||||
await retry.tryForTime(300000, async () => {
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(0);
|
||||
});
|
||||
await retry.tryForTime(300000, async () => {
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(0);
|
||||
});
|
||||
|
||||
await PageObjects.security.logout();
|
||||
await esArchiver.unload('code/repositories/typescript_node_starter');
|
||||
await repoUnload(
|
||||
'github.com/elastic/TypeScript-Node-Starter',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -4,14 +4,16 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { REPO_ROOT } from '@kbn/dev-utils';
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
import { load as repoLoad, unload as repoUnload } from './repo_archiver';
|
||||
|
||||
export default function exploreRepositoryFunctionalTests({
|
||||
getService,
|
||||
getPageObjects,
|
||||
}: FtrProviderContext) {
|
||||
// const esArchiver = getService('esArchiver');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const browser = getService('browser');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const retry = getService('retry');
|
||||
|
@ -24,69 +26,39 @@ export default function exploreRepositoryFunctionalTests({
|
|||
|
||||
const FIND_TIME = config.get('timeouts.find');
|
||||
|
||||
// FLAKY https://github.com/elastic/kibana/issues/44572
|
||||
// FLAKY https://github.com/elastic/kibana/issues/42111
|
||||
// FLAKY https://github.com/elastic/kibana/issues/44286
|
||||
// FLAKY https://github.com/elastic/kibana/issues/43557
|
||||
// FLAKY https://github.com/elastic/kibana/issues/42567
|
||||
describe.skip('Explore Repository', function() {
|
||||
describe('Explore Repository', function() {
|
||||
this.tags('smoke');
|
||||
describe('Explore a repository', () => {
|
||||
const repositoryListSelector = 'codeRepositoryList codeRepositoryItem';
|
||||
|
||||
before(async () => {
|
||||
// Navigate to the code app.
|
||||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Prepare a git repository for the test
|
||||
await PageObjects.code.fillImportRepositoryUrlInputBox(
|
||||
'https://github.com/elastic/TypeScript-Node-Starter'
|
||||
await repoLoad(
|
||||
'github.com/elastic/TypeScript-Node-Starter',
|
||||
'typescript_node_starter',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
// Click the import repository button.
|
||||
await PageObjects.code.clickImportRepositoryButton();
|
||||
|
||||
await retry.tryForTime(10000, async () => {
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(1);
|
||||
expect(await repositoryItems[0].getVisibleText()).to.equal(
|
||||
'elastic/TypeScript-Node-Starter'
|
||||
);
|
||||
});
|
||||
|
||||
// Wait for the index to start.
|
||||
await retry.try(async () => {
|
||||
expect(await exists('repositoryIndexOngoing')).to.be(true);
|
||||
});
|
||||
// Wait for the index to end.
|
||||
await retry.try(async () => {
|
||||
expect(await exists('repositoryIndexDone')).to.be(true);
|
||||
});
|
||||
await esArchiver.load('code/repositories/typescript_node_starter');
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await PageObjects.security.logout();
|
||||
await esArchiver.unload('code/repositories/typescript_node_starter');
|
||||
await repoUnload(
|
||||
'github.com/elastic/TypeScript-Node-Starter',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
// Navigate to the code app.
|
||||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Clean up the imported repository
|
||||
await PageObjects.code.clickDeleteRepositoryButton();
|
||||
|
||||
await retry.try(async () => {
|
||||
expect(await exists('confirmModalConfirmButton')).to.be(true);
|
||||
});
|
||||
|
||||
await testSubjects.click('confirmModalConfirmButton');
|
||||
|
||||
await retry.tryForTime(300000, async () => {
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(0);
|
||||
});
|
||||
|
||||
await PageObjects.security.logout();
|
||||
// Enter the first repository from the admin page.
|
||||
await testSubjects.click(repositoryListSelector);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
afterEach(async () => {
|
||||
// Navigate to the code app.
|
||||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
|
|
@ -4,17 +4,20 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { REPO_ROOT } from '@kbn/dev-utils';
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
import { load as repoLoad, unload as repoUnload } from './repo_archiver';
|
||||
|
||||
export default function exploreRepositoryFunctionalTests({
|
||||
getService,
|
||||
getPageObjects,
|
||||
}: FtrProviderContext) {
|
||||
// const esArchiver = getService('esArchiver');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const browser = getService('browser');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const retry = getService('retry');
|
||||
const config = getService('config');
|
||||
const PageObjects = getPageObjects(['common', 'header', 'security', 'code', 'home']);
|
||||
const exists = async (selector: string) => testSubjects.exists(selector, { allowHidden: true });
|
||||
|
||||
|
@ -23,28 +26,12 @@ export default function exploreRepositoryFunctionalTests({
|
|||
const repositoryListSelector = 'codeRepositoryList codeRepositoryItem';
|
||||
|
||||
before(async () => {
|
||||
// Navigate to the code app.
|
||||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Prepare a git repository for the test
|
||||
await PageObjects.code.fillImportRepositoryUrlInputBox(
|
||||
'https://github.com/elastic/code-examples_flatten-directory.git'
|
||||
await repoLoad(
|
||||
'github.com/elastic/code-examples_flatten-directory',
|
||||
'code_examples_flatten_directory',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
// Click the import repository button.
|
||||
await PageObjects.code.clickImportRepositoryButton();
|
||||
|
||||
await retry.tryForTime(10000, async () => {
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(1);
|
||||
expect(await repositoryItems[0].getVisibleText()).to.equal(
|
||||
'elastic/code-examples_flatten-directory'
|
||||
);
|
||||
});
|
||||
|
||||
await retry.try(async () => {
|
||||
expect(await exists('repositoryIndexOngoing')).to.be(true);
|
||||
});
|
||||
await esArchiver.load('code/repositories/code_examples_flatten_directory');
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -57,25 +44,12 @@ export default function exploreRepositoryFunctionalTests({
|
|||
});
|
||||
|
||||
after(async () => {
|
||||
// Navigate to the code app.
|
||||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Clean up the imported repository
|
||||
await PageObjects.code.clickDeleteRepositoryButton();
|
||||
|
||||
await retry.try(async () => {
|
||||
expect(await exists('confirmModalConfirmButton')).to.be(true);
|
||||
});
|
||||
|
||||
await testSubjects.click('confirmModalConfirmButton');
|
||||
|
||||
await retry.tryForTime(300000, async () => {
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(0);
|
||||
});
|
||||
|
||||
await PageObjects.security.logout();
|
||||
await repoUnload(
|
||||
'github.com/elastic/code-examples_flatten-directory',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
await esArchiver.unload('code/repositories/code_examples_flatten_directory');
|
||||
});
|
||||
|
||||
it('tree should be loaded', async () => {
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -4,14 +4,16 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { REPO_ROOT } from '@kbn/dev-utils';
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
import { load as repoLoad, unload as repoUnload } from './repo_archiver';
|
||||
|
||||
export default function manageRepositoriesFunctionalTests({
|
||||
getService,
|
||||
getPageObjects,
|
||||
}: FtrProviderContext) {
|
||||
// const esArchiver = getService('esArchiver');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const testSubjects = getService('testSubjects');
|
||||
const retry = getService('retry');
|
||||
const log = getService('log');
|
||||
|
@ -25,50 +27,35 @@ export default function manageRepositoriesFunctionalTests({
|
|||
const existsInvisible = async (selector: string) =>
|
||||
await testSubjects.exists(selector, { allowHidden: true });
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/37859
|
||||
describe.skip('History', function() {
|
||||
describe('History', function() {
|
||||
this.tags('smoke');
|
||||
const repositoryListSelector = 'codeRepositoryList codeRepositoryItem';
|
||||
|
||||
describe('browser history can go back while exploring code app', () => {
|
||||
let driver: any;
|
||||
before(async () => {
|
||||
await repoLoad(
|
||||
'github.com/elastic/TypeScript-Node-Starter',
|
||||
'typescript_node_starter',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
await esArchiver.load('code/repositories/typescript_node_starter');
|
||||
|
||||
// Navigate to the code app.
|
||||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
log.debug('Code test import repository');
|
||||
// Fill in the import repository input box with a valid git repository url.
|
||||
await PageObjects.code.fillImportRepositoryUrlInputBox(
|
||||
'https://github.com/elastic/TypeScript-Node-Starter'
|
||||
);
|
||||
// Click the import repository button.
|
||||
await PageObjects.code.clickImportRepositoryButton();
|
||||
|
||||
const webDriver = await getService('__webdriver__').init();
|
||||
driver = webDriver.driver;
|
||||
});
|
||||
// after(async () => await esArchiver.unload('code'));
|
||||
|
||||
after(async () => {
|
||||
// Navigate to the code app.
|
||||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
// Clean up the imported repository
|
||||
await PageObjects.code.clickDeleteRepositoryButton();
|
||||
await retry.try(async () => {
|
||||
expect(await testSubjects.exists('confirmModalConfirmButton')).to.be(true);
|
||||
});
|
||||
|
||||
await testSubjects.click('confirmModalConfirmButton');
|
||||
|
||||
await retry.tryForTime(300000, async () => {
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(0);
|
||||
});
|
||||
|
||||
await PageObjects.security.logout();
|
||||
await esArchiver.unload('code/repositories/typescript_node_starter');
|
||||
await repoUnload(
|
||||
'github.com/elastic/TypeScript-Node-Starter',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
});
|
||||
|
||||
it('from admin page to source view page can go back and forward', async () => {
|
||||
|
|
|
@ -14,8 +14,8 @@ export default function codeApp({ loadTestFile }: FtrProviderContext) {
|
|||
loadTestFile(require.resolve('./search'));
|
||||
loadTestFile(require.resolve('./explore_repository'));
|
||||
loadTestFile(require.resolve('./code_intelligence'));
|
||||
loadTestFile(require.resolve('./with_security'));
|
||||
loadTestFile(require.resolve('./history'));
|
||||
loadTestFile(require.resolve('./file_tree'));
|
||||
loadTestFile(require.resolve('./with_security'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ export default function manageRepositoriesFunctionalTests({
|
|||
await PageObjects.common.navigateToApp('code');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
});
|
||||
// after(async () => await esArchiver.unload('code'));
|
||||
|
||||
after(async () => {
|
||||
await PageObjects.security.logout();
|
||||
|
|
49
x-pack/test/functional/apps/code/repo_archiver.ts
Normal file
49
x-pack/test/functional/apps/code/repo_archiver.ts
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* 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 del from 'del';
|
||||
// @ts-ignore
|
||||
import extractZip from 'extract-zip';
|
||||
import fs from 'fs';
|
||||
import mkdirp from 'mkdirp';
|
||||
import path from 'path';
|
||||
import { promisify } from 'util';
|
||||
|
||||
const asyncExtractZip = promisify(extractZip);
|
||||
const asyncMkdirp = promisify(mkdirp);
|
||||
|
||||
const archiveFilePath = (zipFileName: string) => {
|
||||
return path.resolve(__dirname, `./fixtures/${zipFileName}.zip`);
|
||||
};
|
||||
|
||||
const repoDir = (repoUri: string, kibanaDir: string) => {
|
||||
return path.resolve(kibanaDir, `data/code/repos/${repoUri}`);
|
||||
};
|
||||
|
||||
const workspaceDir = (repoUri: string, kibanaDir: string) => {
|
||||
return path.resolve(kibanaDir, `data/code/workspace/${repoUri}`);
|
||||
};
|
||||
|
||||
const unzip = async (filepath: string, target: string) => {
|
||||
if (!fs.existsSync(target)) {
|
||||
await asyncMkdirp(target);
|
||||
}
|
||||
await asyncExtractZip(filepath, { dir: target });
|
||||
};
|
||||
|
||||
export const load = async (repoUri: string, zipFileName: string, kibanaDir: string) => {
|
||||
const dir = repoDir(repoUri, kibanaDir);
|
||||
const zipRepoPath = archiveFilePath(zipFileName);
|
||||
// Try to unload first in case the folder already exists
|
||||
await unload(repoUri, kibanaDir);
|
||||
return unzip(zipRepoPath, dir);
|
||||
};
|
||||
|
||||
export const unload = async (repoUri: string, kibanaDir: string) => {
|
||||
const dir = repoDir(repoUri, kibanaDir);
|
||||
const wsDir = workspaceDir(repoUri, kibanaDir);
|
||||
return del([dir, wsDir], { force: true });
|
||||
};
|
|
@ -23,7 +23,7 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Ftr
|
|||
|
||||
describe('Code Search', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('code');
|
||||
await esArchiver.load('code/repositories/typescript_node_starter');
|
||||
|
||||
// Navigate to the search page of the code app.
|
||||
await PageObjects.common.navigateToApp('codeSearch');
|
||||
|
@ -32,7 +32,7 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Ftr
|
|||
|
||||
after(async () => {
|
||||
await PageObjects.security.logout();
|
||||
await esArchiver.unload('code');
|
||||
await esArchiver.unload('code/repositories/typescript_node_starter');
|
||||
});
|
||||
|
||||
it('Trigger symbols in typeahead', async () => {
|
||||
|
@ -41,10 +41,10 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Ftr
|
|||
|
||||
await retry.tryForTime(5000, async () => {
|
||||
const symbols = await testSubjects.findAll(symbolTypeaheadListSelector);
|
||||
expect(symbols).to.have.length(2);
|
||||
expect(symbols).to.have.length(5);
|
||||
|
||||
expect(await symbols[0].getVisibleText()).to.equal('user');
|
||||
expect(await symbols[1].getVisibleText()).to.equal('passport.User');
|
||||
expect(await symbols[0].getVisibleText()).to.equal('User.findOne() callback.user');
|
||||
expect(await symbols[1].getVisibleText()).to.equal('postSignup.user');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -77,14 +77,14 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Ftr
|
|||
|
||||
await retry.tryForTime(5000, async () => {
|
||||
const results = await testSubjects.findAll(searchResultListSelector);
|
||||
expect(results).to.have.length(3);
|
||||
expect(results).to.have.length(20);
|
||||
|
||||
// The third file has the most matches of the query, but is still ranked as
|
||||
// the thrid because the the query matches the qname of the first 2 files. This
|
||||
// is because qname got boosted more from search.
|
||||
expect(await results[0].getVisibleText()).to.equal('src/controllers/user.ts');
|
||||
expect(await results[1].getVisibleText()).to.equal('src/models/User.ts');
|
||||
expect(await results[2].getVisibleText()).to.equal('src/config/passport.js');
|
||||
expect(await results[2].getVisibleText()).to.equal('src/config/passport.ts');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -97,8 +97,9 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Ftr
|
|||
|
||||
await retry.tryForTime(5000, async () => {
|
||||
const results = await testSubjects.findAll(searchResultListSelector);
|
||||
expect(results).to.have.length(1);
|
||||
expect(await results[0].getVisibleText()).to.equal('src/controllers/user.ts');
|
||||
expect(results).to.have.length(2);
|
||||
expect(await results[0].getVisibleText()).to.equal('src/app.ts');
|
||||
expect(await results[1].getVisibleText()).to.equal('src/controllers/user.ts');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -110,10 +111,12 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Ftr
|
|||
|
||||
await retry.tryForTime(5000, async () => {
|
||||
const langFilters = await testSubjects.findAll(languageFilterListSelector);
|
||||
expect(langFilters).to.have.length(2);
|
||||
expect(langFilters).to.have.length(4);
|
||||
|
||||
expect(await langFilters[0].getVisibleText()).to.equal('typescript\n2');
|
||||
expect(await langFilters[1].getVisibleText()).to.equal('javascript\n1');
|
||||
expect(await langFilters[0].getVisibleText()).to.equal('scss\n9');
|
||||
expect(await langFilters[1].getVisibleText()).to.equal('typescript\n7');
|
||||
expect(await langFilters[2].getVisibleText()).to.equal('pug\n5');
|
||||
expect(await langFilters[3].getVisibleText()).to.equal('markdown\n1');
|
||||
});
|
||||
|
||||
await retry.tryForTime(5000, async () => {
|
||||
|
@ -121,10 +124,14 @@ export default function searchFunctonalTests({ getService, getPageObjects }: Ftr
|
|||
await testSubjects.click(languageFilterListSelector);
|
||||
|
||||
const results = await testSubjects.findAll(searchResultListSelector);
|
||||
expect(results).to.have.length(2);
|
||||
expect(results).to.have.length(9);
|
||||
|
||||
expect(await results[0].getVisibleText()).to.equal('src/controllers/user.ts');
|
||||
expect(await results[1].getVisibleText()).to.equal('src/models/User.ts');
|
||||
expect(await results[0].getVisibleText()).to.equal(
|
||||
'src/public/css/lib/bootstrap/mixins/_vendor-prefixes.scss'
|
||||
);
|
||||
expect(await results[1].getVisibleText()).to.equal(
|
||||
'src/public/css/themes/gsdk/gsdk/mixins/_vendor-prefixes.scss'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -4,8 +4,10 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { REPO_ROOT } from '@kbn/dev-utils';
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../ftr_provider_context';
|
||||
import { load as repoLoad, unload as repoUnload } from './repo_archiver';
|
||||
|
||||
export default function testWithSecurity({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
@ -19,15 +21,13 @@ export default function testWithSecurity({ getService, getPageObjects }: FtrProv
|
|||
const manageButtonSelectors = ['indexRepositoryButton', 'deleteRepositoryButton'];
|
||||
const log = getService('log');
|
||||
const security = getService('security');
|
||||
const config = getService('config');
|
||||
|
||||
describe('Security', () => {
|
||||
describe('with security enabled:', () => {
|
||||
before(async () => {
|
||||
await esArchiver.load('empty_kibana');
|
||||
await security.role.create('global_code_all_role', {
|
||||
elasticsearch: {
|
||||
indices: [],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
|
@ -45,9 +45,6 @@ export default function testWithSecurity({ getService, getPageObjects }: FtrProv
|
|||
});
|
||||
|
||||
await security.role.create('global_code_read_role', {
|
||||
elasticsearch: {
|
||||
indices: [],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
|
@ -65,6 +62,11 @@ export default function testWithSecurity({ getService, getPageObjects }: FtrProv
|
|||
});
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await PageObjects.security.logout();
|
||||
await esArchiver.unload('empty_kibana');
|
||||
});
|
||||
|
||||
async function login(user: string) {
|
||||
await PageObjects.security.logout();
|
||||
await PageObjects.security.login(user, dummyPassword);
|
||||
|
@ -88,18 +90,15 @@ export default function testWithSecurity({ getService, getPageObjects }: FtrProv
|
|||
});
|
||||
|
||||
it('only codeAdmin can manage repositories', async () => {
|
||||
await login(codeAdmin);
|
||||
await retry.tryForTime(5000, async () => {
|
||||
const buttons = await testSubjects.findAll('importRepositoryButton');
|
||||
expect(buttons).to.have.length(1);
|
||||
});
|
||||
await PageObjects.code.fillImportRepositoryUrlInputBox(
|
||||
'https://github.com/elastic/TypeScript-Node-Starter'
|
||||
await repoLoad(
|
||||
'github.com/elastic/TypeScript-Node-Starter',
|
||||
'typescript_node_starter',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
// Click the import repository button.
|
||||
await PageObjects.code.clickImportRepositoryButton();
|
||||
await esArchiver.load('code/repositories/typescript_node_starter');
|
||||
|
||||
await retry.tryForTime(300000, async () => {
|
||||
{
|
||||
await login(codeAdmin);
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(1);
|
||||
for (const buttonSelector of manageButtonSelectors) {
|
||||
|
@ -110,10 +109,10 @@ export default function testWithSecurity({ getService, getPageObjects }: FtrProv
|
|||
const importButton = await testSubjects.findAll('newProjectButton');
|
||||
expect(importButton).to.have.length(1);
|
||||
log.debug(`button newProjectButton found.`);
|
||||
});
|
||||
}
|
||||
|
||||
await login(codeUser);
|
||||
await retry.tryForTime(5000, async () => {
|
||||
{
|
||||
await login(codeUser);
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repositoryItems).to.have.length(1);
|
||||
for (const buttonSelector of manageButtonSelectors) {
|
||||
|
@ -122,36 +121,13 @@ export default function testWithSecurity({ getService, getPageObjects }: FtrProv
|
|||
}
|
||||
const importButton = await testSubjects.findAll('newProjectButton');
|
||||
expect(importButton).to.have.length(0);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function cleanProjects() {
|
||||
// remove imported project
|
||||
await login(codeAdmin);
|
||||
await retry.tryForTime(300000, async () => {
|
||||
const repositoryItems = await testSubjects.findAll(repositoryListSelector);
|
||||
if (repositoryItems.length > 0) {
|
||||
const deleteButton = await testSubjects.findAll('deleteRepositoryButton');
|
||||
if (deleteButton.length > 0) {
|
||||
await PageObjects.code.clickDeleteRepositoryButton();
|
||||
await retry.try(async () => {
|
||||
expect(await testSubjects.exists('confirmModalConfirmButton')).to.be(true);
|
||||
});
|
||||
|
||||
await testSubjects.click('confirmModalConfirmButton');
|
||||
}
|
||||
}
|
||||
await retry.try(async () => {
|
||||
const repoItems = await testSubjects.findAll(repositoryListSelector);
|
||||
expect(repoItems).to.have.length(0);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
after(async () => {
|
||||
await cleanProjects();
|
||||
await PageObjects.security.logout();
|
||||
await esArchiver.unload('code');
|
||||
await esArchiver.unload('code/repositories/typescript_node_starter');
|
||||
await repoUnload(
|
||||
'github.com/elastic/TypeScript-Node-Starter',
|
||||
config.get('kbnTestServer.installDir') || REPO_ROOT
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,243 +0,0 @@
|
|||
{
|
||||
"type": "index",
|
||||
"value": {
|
||||
"index": ".code-document-github.com-microsoft-typescript-node-starter-1",
|
||||
"settings": {
|
||||
"index": {
|
||||
"number_of_shards": "1",
|
||||
"number_of_replicas": "1",
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"lowercase_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"type": "custom",
|
||||
"tokenizer": "keyword"
|
||||
},
|
||||
"path_hierarchy_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"type": "custom",
|
||||
"tokenizer": "path_hierarchy_tokenizer"
|
||||
},
|
||||
"content_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"char_filter": [
|
||||
"content_char_filter"
|
||||
],
|
||||
"tokenizer": "standard"
|
||||
},
|
||||
"qname_path_hierarchy_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"type": "custom",
|
||||
"tokenizer": "qname_path_hierarchy_tokenizer"
|
||||
},
|
||||
"path_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"type": "custom",
|
||||
"tokenizer": "path_tokenizer"
|
||||
}
|
||||
},
|
||||
"char_filter": {
|
||||
"content_char_filter": {
|
||||
"pattern": "[.]",
|
||||
"type": "pattern_replace",
|
||||
"replacement": " "
|
||||
}
|
||||
},
|
||||
"tokenizer": {
|
||||
"path_hierarchy_tokenizer": {
|
||||
"reverse": "true",
|
||||
"type": "path_hierarchy",
|
||||
"delimiter": "/"
|
||||
},
|
||||
"path_tokenizer": {
|
||||
"pattern": "[\\\\./]",
|
||||
"type": "pattern"
|
||||
},
|
||||
"qname_path_hierarchy_tokenizer": {
|
||||
"reverse": "true",
|
||||
"type": "path_hierarchy",
|
||||
"delimiter": "."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"mappings": {
|
||||
"document": {
|
||||
"_meta": {
|
||||
"version": 1
|
||||
},
|
||||
"dynamic_templates": [
|
||||
{
|
||||
"fieldDefaultNotAnalyzed": {
|
||||
"match": "*",
|
||||
"mapping": {
|
||||
"index": false,
|
||||
"norms": false
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"content": {
|
||||
"type": "text",
|
||||
"analyzer": "content_analyzer"
|
||||
},
|
||||
"language": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"path": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
"hierarchy": {
|
||||
"type": "text",
|
||||
"analyzer": "path_hierarchy_analyzer"
|
||||
}
|
||||
},
|
||||
"analyzer": "path_analyzer"
|
||||
},
|
||||
"qnames": {
|
||||
"type": "text",
|
||||
"analyzer": "qname_path_hierarchy_analyzer"
|
||||
},
|
||||
"repoUri": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"repository": {
|
||||
"properties": {
|
||||
"defaultBranch": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"name": {
|
||||
"type": "text"
|
||||
},
|
||||
"org": {
|
||||
"type": "text"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
},
|
||||
"url": {
|
||||
"type": "text",
|
||||
"index": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_config": {
|
||||
"properties": {
|
||||
"disableGo": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"disableJava": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"disableTypescript": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_delete_status": {
|
||||
"properties": {
|
||||
"progress": {
|
||||
"type": "integer"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_git_status": {
|
||||
"properties": {
|
||||
"cloneProgress": {
|
||||
"properties": {
|
||||
"indexedDeltas": {
|
||||
"type": "integer"
|
||||
},
|
||||
"indexedObjects": {
|
||||
"type": "integer"
|
||||
},
|
||||
"isCloned": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"localObjects": {
|
||||
"type": "integer"
|
||||
},
|
||||
"receivedBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"receivedObjects": {
|
||||
"type": "integer"
|
||||
},
|
||||
"totalDeltas": {
|
||||
"type": "integer"
|
||||
},
|
||||
"totalObjects": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"progress": {
|
||||
"type": "integer"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_lsp_index_status": {
|
||||
"properties": {
|
||||
"progress": {
|
||||
"type": "integer"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sha1": {
|
||||
"type": "text",
|
||||
"index": false,
|
||||
"norms": false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"aliases": {
|
||||
".code-document-github.com-microsoft-typescript-node-starter": {}
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,480 @@
|
|||
{
|
||||
"type": "index",
|
||||
"value": {
|
||||
"aliases": {
|
||||
".code-document-github.com-elastic-code-examples_flatten-directory-40bb5fb7": {
|
||||
}
|
||||
},
|
||||
"index": ".code-document-github.com-elastic-code-examples_flatten-directory-40bb5fb7-1",
|
||||
"mappings": {
|
||||
"_meta": {
|
||||
"version": 1
|
||||
},
|
||||
"dynamic_templates": [
|
||||
{
|
||||
"fieldDefaultNotAnalyzed": {
|
||||
"mapping": {
|
||||
"index": false,
|
||||
"norms": false
|
||||
},
|
||||
"match": "*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"content": {
|
||||
"analyzer": "content_analyzer",
|
||||
"type": "text"
|
||||
},
|
||||
"language": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"path": {
|
||||
"analyzer": "path_analyzer",
|
||||
"fields": {
|
||||
"hierarchy": {
|
||||
"analyzer": "path_hierarchy_analyzer",
|
||||
"type": "text"
|
||||
},
|
||||
"keyword": {
|
||||
"type": "keyword"
|
||||
}
|
||||
},
|
||||
"type": "text"
|
||||
},
|
||||
"qnames": {
|
||||
"analyzer": "qname_path_hierarchy_analyzer",
|
||||
"type": "text"
|
||||
},
|
||||
"repoUri": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"repository": {
|
||||
"properties": {
|
||||
"defaultBranch": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"indexedRevision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"name": {
|
||||
"type": "text"
|
||||
},
|
||||
"nextUpdateTimestamp": {
|
||||
"index": false,
|
||||
"type": "date"
|
||||
},
|
||||
"org": {
|
||||
"type": "text"
|
||||
},
|
||||
"protocol": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
},
|
||||
"url": {
|
||||
"index": false,
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_config": {
|
||||
"properties": {
|
||||
"disableGo": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"disableJava": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"disableTypescript": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_delete_status": {
|
||||
"properties": {
|
||||
"progress": {
|
||||
"type": "integer"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_git_status": {
|
||||
"properties": {
|
||||
"cloneProgress": {
|
||||
"properties": {
|
||||
"indexedDeltas": {
|
||||
"type": "integer"
|
||||
},
|
||||
"indexedObjects": {
|
||||
"type": "integer"
|
||||
},
|
||||
"isCloned": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"localObjects": {
|
||||
"type": "integer"
|
||||
},
|
||||
"receivedBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"receivedObjects": {
|
||||
"type": "integer"
|
||||
},
|
||||
"totalDeltas": {
|
||||
"type": "integer"
|
||||
},
|
||||
"totalObjects": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"errorMessage": {
|
||||
"type": "text"
|
||||
},
|
||||
"progress": {
|
||||
"type": "integer"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_index_status": {
|
||||
"properties": {
|
||||
"commitIndexProgress": {
|
||||
"properties": {
|
||||
"checkpoint": {
|
||||
"type": "object"
|
||||
},
|
||||
"fail": {
|
||||
"type": "integer"
|
||||
},
|
||||
"percentage": {
|
||||
"type": "integer"
|
||||
},
|
||||
"success": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"indexProgress": {
|
||||
"properties": {
|
||||
"checkpoint": {
|
||||
"properties": {
|
||||
"filePath": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"repoUri": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"revision": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"fail": {
|
||||
"type": "integer"
|
||||
},
|
||||
"percentage": {
|
||||
"type": "integer"
|
||||
},
|
||||
"success": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"progress": {
|
||||
"type": "integer"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_random_path": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"sha1": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"index": {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"content_analyzer": {
|
||||
"char_filter": [
|
||||
"content_char_filter"
|
||||
],
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "standard"
|
||||
},
|
||||
"lowercase_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "keyword",
|
||||
"type": "custom"
|
||||
},
|
||||
"path_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "path_tokenizer",
|
||||
"type": "custom"
|
||||
},
|
||||
"path_hierarchy_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "path_hierarchy_tokenizer",
|
||||
"type": "custom"
|
||||
},
|
||||
"qname_path_hierarchy_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "qname_path_hierarchy_tokenizer",
|
||||
"type": "custom"
|
||||
}
|
||||
},
|
||||
"char_filter": {
|
||||
"content_char_filter": {
|
||||
"pattern": "[.]",
|
||||
"replacement": " ",
|
||||
"type": "pattern_replace"
|
||||
}
|
||||
},
|
||||
"tokenizer": {
|
||||
"path_hierarchy_tokenizer": {
|
||||
"delimiter": "/",
|
||||
"reverse": "true",
|
||||
"type": "path_hierarchy"
|
||||
},
|
||||
"path_tokenizer": {
|
||||
"pattern": "[\\\\./]",
|
||||
"type": "pattern"
|
||||
},
|
||||
"qname_path_hierarchy_tokenizer": {
|
||||
"delimiter": ".",
|
||||
"reverse": "true",
|
||||
"type": "path_hierarchy"
|
||||
}
|
||||
}
|
||||
},
|
||||
"auto_expand_replicas": "0-1",
|
||||
"number_of_replicas": "0",
|
||||
"number_of_shards": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"type": "index",
|
||||
"value": {
|
||||
"aliases": {
|
||||
".code-reference-github.com-elastic-code-examples_flatten-directory-40bb5fb7": {
|
||||
}
|
||||
},
|
||||
"index": ".code-reference-github.com-elastic-code-examples_flatten-directory-40bb5fb7-1",
|
||||
"mappings": {
|
||||
"_meta": {
|
||||
"version": 1
|
||||
},
|
||||
"dynamic_templates": [
|
||||
{
|
||||
"fieldDefaultNotAnalyzed": {
|
||||
"mapping": {
|
||||
"index": false,
|
||||
"norms": false
|
||||
},
|
||||
"match": "*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"location": {
|
||||
"properties": {
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"symbol": {
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"location": {
|
||||
"properties": {
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"index": {
|
||||
"auto_expand_replicas": "0-1",
|
||||
"number_of_replicas": "0",
|
||||
"number_of_shards": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"type": "index",
|
||||
"value": {
|
||||
"aliases": {
|
||||
".code-symbol-github.com-elastic-code-examples_flatten-directory-40bb5fb7": {
|
||||
}
|
||||
},
|
||||
"index": ".code-symbol-github.com-elastic-code-examples_flatten-directory-40bb5fb7-1",
|
||||
"mappings": {
|
||||
"_meta": {
|
||||
"version": 1
|
||||
},
|
||||
"dynamic_templates": [
|
||||
{
|
||||
"fieldDefaultNotAnalyzed": {
|
||||
"mapping": {
|
||||
"index": false,
|
||||
"norms": false
|
||||
},
|
||||
"match": "*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"qname": {
|
||||
"analyzer": "qname_path_hierarchy_case_sensitive_analyzer",
|
||||
"fields": {
|
||||
"lowercased": {
|
||||
"analyzer": "qname_path_hierarchy_case_insensitive_analyzer",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"type": "text"
|
||||
},
|
||||
"symbolInformation": {
|
||||
"properties": {
|
||||
"kind": {
|
||||
"index": false,
|
||||
"type": "integer"
|
||||
},
|
||||
"location": {
|
||||
"properties": {
|
||||
"uri": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"analyzer": "qname_path_hierarchy_case_sensitive_analyzer",
|
||||
"fields": {
|
||||
"lowercased": {
|
||||
"analyzer": "qname_path_hierarchy_case_insensitive_analyzer",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"index": {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"qname_path_hierarchy_case_insensitive_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "qname_path_hierarchy_tokenizer",
|
||||
"type": "custom"
|
||||
},
|
||||
"qname_path_hierarchy_case_sensitive_analyzer": {
|
||||
"tokenizer": "qname_path_hierarchy_tokenizer",
|
||||
"type": "custom"
|
||||
}
|
||||
},
|
||||
"tokenizer": {
|
||||
"qname_path_hierarchy_tokenizer": {
|
||||
"delimiter": ".",
|
||||
"reverse": "true",
|
||||
"type": "path_hierarchy"
|
||||
}
|
||||
}
|
||||
},
|
||||
"auto_expand_replicas": "0-1",
|
||||
"number_of_replicas": "0",
|
||||
"number_of_shards": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,546 @@
|
|||
{
|
||||
"type": "index",
|
||||
"value": {
|
||||
"aliases": {
|
||||
".code-document-github.com-elastic-typescript-node-starter-f7555f82": {
|
||||
}
|
||||
},
|
||||
"index": ".code-document-github.com-elastic-typescript-node-starter-f7555f82-1",
|
||||
"mappings": {
|
||||
"_meta": {
|
||||
"version": 1
|
||||
},
|
||||
"dynamic_templates": [
|
||||
{
|
||||
"fieldDefaultNotAnalyzed": {
|
||||
"mapping": {
|
||||
"index": false,
|
||||
"norms": false
|
||||
},
|
||||
"match": "*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"content": {
|
||||
"analyzer": "content_analyzer",
|
||||
"type": "text"
|
||||
},
|
||||
"language": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"path": {
|
||||
"analyzer": "path_analyzer",
|
||||
"fields": {
|
||||
"hierarchy": {
|
||||
"analyzer": "path_hierarchy_analyzer",
|
||||
"type": "text"
|
||||
},
|
||||
"keyword": {
|
||||
"type": "keyword"
|
||||
}
|
||||
},
|
||||
"type": "text"
|
||||
},
|
||||
"qnames": {
|
||||
"analyzer": "qname_path_hierarchy_analyzer",
|
||||
"type": "text"
|
||||
},
|
||||
"repoUri": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"repository": {
|
||||
"properties": {
|
||||
"defaultBranch": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"indexedRevision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"name": {
|
||||
"type": "text"
|
||||
},
|
||||
"nextUpdateTimestamp": {
|
||||
"index": false,
|
||||
"type": "date"
|
||||
},
|
||||
"org": {
|
||||
"type": "text"
|
||||
},
|
||||
"protocol": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
},
|
||||
"url": {
|
||||
"index": false,
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_config": {
|
||||
"properties": {
|
||||
"disableGo": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"disableJava": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"disableTypescript": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_delete_status": {
|
||||
"properties": {
|
||||
"progress": {
|
||||
"type": "integer"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_git_status": {
|
||||
"properties": {
|
||||
"cloneProgress": {
|
||||
"properties": {
|
||||
"indexedDeltas": {
|
||||
"type": "integer"
|
||||
},
|
||||
"indexedObjects": {
|
||||
"type": "integer"
|
||||
},
|
||||
"isCloned": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"localObjects": {
|
||||
"type": "integer"
|
||||
},
|
||||
"receivedBytes": {
|
||||
"type": "integer"
|
||||
},
|
||||
"receivedObjects": {
|
||||
"type": "integer"
|
||||
},
|
||||
"totalDeltas": {
|
||||
"type": "integer"
|
||||
},
|
||||
"totalObjects": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"errorMessage": {
|
||||
"type": "text"
|
||||
},
|
||||
"progress": {
|
||||
"type": "integer"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_index_status": {
|
||||
"properties": {
|
||||
"commitIndexProgress": {
|
||||
"properties": {
|
||||
"checkpoint": {
|
||||
"type": "object"
|
||||
},
|
||||
"fail": {
|
||||
"type": "integer"
|
||||
},
|
||||
"percentage": {
|
||||
"type": "integer"
|
||||
},
|
||||
"success": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"indexProgress": {
|
||||
"properties": {
|
||||
"checkpoint": {
|
||||
"properties": {
|
||||
"filePath": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"repoUri": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"revision": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"fail": {
|
||||
"type": "integer"
|
||||
},
|
||||
"percentage": {
|
||||
"type": "integer"
|
||||
},
|
||||
"success": {
|
||||
"type": "integer"
|
||||
},
|
||||
"total": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"progress": {
|
||||
"type": "integer"
|
||||
},
|
||||
"revision": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"repository_random_path": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"sha1": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"index": {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"content_analyzer": {
|
||||
"char_filter": [
|
||||
"content_char_filter"
|
||||
],
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "standard"
|
||||
},
|
||||
"lowercase_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "keyword",
|
||||
"type": "custom"
|
||||
},
|
||||
"path_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "path_tokenizer",
|
||||
"type": "custom"
|
||||
},
|
||||
"path_hierarchy_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "path_hierarchy_tokenizer",
|
||||
"type": "custom"
|
||||
},
|
||||
"qname_path_hierarchy_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "qname_path_hierarchy_tokenizer",
|
||||
"type": "custom"
|
||||
}
|
||||
},
|
||||
"char_filter": {
|
||||
"content_char_filter": {
|
||||
"pattern": "[.]",
|
||||
"replacement": " ",
|
||||
"type": "pattern_replace"
|
||||
}
|
||||
},
|
||||
"tokenizer": {
|
||||
"path_hierarchy_tokenizer": {
|
||||
"delimiter": "/",
|
||||
"reverse": "true",
|
||||
"type": "path_hierarchy"
|
||||
},
|
||||
"path_tokenizer": {
|
||||
"pattern": "[\\\\./]",
|
||||
"type": "pattern"
|
||||
},
|
||||
"qname_path_hierarchy_tokenizer": {
|
||||
"delimiter": ".",
|
||||
"reverse": "true",
|
||||
"type": "path_hierarchy"
|
||||
}
|
||||
}
|
||||
},
|
||||
"auto_expand_replicas": "0-1",
|
||||
"number_of_replicas": "0",
|
||||
"number_of_shards": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"type": "index",
|
||||
"value": {
|
||||
"aliases": {
|
||||
".code-reference-github.com-elastic-typescript-node-starter-f7555f82": {
|
||||
}
|
||||
},
|
||||
"index": ".code-reference-github.com-elastic-typescript-node-starter-f7555f82-1",
|
||||
"mappings": {
|
||||
"_meta": {
|
||||
"version": 1
|
||||
},
|
||||
"dynamic_templates": [
|
||||
{
|
||||
"fieldDefaultNotAnalyzed": {
|
||||
"mapping": {
|
||||
"index": false,
|
||||
"norms": false
|
||||
},
|
||||
"match": "*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"category": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"location": {
|
||||
"properties": {
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"symbol": {
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"location": {
|
||||
"properties": {
|
||||
"uri": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"index": {
|
||||
"auto_expand_replicas": "0-1",
|
||||
"number_of_replicas": "0",
|
||||
"number_of_shards": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"type": "index",
|
||||
"value": {
|
||||
"aliases": {
|
||||
".code-symbol-github.com-elastic-typescript-node-starter-f7555f82": {
|
||||
}
|
||||
},
|
||||
"index": ".code-symbol-github.com-elastic-typescript-node-starter-f7555f82-1",
|
||||
"mappings": {
|
||||
"_meta": {
|
||||
"version": 1
|
||||
},
|
||||
"dynamic_templates": [
|
||||
{
|
||||
"fieldDefaultNotAnalyzed": {
|
||||
"mapping": {
|
||||
"index": false,
|
||||
"norms": false
|
||||
},
|
||||
"match": "*"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"contents": {
|
||||
"properties": {
|
||||
"language": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"value": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"package": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"repoUri": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"version": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
},
|
||||
"qname": {
|
||||
"analyzer": "qname_path_hierarchy_case_sensitive_analyzer",
|
||||
"fields": {
|
||||
"lowercased": {
|
||||
"analyzer": "qname_path_hierarchy_case_insensitive_analyzer",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"type": "text"
|
||||
},
|
||||
"symbolInformation": {
|
||||
"properties": {
|
||||
"containerName": {
|
||||
"index": false,
|
||||
"norms": false,
|
||||
"type": "text"
|
||||
},
|
||||
"kind": {
|
||||
"index": false,
|
||||
"type": "integer"
|
||||
},
|
||||
"location": {
|
||||
"properties": {
|
||||
"range": {
|
||||
"properties": {
|
||||
"end": {
|
||||
"properties": {
|
||||
"character": {
|
||||
"index": false,
|
||||
"type": "long"
|
||||
},
|
||||
"line": {
|
||||
"index": false,
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
},
|
||||
"start": {
|
||||
"properties": {
|
||||
"character": {
|
||||
"index": false,
|
||||
"type": "long"
|
||||
},
|
||||
"line": {
|
||||
"index": false,
|
||||
"type": "long"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"uri": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"analyzer": "qname_path_hierarchy_case_sensitive_analyzer",
|
||||
"fields": {
|
||||
"lowercased": {
|
||||
"analyzer": "qname_path_hierarchy_case_insensitive_analyzer",
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"index": {
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"qname_path_hierarchy_case_insensitive_analyzer": {
|
||||
"filter": [
|
||||
"lowercase"
|
||||
],
|
||||
"tokenizer": "qname_path_hierarchy_tokenizer",
|
||||
"type": "custom"
|
||||
},
|
||||
"qname_path_hierarchy_case_sensitive_analyzer": {
|
||||
"tokenizer": "qname_path_hierarchy_tokenizer",
|
||||
"type": "custom"
|
||||
}
|
||||
},
|
||||
"tokenizer": {
|
||||
"qname_path_hierarchy_tokenizer": {
|
||||
"delimiter": ".",
|
||||
"reverse": "true",
|
||||
"type": "path_hierarchy"
|
||||
}
|
||||
}
|
||||
},
|
||||
"auto_expand_replicas": "0-1",
|
||||
"number_of_replicas": "0",
|
||||
"number_of_shards": "1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,6 +34,11 @@ export function CodeHomePageProvider({ getService }: FtrProviderContext) {
|
|||
return await testSubjects.click('importRepositoryButton');
|
||||
},
|
||||
|
||||
async clickIndexRepositoryButton() {
|
||||
log.info('Click index repository button.');
|
||||
return await testSubjects.click('indexRepositoryButton');
|
||||
},
|
||||
|
||||
async clickDeleteRepositoryButton() {
|
||||
log.info('Click delete repository button.');
|
||||
return await testSubjects.click('deleteRepositoryButton');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue