Skip to content

Commit

Permalink
Merge branch 'master' into telemetry_collection_xpack-to-ts-project-r…
Browse files Browse the repository at this point in the history
…eferences
  • Loading branch information
kibanamachine authored Oct 21, 2020
2 parents 02c8118 + 858fa47 commit cc732dc
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 46 deletions.
8 changes: 7 additions & 1 deletion x-pack/plugins/apm/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

**Run E2E tests**


```sh
# In one terminal
node ./scripts/kibana --no-base-path --dev --no-dev-config --config x-pack/plugins/apm/e2e/ci/kibana.e2e.yml
# In another terminal
x-pack/plugins/apm/e2e/run-e2e.sh
```

_Starts APM Server, Elasticsearch (with sample data) and runs the tests_
Starts kibana, APM Server, Elasticsearch (with sample data) and runs the tests.

If you see errors about not all events being ingested correctly try running `cd kibana/x-pack/plugins/apm/e2e/tmp/apm-integration-testing && docker-compose down -v`
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
getNavigateToApp,
} from '../../../kibana_services';
import { getMapsSavedObjectLoader } from '../../bootstrap/services/gis_map_saved_object_loader';
import { getAppTitle } from '../../../../common/i18n_getters';

export const EMPTY_FILTER = '';

Expand Down Expand Up @@ -101,7 +102,8 @@ export class MapsListView extends React.Component {
async initMapList() {
this.fetchItems();
addHelpMenuToAppChrome();
getCoreChrome().docTitle.change('Maps');
getCoreChrome().docTitle.change(getAppTitle());
getCoreChrome().setBreadcrumbs([{ text: getAppTitle() }]);
}

_find = (search: string) => getMapsSavedObjectLoader().find(search, this.state.listingLimit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { i18n } from '@kbn/i18n';
import { getNavigateToApp } from '../../../kibana_services';
import { goToSpecifiedPath } from '../../maps_router';
import { getAppTitle } from '../../../../common/i18n_getters';

export const unsavedChangesWarning = i18n.translate(
'xpack.maps.breadCrumbs.unsavedChangesWarning',
Expand Down Expand Up @@ -37,9 +38,7 @@ export function getBreadcrumbs({
}

breadcrumbs.push({
text: i18n.translate('xpack.maps.mapController.mapsBreadcrumbLabel', {
defaultMessage: 'Maps',
}),
text: getAppTitle(),
onClick: () => {
if (getHasUnsavedChanges()) {
const navigateAway = window.confirm(unsavedChangesWarning);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import dateMath from '@elastic/datemath';
import moment from 'moment';

import { EqlSearchStrategyResponse } from '../../../../../data_enhanced/common';
Expand All @@ -24,64 +23,64 @@ import { getMockEqlResponse, getMockEqlSequenceResponse } from './eql_search_res

describe('eql/helpers', () => {
describe('calculateBucketForHour', () => {
test('returns 2 if event occurred within 2 minutes of "now"', () => {
test('returns 2 if the difference in times is 2 minutes', () => {
const diff = calculateBucketForHour(
Number(dateMath.parse('now-1m')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T05:56:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(2);
});

test('returns 10 if event occurred within 8-10 minutes of "now"', () => {
test('returns 10 if the difference in times is 8-10 minutes', () => {
const diff = calculateBucketForHour(
Number(dateMath.parse('now-9m')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T05:48:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(10);
});

test('returns 16 if event occurred within 10-15 minutes of "now"', () => {
test('returns 16 if the difference in times is 10-15 minutes', () => {
const diff = calculateBucketForHour(
Number(dateMath.parse('now-15m')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T05:42:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(16);
});

test('returns 60 if event occurred within 58-60 minutes of "now"', () => {
test('returns 60 if the difference in times is 58-60 minutes', () => {
const diff = calculateBucketForHour(
Number(dateMath.parse('now-59m')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T04:58:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(60);
});

test('returns exact time difference if it is a multiple of 2', () => {
const diff = calculateBucketForHour(
Number(dateMath.parse('now-20m')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T05:37:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(20);
});

test('returns 0 if times are equal', () => {
const diff = calculateBucketForHour(
Number(dateMath.parse('now')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T05:57:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(0);
});

test('returns 2 if event occurred within 2 minutes of "now" but arguments are flipped', () => {
test('returns 2 if the difference in times is 2 minutes but arguments are flipped', () => {
const diff = calculateBucketForHour(
Number(dateMath.parse('now')?.format('x')),
Number(dateMath.parse('now-1m')?.format('x'))
Date.parse('2020-02-20T05:57:54.037Z'),
Date.parse('2020-02-20T05:56:54.037Z')
);

expect(diff).toEqual(2);
Expand All @@ -91,53 +90,53 @@ describe('eql/helpers', () => {
describe('calculateBucketForDay', () => {
test('returns 0 if two dates are equivalent', () => {
const diff = calculateBucketForDay(
Number(dateMath.parse('now')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T05:57:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(0);
});

test('returns 1 if event occurred within 60 minutes of "now"', () => {
test('returns 1 if the difference in times is 60 minutes', () => {
const diff = calculateBucketForDay(
Number(dateMath.parse('now-40m')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T05:17:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(1);
});

test('returns 2 if event occurred 60-120 minutes from "now"', () => {
test('returns 2 if the difference in times is 60-120 minutes', () => {
const diff = calculateBucketForDay(
Number(dateMath.parse('now-120m')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T03:57:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(2);
});

test('returns 3 if event occurred 120-180 minutes from "now', () => {
test('returns 3 if the difference in times is 120-180 minutes', () => {
const diff = calculateBucketForDay(
Number(dateMath.parse('now-121m')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T03:56:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(3);
});

test('returns 4 if event occurred 180-240 minutes from "now', () => {
test('returns 4 if the difference in times is 180-240 minutes', () => {
const diff = calculateBucketForDay(
Number(dateMath.parse('now-220m')?.format('x')),
Number(dateMath.parse('now')?.format('x'))
Date.parse('2020-02-20T02:15:54.037Z'),
Date.parse('2020-02-20T05:57:54.037Z')
);

expect(diff).toEqual(4);
});

test('returns 2 if event occurred 60-120 minutes of "now" but arguments are flipped', () => {
test('returns 2 if the difference in times is 60-120 minutes but arguments are flipped', () => {
const diff = calculateBucketForDay(
Number(dateMath.parse('now')?.format('x')),
Number(dateMath.parse('now-118m')?.format('x'))
Date.parse('2020-02-20T05:57:54.037Z'),
Date.parse('2020-02-20T03:59:54.037Z')
);

expect(diff).toEqual(2);
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -11358,7 +11358,6 @@
"xpack.maps.layerWizardSelect.solutionsCategoryLabel": "ソリューション",
"xpack.maps.loadMap.errorAttemptingToLoadSavedMap": "マップを読み込めません",
"xpack.maps.map.initializeErrorTitle": "マップを初期化できません",
"xpack.maps.mapController.mapsBreadcrumbLabel": "マップ",
"xpack.maps.mapEmbeddableFactory.invalidLayerList": "不正な形式のレイヤーリストによりマップを読み込めません",
"xpack.maps.mapEmbeddableFactory.invalidSavedObject": "不正な形式の保存済みオブジェクトによりマップを読み込めません",
"xpack.maps.mapListing.advancedSettingsLinkText": "高度な設定",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -11371,7 +11371,6 @@
"xpack.maps.layerWizardSelect.solutionsCategoryLabel": "解决方案",
"xpack.maps.loadMap.errorAttemptingToLoadSavedMap": "无法加载地图",
"xpack.maps.map.initializeErrorTitle": "无法初始化地图",
"xpack.maps.mapController.mapsBreadcrumbLabel": "Maps",
"xpack.maps.mapEmbeddableFactory.invalidLayerList": "无法加载地图,图层列表格式不正确",
"xpack.maps.mapEmbeddableFactory.invalidSavedObject": "无法加载地图,已保存对象格式错误",
"xpack.maps.mapListing.advancedSettingsLinkText": "高级设置",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export default function ApiTest({ getService }: FtrProviderContext) {
const fieldNames =
'user.username,user.id,host.ip,user_agent.name,kubernetes.pod.uuid,url.domain,container.id,service.node.name';

describe('Slow durations', () => {
// Failing: See https://github.com/elastic/kibana/issues/81264
describe.skip('Slow durations', () => {
const url = format({
pathname: `/api/apm/correlations/slow_durations`,
query: { start, end, durationPercentile, fieldNames },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default function ({ getService, getPageObjects }) {
const nodesList = getService('monitoringElasticsearchNodes');
const nodeDetail = getService('monitoringElasticsearchNodeDetail');

describe('Elasticsearch node detail', () => {
// Failing: See https://github.com/elastic/kibana/issues/81166
describe.skip('Elasticsearch node detail', () => {
describe('Active Nodes', () => {
const { setup, tearDown } = getLifecycleMethods(getService, getPageObjects);

Expand Down

0 comments on commit cc732dc

Please sign in to comment.