Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into actions_connector…
Browse files Browse the repository at this point in the history
…_ui_embedding

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information
YulNaumenko committed Mar 4, 2020
2 parents 9158097 + 692c1d0 commit 9612f3d
Show file tree
Hide file tree
Showing 134 changed files with 1,619 additions and 1,077 deletions.
21 changes: 21 additions & 0 deletions .ci/Jenkinsfile_visual_baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/groovy

library 'kibana-pipeline-library'
kibanaLibrary.load()

kibanaPipeline(timeoutMinutes: 120) {
catchError {
parallel([
workers.base(name: 'oss-visualRegression', label: 'linux && immutable') {
kibanaPipeline.buildOss()
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')
},
workers.base(name: 'xpack-visualRegression', label: 'linux && immutable') {
kibanaPipeline.buildXpack()
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')
},
])
}

kibanaPipeline.sendMail()
}
30 changes: 30 additions & 0 deletions packages/kbn-test/src/ci_parallel_process_prefix.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

const job = process.env.JOB ? `job-${process.env.JOB}-` : '';
const num = process.env.CI_PARALLEL_PROCESS_NUMBER
? `worker-${process.env.CI_PARALLEL_PROCESS_NUMBER}-`
: '';

/**
* A prefix string that is unique for each parallel CI process that
* is an empty string outside of CI, so it can be safely injected
* into strings as a prefix
*/
export const CI_PARALLEL_PROCESS_PREFIX = `${job}${num}`;
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ export async function runElasticsearch({ config, options }) {
esFrom: esFrom || config.get('esTestCluster.from'),
dataArchive: config.get('esTestCluster.dataArchive'),
esArgs,
esEnvVars,
ssl,
});

await cluster.start(esArgs, esEnvVars);
await cluster.start();

if (isSecurityEnabled) {
await setupUsers({
Expand Down
8 changes: 2 additions & 6 deletions packages/kbn-test/src/junit_report_path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@
*/

import { resolve } from 'path';

const job = process.env.JOB ? `job-${process.env.JOB}-` : '';
const num = process.env.CI_PARALLEL_PROCESS_NUMBER
? `worker-${process.env.CI_PARALLEL_PROCESS_NUMBER}-`
: '';
import { CI_PARALLEL_PROCESS_PREFIX } from './ci_parallel_process_prefix';

export function makeJunitReportPath(rootDirectory: string, reportName: string) {
return resolve(
rootDirectory,
'target/junit',
process.env.JOB || '.',
`TEST-${job}${num}${reportName}.xml`
`TEST-${CI_PARALLEL_PROCESS_PREFIX}${reportName}.xml`
);
}
30 changes: 16 additions & 14 deletions packages/kbn-test/src/legacy_es/legacy_es_test_cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { format } from 'url';
import { get } from 'lodash';
import toPath from 'lodash/internal/toPath';
import { Cluster } from '@kbn/es';
import { CI_PARALLEL_PROCESS_PREFIX } from '../ci_parallel_process_prefix';
import { esTestConfig } from './es_test_config';

import { KIBANA_ROOT } from '../';
Expand All @@ -38,14 +39,22 @@ export function createLegacyEsTestCluster(options = {}) {
basePath = resolve(KIBANA_ROOT, '.es'),
esFrom = esTestConfig.getBuildFrom(),
dataArchive,
esArgs,
esArgs: customEsArgs = [],
esEnvVars,
clusterName: customClusterName = 'es-test-cluster',
ssl,
} = options;

const randomHash = Math.random()
.toString(36)
.substring(2);
const clusterName = `test-${randomHash}`;
const clusterName = `${CI_PARALLEL_PROCESS_PREFIX}${customClusterName}`;

const esArgs = [
`cluster.name=${clusterName}`,
`http.port=${port}`,
'discovery.type=single-node',
`transport.port=${esTestConfig.getTransportPort()}`,
...customEsArgs,
];

const config = {
version: esTestConfig.getVersion(),
installPath: resolve(basePath, clusterName),
Expand All @@ -55,7 +64,6 @@ export function createLegacyEsTestCluster(options = {}) {
basePath,
esArgs,
};
const transportPort = esTestConfig.getTransportPort();

const cluster = new Cluster({ log, ssl });

Expand All @@ -67,7 +75,7 @@ export function createLegacyEsTestCluster(options = {}) {
return esFrom === 'snapshot' ? 3 * minute : 6 * minute;
}

async start(esArgs = [], esEnvVars) {
async start() {
let installPath;

if (esFrom === 'source') {
Expand All @@ -86,13 +94,7 @@ export function createLegacyEsTestCluster(options = {}) {

await cluster.start(installPath, {
password: config.password,
esArgs: [
`cluster.name=${clusterName}`,
`http.port=${port}`,
'discovery.type=single-node',
`transport.port=${transportPort}`,
...esArgs,
],
esArgs,
esEnvVars,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function ToolBarPagerButtons(props: Props) {
disabled={!props.hasNextPage}
data-test-subj="btnNextPage"
aria-label={i18n.translate(
'kbn.ddiscover.docTable.pager.toolbarPagerButtons.nextButtonAriaLabel',
'kbn.discover.docTable.pager.toolbarPagerButtons.nextButtonAriaLabel',
{
defaultMessage: 'Next page in table',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,17 @@ export class VegaBaseView {
*/
async removeFilterHandler(query, index) {
const indexId = await this._findIndex(index);
const filter = esFilters.buildQueryFilter(query, indexId);
const filterToRemove = esFilters.buildQueryFilter(query, indexId);

const currentFilters = this._filterManager.getFilters();
const existingFilter = currentFilters.find(filter =>
esFilters.compareFilters(filter, filterToRemove)
);

if (!existingFilter) return;

try {
this._filterManager.removeFilter(filter);
this._filterManager.removeFilter(existingFilter);
} catch (err) {
this.onError(err);
}
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/dashboard_snapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function({ getService, getPageObjects, updateBaselines }) {
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.timePicker.setLogstashDataRange();
await dashboardAddPanel.addVisualization('Rendering Test: tsvb-ts');
await PageObjects.common.closeToast();
await PageObjects.common.closeToastIfExists();

await PageObjects.dashboard.saveDashboard('tsvb');
await PageObjects.dashboard.clickFullScreenMode();
Expand All @@ -73,7 +73,7 @@ export default function({ getService, getPageObjects, updateBaselines }) {
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.timePicker.setLogstashDataRange();
await dashboardAddPanel.addVisualization('Rendering Test: area with not filter');
await PageObjects.common.closeToast();
await PageObjects.common.closeToastIfExists();

await PageObjects.dashboard.saveDashboard('area');
await PageObjects.dashboard.clickFullScreenMode();
Expand Down
7 changes: 7 additions & 0 deletions test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,13 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
return title;
}

async closeToastIfExists() {
const toastShown = await find.existsByCssSelector('.euiToast');
if (toastShown) {
await this.closeToast();
}
}

async clearAllToasts() {
const toasts = await find.allByCssSelector('.euiToast');
for (const toastElement of toasts) {
Expand Down
28 changes: 24 additions & 4 deletions test/functional/page_objects/visualize_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export function VisualizePageProvider({ getService, getPageObjects }: FtrProvide
await this.waitForVisualizationSelectPage();
}

public async hasVisType(type: string) {
return await testSubjects.exists(`visType-${type}`);
}

public async clickVisType(type: string) {
await testSubjects.click(`visType-${type}`);
await header.waitUntilLoadingHasFinished();
Expand All @@ -100,6 +104,10 @@ export function VisualizePageProvider({ getService, getPageObjects }: FtrProvide
await this.clickVisType('region_map');
}

public async hasRegionMap() {
return await this.hasVisType('region_map');
}

public async clickMarkdownWidget() {
await this.clickVisType('markdown');
}
Expand All @@ -120,6 +128,10 @@ export function VisualizePageProvider({ getService, getPageObjects }: FtrProvide
await this.clickVisType('tile_map');
}

public async hasTileMap() {
return await this.hasVisType('tile_map');
}

public async clickTagCloud() {
await this.clickVisType('tagcloud');
}
Expand All @@ -144,6 +156,18 @@ export function VisualizePageProvider({ getService, getPageObjects }: FtrProvide
await this.clickVisType('input_control_vis');
}

public async clickLensWidget() {
await this.clickVisType('lens');
}

public async clickMapsApp() {
await this.clickVisType('maps');
}

public async hasMapsApp() {
return await this.hasVisType('maps');
}

public async createSimpleMarkdownViz(vizName: string) {
await this.gotoVisualizationLandingPage();
await this.navigateToNewVisualization();
Expand Down Expand Up @@ -315,10 +339,6 @@ export function VisualizePageProvider({ getService, getPageObjects }: FtrProvide
async () => (await globalNav.getLastBreadcrumb()) === vizName
);
}

public async clickLensWidget() {
await this.clickVisType('lens');
}
}

return new VisualizePage();
Expand Down
38 changes: 25 additions & 13 deletions x-pack/legacy/plugins/maps/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export const LAYER_TYPE = {
HEATMAP: 'HEATMAP',
};

export const SORT_ORDER = {
ASC: 'asc',
DESC: 'desc',
};
export enum SORT_ORDER {
ASC = 'asc',
DESC = 'desc',
}

export const EMS_TMS = 'EMS_TMS';
export const EMS_FILE = 'EMS_FILE';
Expand Down Expand Up @@ -117,15 +117,27 @@ export const DRAW_TYPE = {
POLYGON: 'POLYGON',
};

export const AGG_TYPE = {
AVG: 'avg',
COUNT: 'count',
MAX: 'max',
MIN: 'min',
SUM: 'sum',
TERMS: 'terms',
UNIQUE_COUNT: 'cardinality',
};
export enum AGG_TYPE {
AVG = 'avg',
COUNT = 'count',
MAX = 'max',
MIN = 'min',
SUM = 'sum',
TERMS = 'terms',
UNIQUE_COUNT = 'cardinality',
}

export enum RENDER_AS {
HEATMAP = 'heatmap',
POINT = 'point',
GRID = 'grid',
}

export enum GRID_RESOLUTION {
COARSE = 'COARSE',
FINE = 'FINE',
MOST_FINE = 'MOST_FINE',
}

export const COUNT_PROP_LABEL = i18n.translate('xpack.maps.aggs.defaultCountLabel', {
defaultMessage: 'count',
Expand Down
Loading

0 comments on commit 9612f3d

Please sign in to comment.