Skip to content

Commit ea81cc2

Browse files
Merge branch 'master' into fix/moment
2 parents 4d200d1 + 5539d69 commit ea81cc2

139 files changed

Lines changed: 1783 additions & 1311 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/Jenkinsfile_visual_baseline

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/groovy
2+
3+
library 'kibana-pipeline-library'
4+
kibanaLibrary.load()
5+
6+
kibanaPipeline(timeoutMinutes: 120) {
7+
catchError {
8+
parallel([
9+
workers.base(name: 'oss-visualRegression', label: 'linux && immutable') {
10+
kibanaPipeline.buildOss()
11+
kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')
12+
},
13+
workers.base(name: 'xpack-visualRegression', label: 'linux && immutable') {
14+
kibanaPipeline.buildXpack()
15+
kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')
16+
},
17+
])
18+
}
19+
20+
kibanaPipeline.sendMail()
21+
}

packages/kbn-storybook/storybook_config/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ addParameters({
5555
brandTitle: 'Kibana Storybook',
5656
brandUrl: 'https://github.com/elastic/kibana/tree/master/packages/kbn-storybook',
5757
}),
58-
showPanel: true,
58+
showPanel: false,
5959
isFullscreen: false,
6060
panelPosition: 'bottom',
6161
isToolshown: true,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
const job = process.env.JOB ? `job-${process.env.JOB}-` : '';
21+
const num = process.env.CI_PARALLEL_PROCESS_NUMBER
22+
? `worker-${process.env.CI_PARALLEL_PROCESS_NUMBER}-`
23+
: '';
24+
25+
/**
26+
* A prefix string that is unique for each parallel CI process that
27+
* is an empty string outside of CI, so it can be safely injected
28+
* into strings as a prefix
29+
*/
30+
export const CI_PARALLEL_PROCESS_PREFIX = `${job}${num}`;

packages/kbn-test/src/functional_tests/lib/run_elasticsearch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ export async function runElasticsearch({ config, options }) {
4242
esFrom: esFrom || config.get('esTestCluster.from'),
4343
dataArchive: config.get('esTestCluster.dataArchive'),
4444
esArgs,
45+
esEnvVars,
4546
ssl,
4647
});
4748

48-
await cluster.start(esArgs, esEnvVars);
49+
await cluster.start();
4950

5051
if (isSecurityEnabled) {
5152
await setupUsers({

packages/kbn-test/src/junit_report_path.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@
1818
*/
1919

2020
import { resolve } from 'path';
21-
22-
const job = process.env.JOB ? `job-${process.env.JOB}-` : '';
23-
const num = process.env.CI_PARALLEL_PROCESS_NUMBER
24-
? `worker-${process.env.CI_PARALLEL_PROCESS_NUMBER}-`
25-
: '';
21+
import { CI_PARALLEL_PROCESS_PREFIX } from './ci_parallel_process_prefix';
2622

2723
export function makeJunitReportPath(rootDirectory: string, reportName: string) {
2824
return resolve(
2925
rootDirectory,
3026
'target/junit',
3127
process.env.JOB || '.',
32-
`TEST-${job}${num}${reportName}.xml`
28+
`TEST-${CI_PARALLEL_PROCESS_PREFIX}${reportName}.xml`
3329
);
3430
}

packages/kbn-test/src/legacy_es/legacy_es_test_cluster.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { format } from 'url';
2222
import { get } from 'lodash';
2323
import toPath from 'lodash/internal/toPath';
2424
import { Cluster } from '@kbn/es';
25+
import { CI_PARALLEL_PROCESS_PREFIX } from '../ci_parallel_process_prefix';
2526
import { esTestConfig } from './es_test_config';
2627

2728
import { KIBANA_ROOT } from '../';
@@ -38,14 +39,22 @@ export function createLegacyEsTestCluster(options = {}) {
3839
basePath = resolve(KIBANA_ROOT, '.es'),
3940
esFrom = esTestConfig.getBuildFrom(),
4041
dataArchive,
41-
esArgs,
42+
esArgs: customEsArgs = [],
43+
esEnvVars,
44+
clusterName: customClusterName = 'es-test-cluster',
4245
ssl,
4346
} = options;
4447

45-
const randomHash = Math.random()
46-
.toString(36)
47-
.substring(2);
48-
const clusterName = `test-${randomHash}`;
48+
const clusterName = `${CI_PARALLEL_PROCESS_PREFIX}${customClusterName}`;
49+
50+
const esArgs = [
51+
`cluster.name=${clusterName}`,
52+
`http.port=${port}`,
53+
'discovery.type=single-node',
54+
`transport.port=${esTestConfig.getTransportPort()}`,
55+
...customEsArgs,
56+
];
57+
4958
const config = {
5059
version: esTestConfig.getVersion(),
5160
installPath: resolve(basePath, clusterName),
@@ -55,7 +64,6 @@ export function createLegacyEsTestCluster(options = {}) {
5564
basePath,
5665
esArgs,
5766
};
58-
const transportPort = esTestConfig.getTransportPort();
5967

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

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

70-
async start(esArgs = [], esEnvVars) {
78+
async start() {
7179
let installPath;
7280

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

8795
await cluster.start(installPath, {
8896
password: config.password,
89-
esArgs: [
90-
`cluster.name=${clusterName}`,
91-
`http.port=${port}`,
92-
'discovery.type=single-node',
93-
`transport.port=${transportPort}`,
94-
...esArgs,
95-
],
97+
esArgs,
9698
esEnvVars,
9799
});
98100
}

src/legacy/core_plugins/kibana/public/discover/np_ready/angular/doc_table/components/pager/tool_bar_pager_buttons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function ToolBarPagerButtons(props: Props) {
4949
disabled={!props.hasNextPage}
5050
data-test-subj="btnNextPage"
5151
aria-label={i18n.translate(
52-
'kbn.ddiscover.docTable.pager.toolbarPagerButtons.nextButtonAriaLabel',
52+
'kbn.discover.docTable.pager.toolbarPagerButtons.nextButtonAriaLabel',
5353
{
5454
defaultMessage: 'Next page in table',
5555
}

src/legacy/core_plugins/vis_type_vega/public/vega_view/vega_base_view.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,17 @@ export class VegaBaseView {
279279
*/
280280
async removeFilterHandler(query, index) {
281281
const indexId = await this._findIndex(index);
282-
const filter = esFilters.buildQueryFilter(query, indexId);
282+
const filterToRemove = esFilters.buildQueryFilter(query, indexId);
283+
284+
const currentFilters = this._filterManager.getFilters();
285+
const existingFilter = currentFilters.find(filter =>
286+
esFilters.compareFilters(filter, filterToRemove)
287+
);
288+
289+
if (!existingFilter) return;
283290

284291
try {
285-
this._filterManager.removeFilter(filter);
292+
this._filterManager.removeFilter(existingFilter);
286293
} catch (err) {
287294
this.onError(err);
288295
}

test/functional/apps/dashboard/dashboard_snapshots.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function({ getService, getPageObjects, updateBaselines }) {
5050
await PageObjects.dashboard.clickNewDashboard();
5151
await PageObjects.timePicker.setLogstashDataRange();
5252
await dashboardAddPanel.addVisualization('Rendering Test: tsvb-ts');
53-
await PageObjects.common.closeToast();
53+
await PageObjects.common.closeToastIfExists();
5454

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

7878
await PageObjects.dashboard.saveDashboard('area');
7979
await PageObjects.dashboard.clickFullScreenMode();

test/functional/page_objects/common_page.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,13 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
435435
return title;
436436
}
437437

438+
async closeToastIfExists() {
439+
const toastShown = await find.existsByCssSelector('.euiToast');
440+
if (toastShown) {
441+
await this.closeToast();
442+
}
443+
}
444+
438445
async clearAllToasts() {
439446
const toasts = await find.allByCssSelector('.euiToast');
440447
for (const toastElement of toasts) {

0 commit comments

Comments
 (0)