From 3798674043f83be34540f8af155905bad5736deb Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Tue, 10 Sep 2019 16:47:28 +0200 Subject: [PATCH 1/3] De-angularize and EUI-ficate Discover Context control elements (#44474) * Create ActionBar component, merges loading button and size picker * Use react component, remove angular code * Migrate constants + state to typescript * Remove unused increaseCount functions + tests * Add jest test --- .../kibana/public/context/NOTES.md | 4 +- .../kibana/public/context/_index.scss | 2 +- .../kibana/public/context/app.html | 103 +++-------- .../core_plugins/kibana/public/context/app.js | 3 +- .../components/action_bar/_action_bar.scss | 10 ++ .../context/components/action_bar/_index.scss | 1 + .../components/action_bar/action_bar.test.tsx | 94 ++++++++++ .../components/action_bar/action_bar.tsx | 164 ++++++++++++++++++ .../action_bar_directive.ts} | 8 +- .../action_bar/action_bar_warning.tsx | 72 ++++++++ .../index.js => action_bar/index.ts} | 2 +- .../loading_button/loading_button.html | 12 -- .../loading_button/loading_button.js | 40 ----- .../components/size_picker/_index.scss | 1 - .../components/size_picker/_size_picker.scss | 14 -- .../components/size_picker/size_picker.html | 7 - .../components/size_picker/size_picker.js | 64 ------- .../kibana/public/context/query/actions.js | 14 -- .../action_increase_predecessor_count.js | 69 -------- .../action_increase_successor_count.js | 69 -------- .../context/query_parameters/actions.js | 14 -- .../{constants.js => constants.ts} | 1 - .../query_parameters/{state.js => state.ts} | 5 +- test/functional/page_objects/context_page.js | 8 +- .../translations/translations/ja-JP.json | 1 - .../translations/translations/zh-CN.json | 1 - 26 files changed, 382 insertions(+), 401 deletions(-) create mode 100644 src/legacy/core_plugins/kibana/public/context/components/action_bar/_action_bar.scss create mode 100644 src/legacy/core_plugins/kibana/public/context/components/action_bar/_index.scss create mode 100644 src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar.test.tsx create mode 100644 src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar.tsx rename src/legacy/core_plugins/kibana/public/context/components/{size_picker/index.js => action_bar/action_bar_directive.ts} (73%) create mode 100644 src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar_warning.tsx rename src/legacy/core_plugins/kibana/public/context/components/{loading_button/index.js => action_bar/index.ts} (96%) delete mode 100644 src/legacy/core_plugins/kibana/public/context/components/loading_button/loading_button.html delete mode 100644 src/legacy/core_plugins/kibana/public/context/components/loading_button/loading_button.js delete mode 100644 src/legacy/core_plugins/kibana/public/context/components/size_picker/_index.scss delete mode 100644 src/legacy/core_plugins/kibana/public/context/components/size_picker/_size_picker.scss delete mode 100644 src/legacy/core_plugins/kibana/public/context/components/size_picker/size_picker.html delete mode 100644 src/legacy/core_plugins/kibana/public/context/components/size_picker/size_picker.js delete mode 100644 src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_predecessor_count.js delete mode 100644 src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_successor_count.js rename src/legacy/core_plugins/kibana/public/context/query_parameters/{constants.js => constants.ts} (99%) rename src/legacy/core_plugins/kibana/public/context/query_parameters/{state.js => state.ts} (89%) diff --git a/src/legacy/core_plugins/kibana/public/context/NOTES.md b/src/legacy/core_plugins/kibana/public/context/NOTES.md index 07f6533403c4..445080c21599 100644 --- a/src/legacy/core_plugins/kibana/public/context/NOTES.md +++ b/src/legacy/core_plugins/kibana/public/context/NOTES.md @@ -81,11 +81,9 @@ query status and results. **query_parameters**: Exports the actions, reducers and selectors related to the parameters used to construct the query. -**components/loading_button**: Defines the `` +**components/action_bar**: Defines the `` directive including its respective styles. -**components/size_picker**: Defines the `` -directive including its respective styles. **api/anchor.js**: Exports `fetchAnchor()` that creates and executes the query for the anchor document. diff --git a/src/legacy/core_plugins/kibana/public/context/_index.scss b/src/legacy/core_plugins/kibana/public/context/_index.scss index b605bc3d6ede..49293fa1b8ad 100644 --- a/src/legacy/core_plugins/kibana/public/context/_index.scss +++ b/src/legacy/core_plugins/kibana/public/context/_index.scss @@ -5,4 +5,4 @@ // cxtChart__legend--small // cxtChart__legend-isLoading -@import 'components/size_picker/index'; +@import 'components/action_bar/index'; diff --git a/src/legacy/core_plugins/kibana/public/context/app.html b/src/legacy/core_plugins/kibana/public/context/app.html index 997c167920f7..68e1d536a91c 100644 --- a/src/legacy/core_plugins/kibana/public/context/app.html +++ b/src/legacy/core_plugins/kibana/public/context/app.html @@ -62,48 +62,19 @@ ng-if="contextApp.state.loadingStatus.anchor.status !== contextApp.constants.LOADING_STATUS.FAILED" > -
-
- - - - - - - - - -
+ type="'predecessors'" + > -
-
-
-
-
- - - - -
- - - - -
- -
-
-
+ diff --git a/src/legacy/core_plugins/kibana/public/context/app.js b/src/legacy/core_plugins/kibana/public/context/app.js index 346d51398e8a..6b10d80078f8 100644 --- a/src/legacy/core_plugins/kibana/public/context/app.js +++ b/src/legacy/core_plugins/kibana/public/context/app.js @@ -22,8 +22,7 @@ import _ from 'lodash'; import { callAfterBindingsWorkaround } from 'ui/compat'; import { uiModules } from 'ui/modules'; import contextAppTemplate from './app.html'; -import './components/loading_button'; -import './components/size_picker/size_picker'; +import './components/action_bar'; import { getFirstSortableField } from './api/utils/sorting'; import { createInitialQueryParametersState, diff --git a/src/legacy/core_plugins/kibana/public/context/components/action_bar/_action_bar.scss b/src/legacy/core_plugins/kibana/public/context/components/action_bar/_action_bar.scss new file mode 100644 index 000000000000..da0911c3a452 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/context/components/action_bar/_action_bar.scss @@ -0,0 +1,10 @@ +.cxtSizePicker { + text-align: center; + width: $euiSize * 5; + + &::-webkit-outer-spin-button, + &::-webkit-inner-spin-button { + appearance: none; // Hide increment and decrement buttons for type="number" input. + margin: 0; + } +} diff --git a/src/legacy/core_plugins/kibana/public/context/components/action_bar/_index.scss b/src/legacy/core_plugins/kibana/public/context/components/action_bar/_index.scss new file mode 100644 index 000000000000..1f54ecea5e1c --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/context/components/action_bar/_index.scss @@ -0,0 +1 @@ +@import './action_bar'; diff --git a/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar.test.tsx b/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar.test.tsx new file mode 100644 index 000000000000..325cfb2c9f0b --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar.test.tsx @@ -0,0 +1,94 @@ +/* + * 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. + */ + +import React from 'react'; +import { mountWithIntl } from 'test_utils/enzyme_helpers'; +import { ActionBar, ActionBarProps } from './action_bar'; +// @ts-ignore +import { findTestSubject } from '@elastic/eui/lib/test'; +import { MAX_CONTEXT_SIZE, MIN_CONTEXT_SIZE } from '../../query_parameters/constants'; + +describe('Test Discover Context ActionBar for successor | predecessor records', () => { + ['successors', 'predecessors'].forEach(type => { + const onChangeCount = jest.fn(); + const props = { + defaultStepSize: 5, + docCount: 20, + docCountAvailable: 0, + isDisabled: false, + isLoading: false, + onChangeCount, + type, + } as ActionBarProps; + const wrapper = mountWithIntl(); + + const input = findTestSubject(wrapper, `${type}CountPicker`); + const btn = findTestSubject(wrapper, `${type}LoadMoreButton`); + + test(`${type}: Load button click`, () => { + btn.simulate('click'); + expect(onChangeCount).toHaveBeenCalledWith(25); + }); + + test(`${type}: Load button click doesnt submit when MAX_CONTEXT_SIZE was reached`, () => { + onChangeCount.mockClear(); + input.simulate('change', { target: { valueAsNumber: MAX_CONTEXT_SIZE } }); + btn.simulate('click'); + expect(onChangeCount).toHaveBeenCalledTimes(0); + }); + + test(`${type}: Count input change submits on blur`, () => { + input.simulate('change', { target: { valueAsNumber: 123 } }); + input.simulate('blur'); + expect(onChangeCount).toHaveBeenCalledWith(123); + }); + + test(`${type}: Count input change submits on return`, () => { + input.simulate('change', { target: { valueAsNumber: 124 } }); + input.simulate('submit'); + expect(onChangeCount).toHaveBeenCalledWith(124); + }); + + test(`${type}: Count input doesnt submits values higher than MAX_CONTEXT_SIZE `, () => { + onChangeCount.mockClear(); + input.simulate('change', { target: { valueAsNumber: MAX_CONTEXT_SIZE + 1 } }); + input.simulate('submit'); + expect(onChangeCount).toHaveBeenCalledTimes(0); + }); + + test(`${type}: Count input doesnt submits values lower than MIN_CONTEXT_SIZE `, () => { + onChangeCount.mockClear(); + input.simulate('change', { target: { valueAsNumber: MIN_CONTEXT_SIZE - 1 } }); + input.simulate('submit'); + expect(onChangeCount).toHaveBeenCalledTimes(0); + }); + + test(`${type}: Warning about limitation of additional records`, () => { + if (type === 'predecessors') { + expect(findTestSubject(wrapper, 'predecessorsWarningMsg').text()).toBe( + 'No documents newer than the anchor could be found.' + ); + } else { + expect(findTestSubject(wrapper, 'successorsWarningMsg').text()).toBe( + 'No documents older than the anchor could be found.' + ); + } + }); + }); +}); diff --git a/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar.tsx b/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar.tsx new file mode 100644 index 000000000000..57ad8e0b1040 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar.tsx @@ -0,0 +1,164 @@ +/* + * 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. + */ +import React, { useState } from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { + EuiButtonEmpty, + EuiFieldNumber, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiSpacer, +} from '@elastic/eui'; +import { ActionBarWarning } from './action_bar_warning'; +import { SurrDocType } from '../../api/context'; +import { MAX_CONTEXT_SIZE, MIN_CONTEXT_SIZE } from '../../query_parameters/constants'; + +export interface ActionBarProps { + /** + * the number of documents fetched initially and added when the load button is clicked + */ + defaultStepSize: number; + /** + * the number of docs to be displayed + */ + docCount: number; + /** + * the number of documents that are available + * display warning when it's lower than docCount + */ + docCountAvailable: number; + /** + * is true while the anchor record is fetched + */ + isDisabled: boolean; + /** + * is true when list entries are fetched + */ + isLoading: boolean; + /** + * is triggered when the input containing count is changed + * @param count + */ + onChangeCount: (count: number) => void; + /** + * can be `predecessors` or `successors`, usage in context: + * predecessors action bar + records (these are newer records) + * anchor record + * successors records + action bar (these are older records) + */ + type: SurrDocType; +} + +export function ActionBar({ + defaultStepSize, + docCount, + docCountAvailable, + isDisabled, + isLoading, + onChangeCount, + type, +}: ActionBarProps) { + const showWarning = !isDisabled && !isLoading && docCountAvailable < docCount; + const isSuccessor = type === 'successors'; + const [newDocCount, setNewDocCount] = useState(docCount); + const isValid = (value: number) => value >= MIN_CONTEXT_SIZE && value <= MAX_CONTEXT_SIZE; + const onSubmit = (ev: React.FormEvent) => { + ev.preventDefault(); + if (newDocCount !== docCount && isValid(newDocCount)) { + onChangeCount(newDocCount); + } + }; + + return ( +
+ {isSuccessor && } + {isSuccessor && showWarning && } + {isSuccessor && showWarning && } + + + { + const value = newDocCount + defaultStepSize; + if (isValid(value)) { + setNewDocCount(value); + onChangeCount(value); + } + }} + flush="right" + > + + + + + + { + setNewDocCount(ev.target.valueAsNumber); + }} + onBlur={() => { + if (newDocCount !== docCount && isValid(newDocCount)) { + onChangeCount(newDocCount); + } + }} + type="number" + value={newDocCount >= 0 ? newDocCount : ''} + /> + + + + + {isSuccessor ? ( + + ) : ( + + )} + + + + {!isSuccessor && showWarning && } + {!isSuccessor && } + + ); +} diff --git a/src/legacy/core_plugins/kibana/public/context/components/size_picker/index.js b/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar_directive.ts similarity index 73% rename from src/legacy/core_plugins/kibana/public/context/components/size_picker/index.js rename to src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar_directive.ts index 034044dabff6..0942539e6378 100644 --- a/src/legacy/core_plugins/kibana/public/context/components/size_picker/index.js +++ b/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar_directive.ts @@ -16,5 +16,11 @@ * specific language governing permissions and limitations * under the License. */ +// @ts-ignore +import { uiModules } from 'ui/modules'; +import { wrapInI18nContext } from 'ui/i18n'; +import { ActionBar } from './action_bar'; -import './size_picker'; +uiModules.get('apps/context').directive('contextActionBar', function(reactDirective: any) { + return reactDirective(wrapInI18nContext(ActionBar)); +}); diff --git a/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar_warning.tsx b/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar_warning.tsx new file mode 100644 index 000000000000..6b922bb05a24 --- /dev/null +++ b/src/legacy/core_plugins/kibana/public/context/components/action_bar/action_bar_warning.tsx @@ -0,0 +1,72 @@ +/* + * 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. + */ +import React from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiCallOut } from '@elastic/eui'; +import { SurrDocType } from '../../api/context'; + +export function ActionBarWarning({ docCount, type }: { docCount: number; type: SurrDocType }) { + if (type === 'predecessors') { + return ( + + ) : ( + + ) + } + size="s" + /> + ); + } + + return ( + + ) : ( + + ) + } + size="s" + /> + ); +} diff --git a/src/legacy/core_plugins/kibana/public/context/components/loading_button/index.js b/src/legacy/core_plugins/kibana/public/context/components/action_bar/index.ts similarity index 96% rename from src/legacy/core_plugins/kibana/public/context/components/loading_button/index.js rename to src/legacy/core_plugins/kibana/public/context/components/action_bar/index.ts index b9cdff8e26a5..de16caef9c77 100644 --- a/src/legacy/core_plugins/kibana/public/context/components/loading_button/index.js +++ b/src/legacy/core_plugins/kibana/public/context/components/action_bar/index.ts @@ -17,4 +17,4 @@ * under the License. */ -import './loading_button'; +import './action_bar_directive'; diff --git a/src/legacy/core_plugins/kibana/public/context/components/loading_button/loading_button.html b/src/legacy/core_plugins/kibana/public/context/components/loading_button/loading_button.html deleted file mode 100644 index b994ede80dbe..000000000000 --- a/src/legacy/core_plugins/kibana/public/context/components/loading_button/loading_button.html +++ /dev/null @@ -1,12 +0,0 @@ - diff --git a/src/legacy/core_plugins/kibana/public/context/components/loading_button/loading_button.js b/src/legacy/core_plugins/kibana/public/context/components/loading_button/loading_button.js deleted file mode 100644 index 62effb3536a7..000000000000 --- a/src/legacy/core_plugins/kibana/public/context/components/loading_button/loading_button.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -import { uiModules } from 'ui/modules'; -import contextLoadingButtonTemplate from './loading_button.html'; - - -const module = uiModules.get('apps/context', [ - 'kibana', - 'ngRoute', -]); - -module.directive('contextLoadingButton', function ContextLoadingButton() { - return { - replace: true, - restrict: 'E', - scope: { - isDisabled: '=', - icon: '=', - }, - template: contextLoadingButtonTemplate, - transclude: true, - }; -}); diff --git a/src/legacy/core_plugins/kibana/public/context/components/size_picker/_index.scss b/src/legacy/core_plugins/kibana/public/context/components/size_picker/_index.scss deleted file mode 100644 index 6a7ffa720191..000000000000 --- a/src/legacy/core_plugins/kibana/public/context/components/size_picker/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './size_picker'; diff --git a/src/legacy/core_plugins/kibana/public/context/components/size_picker/_size_picker.scss b/src/legacy/core_plugins/kibana/public/context/components/size_picker/_size_picker.scss deleted file mode 100644 index 3e9b05a2872c..000000000000 --- a/src/legacy/core_plugins/kibana/public/context/components/size_picker/_size_picker.scss +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 1. Hide increment and decrement buttons for type="number" input. - */ -.cxtSizePicker { - appearance: textfield; - text-align: center; - width: $euiSize * 5; - - &::-webkit-outer-spin-button, - &::-webkit-inner-spin-button { - appearance: none; /* 1 */ - margin: 0; /* 1 */ - } -} diff --git a/src/legacy/core_plugins/kibana/public/context/components/size_picker/size_picker.html b/src/legacy/core_plugins/kibana/public/context/components/size_picker/size_picker.html deleted file mode 100644 index d3bda3268310..000000000000 --- a/src/legacy/core_plugins/kibana/public/context/components/size_picker/size_picker.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/legacy/core_plugins/kibana/public/context/components/size_picker/size_picker.js b/src/legacy/core_plugins/kibana/public/context/components/size_picker/size_picker.js deleted file mode 100644 index c6679b26f4ea..000000000000 --- a/src/legacy/core_plugins/kibana/public/context/components/size_picker/size_picker.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ - -import _ from 'lodash'; -import { uiModules } from 'ui/modules'; -import { callAfterBindingsWorkaround } from 'ui/compat'; -import contextSizePickerTemplate from './size_picker.html'; - -const module = uiModules.get('apps/context', [ - 'kibana', -]); - -module.directive('contextSizePicker', function ContextSizePicker() { - return { - bindToController: true, - controller: callAfterBindingsWorkaround(ContextSizePickerController), - controllerAs: 'contextSizePicker', - link: linkContextSizePicker, - replace: true, - restrict: 'E', - require: 'ngModel', - scope: { - count: '=', - isDisabled: '=', - onChangeCount: '=', // To avoid inconsistent ngModel states this action - // should make sure the new value is propagated back - // to the `count` property. If that propagation - // fails, the user input will be reset to the value - // of `count`. - }, - template: contextSizePickerTemplate, - }; -}); - -function linkContextSizePicker(scope, element, attrs, ngModel) { - scope.countModel = ngModel; -} - -function ContextSizePickerController($scope) { - $scope.$watch( - () => this.count, - () => $scope.countModel.$rollbackViewValue(), - ); - - this.getOrSetCount = (count) => ( - _.isUndefined(count) ? this.count : this.onChangeCount(count) - ); -} diff --git a/src/legacy/core_plugins/kibana/public/context/query/actions.js b/src/legacy/core_plugins/kibana/public/context/query/actions.js index 10a4812f85f4..72624210fcb4 100644 --- a/src/legacy/core_plugins/kibana/public/context/query/actions.js +++ b/src/legacy/core_plugins/kibana/public/context/query/actions.js @@ -32,8 +32,6 @@ export function QueryActionsProvider(Private, Promise) { const fetchAnchor = Private(fetchAnchorProvider); const { fetchSurroundingDocs } = Private(fetchContextProvider); const { - increasePredecessorCount, - increaseSuccessorCount, setPredecessorCount, setQueryParameters, setSuccessorCount, @@ -173,16 +171,6 @@ export function QueryActionsProvider(Private, Promise) { return fetchSurroundingRows('successors', state); }; - const fetchMorePredecessorRows = (state) => () => { - increasePredecessorCount(state)(); - return fetchSurroundingRows('predecessors', state); - }; - - const fetchMoreSuccessorRows = (state) => () => { - increaseSuccessorCount(state)(); - return fetchSurroundingRows('successors', state); - }; - const setAllRows = (state) => (predecessorRows, anchorRow, successorRows) => ( state.rows.all = [ ...(predecessorRows || []), @@ -199,8 +187,6 @@ export function QueryActionsProvider(Private, Promise) { fetchContextRowsWithNewQueryParameters, fetchGivenPredecessorRows, fetchGivenSuccessorRows, - fetchMorePredecessorRows, - fetchMoreSuccessorRows, setAllRows, }; } diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_predecessor_count.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_predecessor_count.js deleted file mode 100644 index cd19f7af8d82..000000000000 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_predecessor_count.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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. - */ - -import expect from '@kbn/expect'; -import ngMock from 'ng_mock'; - -import { createStateStub } from './_utils'; -import { QueryParameterActionsProvider } from '../actions'; - - -describe('context app', function () { - beforeEach(ngMock.module('kibana')); - - describe('action increasePredecessorCount', function () { - let increasePredecessorCount; - - beforeEach(ngMock.inject(function createPrivateStubs(Private) { - increasePredecessorCount = Private(QueryParameterActionsProvider).increasePredecessorCount; - })); - - it('should increase the predecessorCount by the given value', function () { - const state = createStateStub(); - - increasePredecessorCount(state)(20); - - expect(state.queryParameters.predecessorCount).to.equal(30); - }); - - it('should increase the predecessorCount by the default step size if not value is given', function () { - const state = createStateStub(); - - increasePredecessorCount(state)(); - - expect(state.queryParameters.predecessorCount).to.equal(13); - }); - - it('should limit the predecessorCount to 0 as a lower bound', function () { - const state = createStateStub(); - - increasePredecessorCount(state)(-20); - - expect(state.queryParameters.predecessorCount).to.equal(0); - }); - - it('should limit the predecessorCount to 10000 as an upper bound', function () { - const state = createStateStub(); - - increasePredecessorCount(state)(20000); - - expect(state.queryParameters.predecessorCount).to.equal(10000); - }); - }); -}); diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_successor_count.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_successor_count.js deleted file mode 100644 index 7036df1ea626..000000000000 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/__tests__/action_increase_successor_count.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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. - */ - -import expect from '@kbn/expect'; -import ngMock from 'ng_mock'; - -import { createStateStub } from './_utils'; -import { QueryParameterActionsProvider } from '../actions'; - - -describe('context app', function () { - beforeEach(ngMock.module('kibana')); - - describe('action increaseSuccessorCount', function () { - let increaseSuccessorCount; - - beforeEach(ngMock.inject(function createPrivateStubs(Private) { - increaseSuccessorCount = Private(QueryParameterActionsProvider).increaseSuccessorCount; - })); - - it('should increase the successorCount by the given value', function () { - const state = createStateStub(); - - increaseSuccessorCount(state)(20); - - expect(state.queryParameters.successorCount).to.equal(30); - }); - - it('should increase the successorCount by the default step size if not value is given', function () { - const state = createStateStub(); - - increaseSuccessorCount(state)(); - - expect(state.queryParameters.successorCount).to.equal(13); - }); - - it('should limit the successorCount to 0 as a lower bound', function () { - const state = createStateStub(); - - increaseSuccessorCount(state)(-20); - - expect(state.queryParameters.successorCount).to.equal(0); - }); - - it('should limit the successorCount to 10000 as an upper bound', function () { - const state = createStateStub(); - - increaseSuccessorCount(state)(20000); - - expect(state.queryParameters.successorCount).to.equal(10000); - }); - }); -}); diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/actions.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/actions.js index cd5af188ad32..1c895b8d9e1c 100644 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/actions.js +++ b/src/legacy/core_plugins/kibana/public/context/query_parameters/actions.js @@ -40,12 +40,6 @@ export function QueryParameterActionsProvider(indexPatterns, Private) { ) ); - const increasePredecessorCount = (state) => ( - value = state.queryParameters.defaultStepSize, - ) => ( - setPredecessorCount(state)(state.queryParameters.predecessorCount + value) - ); - const setSuccessorCount = (state) => (successorCount) => ( state.queryParameters.successorCount = clamp( MIN_CONTEXT_SIZE, @@ -54,12 +48,6 @@ export function QueryParameterActionsProvider(indexPatterns, Private) { ) ); - const increaseSuccessorCount = (state) => ( - value = state.queryParameters.defaultStepSize, - ) => ( - setSuccessorCount(state)(state.queryParameters.successorCount + value) - ); - const setQueryParameters = (state) => (queryParameters) => ( Object.assign( state.queryParameters, @@ -82,8 +70,6 @@ export function QueryParameterActionsProvider(indexPatterns, Private) { return { addFilter, updateFilters, - increasePredecessorCount, - increaseSuccessorCount, setPredecessorCount, setQueryParameters, setSuccessorCount, diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/constants.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/constants.ts similarity index 99% rename from src/legacy/core_plugins/kibana/public/context/query_parameters/constants.js rename to src/legacy/core_plugins/kibana/public/context/query_parameters/constants.ts index 9b9e93f7ba00..9fdf79a714e7 100644 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/constants.js +++ b/src/legacy/core_plugins/kibana/public/context/query_parameters/constants.ts @@ -19,7 +19,6 @@ import { createInitialQueryParametersState } from './state'; - export const MAX_CONTEXT_SIZE = 10000; // Elasticsearch's default maximum size limit export const MIN_CONTEXT_SIZE = 0; export const QUERY_PARAMETER_KEYS = Object.keys(createInitialQueryParametersState()); diff --git a/src/legacy/core_plugins/kibana/public/context/query_parameters/state.js b/src/legacy/core_plugins/kibana/public/context/query_parameters/state.ts similarity index 89% rename from src/legacy/core_plugins/kibana/public/context/query_parameters/state.js rename to src/legacy/core_plugins/kibana/public/context/query_parameters/state.ts index 6fa5ad843de5..094dba6341d0 100644 --- a/src/legacy/core_plugins/kibana/public/context/query_parameters/state.js +++ b/src/legacy/core_plugins/kibana/public/context/query_parameters/state.ts @@ -17,7 +17,10 @@ * under the License. */ -export function createInitialQueryParametersState(defaultStepSize, tieBreakerField) { +export function createInitialQueryParametersState( + defaultStepSize: number = 5, + tieBreakerField: string = '_doc' +) { return { anchorId: null, columns: [], diff --git a/test/functional/page_objects/context_page.js b/test/functional/page_objects/context_page.js index a189376f0645..437aa411c48d 100644 --- a/test/functional/page_objects/context_page.js +++ b/test/functional/page_objects/context_page.js @@ -54,19 +54,19 @@ export function ContextPageProvider({ getService, getPageObjects }) { } async getPredecessorCountPicker() { - return await testSubjects.find('predecessorCountPicker'); + return await testSubjects.find('predecessorsCountPicker'); } async getSuccessorCountPicker() { - return await testSubjects.find('successorCountPicker'); + return await testSubjects.find('successorsCountPicker'); } async getPredecessorLoadMoreButton() { - return await testSubjects.find('predecessorLoadMoreButton'); + return await testSubjects.find('predecessorsLoadMoreButton'); } async getSuccessorLoadMoreButton() { - return await testSubjects.find('successorLoadMoreButton'); + return await testSubjects.find('successorsLoadMoreButton'); } async clickPredecessorLoadMoreButton() { diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 8d6c837d8728..0d890c29f289 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -1369,7 +1369,6 @@ "kbn.context.failedToLoadAnchorDocumentDescription": "別ののドキュメントの読み込みに失敗しました", "kbn.context.failedToLoadAnchorDocumentErrorDescription": "別のドキュメントの読み込みに失敗しました。", "kbn.context.loadingDescription": "読み込み中…", - "kbn.context.loadMoreDescription": "他 {defaultStepSize} を読み込む", "kbn.context.newerDocumentsDescription": "新しいドキュメント", "kbn.context.noSearchableTiebreakerFieldDescription": "インデックスパターン {indexPatternId} で検索可能なタイブレーカーフィールドが見つかりませんでした。高度な設定 {tieBreakerFields} tを変更してこのインデックスパターンの有効なフィールドを含めてください。", "kbn.context.olderDocumentsDescription": "古いドキュメント", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 868c6606cd1c..208bb36b58ac 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -1369,7 +1369,6 @@ "kbn.context.failedToLoadAnchorDocumentDescription": "无法加载该定位点文档", "kbn.context.failedToLoadAnchorDocumentErrorDescription": "无法加载定位点文档。", "kbn.context.loadingDescription": "正在加载……", - "kbn.context.loadMoreDescription": "再加载 {defaultStepSize} 个", "kbn.context.newerDocumentsDescription": "较新文档", "kbn.context.noSearchableTiebreakerFieldDescription": "索引模式 {indexPatternId} 中找不到任何可搜索的平分决胜字段。请更改高级设置“{tieBreakerFields}”以包括此索引模式的有效字段。", "kbn.context.olderDocumentsDescription": "较旧文档", From 904fe8ab726c2a2f48f5c31cf0ae1acd05959f4e Mon Sep 17 00:00:00 2001 From: Spencer Date: Tue, 10 Sep 2019 08:27:46 -0700 Subject: [PATCH 2/3] add src/plugins to the list of plugin dirs to watch (#45033) * add src/plugins to the list of plugin dirs to watch * include x-pack/plugins too --- src/cli/cluster/cluster_manager.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cli/cluster/cluster_manager.js b/src/cli/cluster/cluster_manager.js index 342f838e4ee7..bd32c5b9803a 100644 --- a/src/cli/cluster/cluster_manager.js +++ b/src/cli/cluster/cluster_manager.js @@ -24,6 +24,7 @@ import opn from 'opn'; import { debounce, invoke, bindAll, once, uniq } from 'lodash'; import * as Rx from 'rxjs'; import { first, mapTo, filter, map, take } from 'rxjs/operators'; +import { REPO_ROOT } from '@kbn/dev-utils'; import Log from '../log'; import Worker from './worker'; @@ -102,8 +103,15 @@ export default class ClusterManager { if (opts.watch) { const pluginPaths = config.get('plugins.paths'); - const scanDirs = config.get('plugins.scanDirs'); - const extraPaths = [...pluginPaths, ...scanDirs]; + const scanDirs = [ + ...config.get('plugins.scanDirs'), + resolve(REPO_ROOT, 'src/plugins'), + resolve(REPO_ROOT, 'x-pack/plugins'), + ]; + const extraPaths = [ + ...pluginPaths, + ...scanDirs, + ]; const extraIgnores = scanDirs .map(scanDir => resolve(scanDir, '*')) From 078ac2897fbb2e32db08990e3cbbd8cb65b6f536 Mon Sep 17 00:00:00 2001 From: spalger Date: Tue, 10 Sep 2019 09:03:23 -0700 Subject: [PATCH 3/3] Revert "Revert "[ci] compress jobs for CI stability" (#44584)" This reverts commit 50355d08f2cda0fbec162b0975c3439a7fb8cde0. --- .ci/jobs.yml | 21 ++++--------------- .ci/run.sh | 10 ++------- test/functional/apps/management/index.js | 4 ++-- test/functional/apps/visualize/index.ts | 8 +++---- test/mocha_decorations.d.ts | 12 +++++------ test/scripts/jenkins_firefox_smoke.sh | 2 ++ test/scripts/jenkins_unit.sh | 2 ++ test/scripts/jenkins_xpack_ci_group.sh | 8 +++---- .../security_and_spaces/tests/index.ts | 2 +- .../spaces_only/tests/index.ts | 2 +- x-pack/test/api_integration/apis/index.js | 2 +- .../api_integration/apis/security/index.js | 2 +- .../test/api_integration/apis/spaces/index.ts | 2 +- x-pack/test/functional/apps/apm/index.ts | 2 +- .../functional/apps/dashboard_mode/index.js | 2 +- .../apps/index_lifecycle_management/index.ts | 2 +- x-pack/test/functional/apps/infra/index.ts | 2 +- .../apps/license_management/index.ts | 2 +- x-pack/test/functional/apps/maps/index.js | 4 ++-- x-pack/test/functional/apps/uptime/index.ts | 2 +- .../kerberos_api_integration/apis/index.ts | 2 +- .../apis/authorization_code_flow/index.js | 2 +- .../apis/implicit_flow/index.ts | 2 +- x-pack/test/pki_api_integration/apis/index.ts | 2 +- x-pack/test/reporting/functional/index.js | 2 +- .../test/saml_api_integration/apis/index.js | 2 +- .../security_only/apis/index.ts | 2 +- .../security_and_spaces/apis/index.ts | 2 +- .../test/token_api_integration/auth/index.js | 2 +- .../security_and_spaces/tests/index.ts | 2 +- .../security_only/tests/index.ts | 2 +- .../spaces_only/tests/index.ts | 2 +- .../upgrade_assistant/index.js | 2 +- .../visual_regression/tests/maps/index.js | 2 +- 34 files changed, 53 insertions(+), 68 deletions(-) diff --git a/.ci/jobs.yml b/.ci/jobs.yml index 3f1b5302f87b..fe28ae79268d 100644 --- a/.ci/jobs.yml +++ b/.ci/jobs.yml @@ -1,34 +1,21 @@ JOB: - - kibana-intake - - x-pack-intake - - kibana-firefoxSmoke + - intake + - firefoxSmoke - kibana-ciGroup1 - kibana-ciGroup2 - kibana-ciGroup3 - kibana-ciGroup4 - kibana-ciGroup5 - kibana-ciGroup6 - - kibana-ciGroup7 - - kibana-ciGroup8 - - kibana-ciGroup9 - - kibana-ciGroup10 - - kibana-ciGroup11 - - kibana-ciGroup12 - - kibana-visualRegression + # - kibana-visualRegression # make sure all x-pack-ciGroups are listed in test/scripts/jenkins_xpack_ci_group.sh - - x-pack-firefoxSmoke - x-pack-ciGroup1 - x-pack-ciGroup2 - x-pack-ciGroup3 - x-pack-ciGroup4 - x-pack-ciGroup5 - - x-pack-ciGroup6 - - x-pack-ciGroup7 - - x-pack-ciGroup8 - - x-pack-ciGroup9 - - x-pack-ciGroup10 - - x-pack-visualRegression + # - x-pack-visualRegression # `~` is yaml for `null` exclude: ~ \ No newline at end of file diff --git a/.ci/run.sh b/.ci/run.sh index 88ce0bd9986a..e5c26c48546f 100755 --- a/.ci/run.sh +++ b/.ci/run.sh @@ -11,7 +11,7 @@ source src/dev/ci_setup/setup.sh source src/dev/ci_setup/checkout_sibling_es.sh case "$JOB" in -kibana-intake) +intake) ./test/scripts/jenkins_unit.sh ;; kibana-ciGroup*) @@ -21,12 +21,9 @@ kibana-ciGroup*) kibana-visualRegression*) ./test/scripts/jenkins_visual_regression.sh ;; -kibana-firefoxSmoke*) +firefoxSmoke*) ./test/scripts/jenkins_firefox_smoke.sh ;; -x-pack-intake) - ./test/scripts/jenkins_xpack.sh - ;; x-pack-ciGroup*) export CI_GROUP="${JOB##x-pack-ciGroup}" ./test/scripts/jenkins_xpack_ci_group.sh @@ -34,9 +31,6 @@ x-pack-ciGroup*) x-pack-visualRegression*) ./test/scripts/jenkins_xpack_visual_regression.sh ;; -x-pack-firefoxSmoke*) - ./test/scripts/jenkins_xpack_firefox_smoke.sh - ;; *) echo "JOB '$JOB' is not implemented." exit 1 diff --git a/test/functional/apps/management/index.js b/test/functional/apps/management/index.js index 4d4031b4e489..c9b444e50178 100644 --- a/test/functional/apps/management/index.js +++ b/test/functional/apps/management/index.js @@ -33,7 +33,7 @@ export default function ({ getService, loadTestFile }) { }); describe('', function () { - this.tags('ciGroup7'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./_create_index_pattern_wizard')); loadTestFile(require.resolve('./_index_pattern_create_delete')); @@ -45,7 +45,7 @@ export default function ({ getService, loadTestFile }) { }); describe('', function () { - this.tags('ciGroup8'); + this.tags('ciGroup2'); loadTestFile(require.resolve('./_index_pattern_filter')); loadTestFile(require.resolve('./_scripted_fields_filter')); diff --git a/test/functional/apps/visualize/index.ts b/test/functional/apps/visualize/index.ts index 2a13b6fea915..68a00b29d107 100644 --- a/test/functional/apps/visualize/index.ts +++ b/test/functional/apps/visualize/index.ts @@ -40,7 +40,7 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { }); describe('', function() { - this.tags('ciGroup9'); + this.tags('ciGroup3'); loadTestFile(require.resolve('./_embedding_chart')); loadTestFile(require.resolve('./_chart_types')); @@ -50,7 +50,7 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { }); describe('', function() { - this.tags('ciGroup10'); + this.tags('ciGroup4'); loadTestFile(require.resolve('./_inspector')); loadTestFile(require.resolve('./_experimental_vis')); @@ -62,7 +62,7 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { }); describe('', function() { - this.tags('ciGroup11'); + this.tags('ciGroup5'); loadTestFile(require.resolve('./_line_chart')); loadTestFile(require.resolve('./_pie_chart')); @@ -76,7 +76,7 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { }); describe('', function() { - this.tags('ciGroup12'); + this.tags('ciGroup6'); loadTestFile(require.resolve('./_tag_cloud')); loadTestFile(require.resolve('./_tile_map')); diff --git a/test/mocha_decorations.d.ts b/test/mocha_decorations.d.ts index 4645faf3d5fe..f6fca538a215 100644 --- a/test/mocha_decorations.d.ts +++ b/test/mocha_decorations.d.ts @@ -26,12 +26,12 @@ type Tags = | 'ciGroup4' | 'ciGroup5' | 'ciGroup6' - | 'ciGroup7' - | 'ciGroup8' - | 'ciGroup9' - | 'ciGroup10' - | 'ciGroup11' - | 'ciGroup12'; + | 'ciGroup1' + | 'ciGroup2' + | 'ciGroup3' + | 'ciGroup4' + | 'ciGroup5' + | 'ciGroup6'; // We need to use the namespace here to match the Mocha definition // eslint-disable-next-line @typescript-eslint/no-namespace diff --git a/test/scripts/jenkins_firefox_smoke.sh b/test/scripts/jenkins_firefox_smoke.sh index bf3fe0691aa1..50e5843eb46f 100755 --- a/test/scripts/jenkins_firefox_smoke.sh +++ b/test/scripts/jenkins_firefox_smoke.sh @@ -17,3 +17,5 @@ checks-reporter-with-killswitch "Firefox smoke test" \ --kibana-install-dir "$installDir" \ --include-tag "smoke" \ --config test/functional/config.firefox.js; + +source "$KIBANA_DIR/test/scripts/jenkins_xpack_firefox_smoke.sh" diff --git a/test/scripts/jenkins_unit.sh b/test/scripts/jenkins_unit.sh index b5ae3724ce37..b304c555b79c 100755 --- a/test/scripts/jenkins_unit.sh +++ b/test/scripts/jenkins_unit.sh @@ -6,3 +6,5 @@ trap 'node "$KIBANA_DIR/src/dev/failed_tests/cli"' EXIT export TEST_BROWSER_HEADLESS=1 "$(FORCE_COLOR=0 yarn bin)/grunt" jenkins:unit --dev; + +source "$KIBANA_DIR/test/scripts/jenkins_xpack.sh" diff --git a/test/scripts/jenkins_xpack_ci_group.sh b/test/scripts/jenkins_xpack_ci_group.sh index 3527aa5eedfa..5fc376a8d72e 100755 --- a/test/scripts/jenkins_xpack_ci_group.sh +++ b/test/scripts/jenkins_xpack_ci_group.sh @@ -14,10 +14,10 @@ node scripts/functional_tests --assert-none-excluded \ --include-tag ciGroup4 \ --include-tag ciGroup5 \ --include-tag ciGroup6 \ - --include-tag ciGroup7 \ - --include-tag ciGroup8 \ - --include-tag ciGroup9 \ - --include-tag ciGroup10 + --include-tag ciGroup1 \ + --include-tag ciGroup2 \ + --include-tag ciGroup3 \ + --include-tag ciGroup4 echo " -> building and extracting default Kibana distributable for use in functional tests" cd "$KIBANA_DIR" diff --git a/x-pack/test/alerting_api_integration/security_and_spaces/tests/index.ts b/x-pack/test/alerting_api_integration/security_and_spaces/tests/index.ts index 4c2dc3cbdf11..d3d5ca592ce6 100644 --- a/x-pack/test/alerting_api_integration/security_and_spaces/tests/index.ts +++ b/x-pack/test/alerting_api_integration/security_and_spaces/tests/index.ts @@ -19,7 +19,7 @@ export default function alertingApiIntegrationTests({ const esArchiver = getService('esArchiver'); describe('alerting api integration security and spaces enabled', function() { - this.tags('ciGroup8'); + this.tags('ciGroup3'); before(async () => { for (const space of Spaces) { diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/index.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/index.ts index dfbb2cca81a4..8c59e3981861 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/index.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/index.ts @@ -17,7 +17,7 @@ export default function alertingApiIntegrationTests({ const esArchiver = getService('esArchiver'); describe('alerting api integration spaces only', function() { - this.tags('ciGroup8'); + this.tags('ciGroup3'); before(async () => { for (const space of Object.values(Spaces)) { diff --git a/x-pack/test/api_integration/apis/index.js b/x-pack/test/api_integration/apis/index.js index 09186f4a6050..ffb3e1c64774 100644 --- a/x-pack/test/api_integration/apis/index.js +++ b/x-pack/test/api_integration/apis/index.js @@ -6,7 +6,7 @@ export default function ({ loadTestFile }) { describe('apis', function () { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./es')); loadTestFile(require.resolve('./security')); diff --git a/x-pack/test/api_integration/apis/security/index.js b/x-pack/test/api_integration/apis/security/index.js index 4d034622427f..2174b578abff 100644 --- a/x-pack/test/api_integration/apis/security/index.js +++ b/x-pack/test/api_integration/apis/security/index.js @@ -6,7 +6,7 @@ export default function ({ loadTestFile }) { describe('security', function () { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./basic_login')); loadTestFile(require.resolve('./builtin_es_privileges')); diff --git a/x-pack/test/api_integration/apis/spaces/index.ts b/x-pack/test/api_integration/apis/spaces/index.ts index adcf70d032e0..f3f96b891db0 100644 --- a/x-pack/test/api_integration/apis/spaces/index.ts +++ b/x-pack/test/api_integration/apis/spaces/index.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function({ loadTestFile }: FtrProviderContext) { describe('spaces', function() { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./saved_objects')); loadTestFile(require.resolve('./space_attributes')); diff --git a/x-pack/test/functional/apps/apm/index.ts b/x-pack/test/functional/apps/apm/index.ts index 945af09183f0..977b6fca549c 100644 --- a/x-pack/test/functional/apps/apm/index.ts +++ b/x-pack/test/functional/apps/apm/index.ts @@ -7,7 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function({ loadTestFile }: FtrProviderContext) { describe('APM', function() { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./feature_controls')); }); } diff --git a/x-pack/test/functional/apps/dashboard_mode/index.js b/x-pack/test/functional/apps/dashboard_mode/index.js index 2d263834fc31..5612fced7a25 100644 --- a/x-pack/test/functional/apps/dashboard_mode/index.js +++ b/x-pack/test/functional/apps/dashboard_mode/index.js @@ -6,7 +6,7 @@ export default function ({ loadTestFile }) { describe('dashboard mode', function () { - this.tags('ciGroup7'); + this.tags('ciGroup2'); loadTestFile(require.resolve('./dashboard_view_mode')); }); diff --git a/x-pack/test/functional/apps/index_lifecycle_management/index.ts b/x-pack/test/functional/apps/index_lifecycle_management/index.ts index 9078a9d681e7..d85b1af2b261 100644 --- a/x-pack/test/functional/apps/index_lifecycle_management/index.ts +++ b/x-pack/test/functional/apps/index_lifecycle_management/index.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default ({ loadTestFile }: FtrProviderContext) => { describe('Index Lifecycle Management app', function() { - this.tags('ciGroup7'); + this.tags('ciGroup2'); loadTestFile(require.resolve('./home_page')); }); }; diff --git a/x-pack/test/functional/apps/infra/index.ts b/x-pack/test/functional/apps/infra/index.ts index b706dc8cce54..b534f6b69fe5 100644 --- a/x-pack/test/functional/apps/infra/index.ts +++ b/x-pack/test/functional/apps/infra/index.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default ({ loadTestFile }: FtrProviderContext) => { describe('InfraOps app', function() { - this.tags('ciGroup7'); + this.tags('ciGroup2'); loadTestFile(require.resolve('./home_page')); loadTestFile(require.resolve('./feature_controls')); diff --git a/x-pack/test/functional/apps/license_management/index.ts b/x-pack/test/functional/apps/license_management/index.ts index 7524d00a4b8d..a41e4f5f4abd 100644 --- a/x-pack/test/functional/apps/license_management/index.ts +++ b/x-pack/test/functional/apps/license_management/index.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default ({ loadTestFile }: FtrProviderContext) => { describe('License app', function() { - this.tags('ciGroup7'); + this.tags('ciGroup2'); loadTestFile(require.resolve('./home_page')); }); }; diff --git a/x-pack/test/functional/apps/maps/index.js b/x-pack/test/functional/apps/maps/index.js index 9880fe41076d..76cccc9f5d21 100644 --- a/x-pack/test/functional/apps/maps/index.js +++ b/x-pack/test/functional/apps/maps/index.js @@ -28,7 +28,7 @@ export default function ({ loadTestFile, getService }) { }); describe('', function () { - this.tags('ciGroup7'); + this.tags('ciGroup2'); loadTestFile(require.resolve('./documents_source')); loadTestFile(require.resolve('./saved_object_management')); loadTestFile(require.resolve('./sample_data')); @@ -38,7 +38,7 @@ export default function ({ loadTestFile, getService }) { }); describe('', function () { - this.tags('ciGroup10'); + this.tags('ciGroup5'); loadTestFile(require.resolve('./es_geo_grid_source')); loadTestFile(require.resolve('./joins')); loadTestFile(require.resolve('./add_layer_panel')); diff --git a/x-pack/test/functional/apps/uptime/index.ts b/x-pack/test/functional/apps/uptime/index.ts index c1bc8f856c46..b5d3c73c9685 100644 --- a/x-pack/test/functional/apps/uptime/index.ts +++ b/x-pack/test/functional/apps/uptime/index.ts @@ -18,7 +18,7 @@ export default ({ loadTestFile, getService }: FtrProviderContext) => { await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC' }); }); after(async () => await esArchiver.unload(ARCHIVE)); - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./feature_controls')); loadTestFile(require.resolve('./overview')); diff --git a/x-pack/test/kerberos_api_integration/apis/index.ts b/x-pack/test/kerberos_api_integration/apis/index.ts index 00818c2b59ee..6bb924818a67 100644 --- a/x-pack/test/kerberos_api_integration/apis/index.ts +++ b/x-pack/test/kerberos_api_integration/apis/index.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; export default function({ loadTestFile }: FtrProviderContext) { describe('apis Kerberos', function() { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./security')); }); } diff --git a/x-pack/test/oidc_api_integration/apis/authorization_code_flow/index.js b/x-pack/test/oidc_api_integration/apis/authorization_code_flow/index.js index 0ef60bb92982..85f2a82cc964 100644 --- a/x-pack/test/oidc_api_integration/apis/authorization_code_flow/index.js +++ b/x-pack/test/oidc_api_integration/apis/authorization_code_flow/index.js @@ -6,7 +6,7 @@ export default function ({ loadTestFile }) { describe('apis', function () { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./oidc_auth')); }); } diff --git a/x-pack/test/oidc_api_integration/apis/implicit_flow/index.ts b/x-pack/test/oidc_api_integration/apis/implicit_flow/index.ts index 22ce3b17a594..0503efea77ea 100644 --- a/x-pack/test/oidc_api_integration/apis/implicit_flow/index.ts +++ b/x-pack/test/oidc_api_integration/apis/implicit_flow/index.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; // eslint-disable-next-line import/no-default-export export default function({ loadTestFile }: FtrProviderContext) { describe('apis', function() { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./oidc_auth')); }); } diff --git a/x-pack/test/pki_api_integration/apis/index.ts b/x-pack/test/pki_api_integration/apis/index.ts index d859ed172ac6..47ffb25835d4 100644 --- a/x-pack/test/pki_api_integration/apis/index.ts +++ b/x-pack/test/pki_api_integration/apis/index.ts @@ -8,7 +8,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; export default function({ loadTestFile }: FtrProviderContext) { describe('apis PKI', function() { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./security')); }); } diff --git a/x-pack/test/reporting/functional/index.js b/x-pack/test/reporting/functional/index.js index fa473f454a92..17aeb03eeadb 100644 --- a/x-pack/test/reporting/functional/index.js +++ b/x-pack/test/reporting/functional/index.js @@ -6,7 +6,7 @@ export default function ({ loadTestFile }) { describe('reporting app', function () { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./reporting')); }); } diff --git a/x-pack/test/saml_api_integration/apis/index.js b/x-pack/test/saml_api_integration/apis/index.js index ac08d2e078ab..b4e6503f201e 100644 --- a/x-pack/test/saml_api_integration/apis/index.js +++ b/x-pack/test/saml_api_integration/apis/index.js @@ -6,7 +6,7 @@ export default function ({ loadTestFile }) { describe('apis SAML', function () { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./security')); }); } diff --git a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts index fadefd2743b3..e24de7c7ae77 100644 --- a/x-pack/test/saved_object_api_integration/security_only/apis/index.ts +++ b/x-pack/test/saved_object_api_integration/security_only/apis/index.ts @@ -12,7 +12,7 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { const supertest = getService('supertest'); describe('saved objects security only enabled', function() { - this.tags('ciGroup9'); + this.tags('ciGroup4'); before(async () => { await createUsersAndRoles(es, supertest); diff --git a/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts b/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts index 4493a5332b62..b54345d78456 100644 --- a/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts +++ b/x-pack/test/spaces_api_integration/security_and_spaces/apis/index.ts @@ -13,7 +13,7 @@ export default function({ loadTestFile, getService }: TestInvoker) { const supertest = getService('supertest'); describe('spaces api with security', function() { - this.tags('ciGroup8'); + this.tags('ciGroup3'); before(async () => { await createUsersAndRoles(es, supertest); diff --git a/x-pack/test/token_api_integration/auth/index.js b/x-pack/test/token_api_integration/auth/index.js index e7b5a5b46a50..528a5c4bf8cf 100644 --- a/x-pack/test/token_api_integration/auth/index.js +++ b/x-pack/test/token_api_integration/auth/index.js @@ -6,7 +6,7 @@ export default function ({ loadTestFile }) { describe('token-based auth', function () { - this.tags('ciGroup6'); + this.tags('ciGroup1'); loadTestFile(require.resolve('./login')); loadTestFile(require.resolve('./logout')); loadTestFile(require.resolve('./header')); diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/index.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/index.ts index e28ea819bfdf..f87bb10aaf08 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/index.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/index.ts @@ -17,7 +17,7 @@ export default function uiCapabilitiesTests({ loadTestFile, getService }: FtrPro const featuresService: FeaturesService = getService('features'); describe('ui capabilities', function() { - this.tags('ciGroup9'); + this.tags('ciGroup4'); before(async () => { const features = await featuresService.get(); diff --git a/x-pack/test/ui_capabilities/security_only/tests/index.ts b/x-pack/test/ui_capabilities/security_only/tests/index.ts index b84c02f9d65c..a941e6483972 100644 --- a/x-pack/test/ui_capabilities/security_only/tests/index.ts +++ b/x-pack/test/ui_capabilities/security_only/tests/index.ts @@ -13,7 +13,7 @@ export default function uiCapabilitesTests({ loadTestFile, getService }: FtrProv const securityService: SecurityService = getService('security'); describe('ui capabilities', function() { - this.tags('ciGroup9'); + this.tags('ciGroup4'); before(async () => { for (const user of UserScenarios) { diff --git a/x-pack/test/ui_capabilities/spaces_only/tests/index.ts b/x-pack/test/ui_capabilities/spaces_only/tests/index.ts index 294f545c7d90..177ca0064a6b 100644 --- a/x-pack/test/ui_capabilities/spaces_only/tests/index.ts +++ b/x-pack/test/ui_capabilities/spaces_only/tests/index.ts @@ -14,7 +14,7 @@ export default function uiCapabilitesTests({ loadTestFile, getService }: FtrProv const featuresService: FeaturesService = getService('features'); describe('ui capabilities', function() { - this.tags('ciGroup9'); + this.tags('ciGroup4'); before(async () => { const features = await featuresService.get(); diff --git a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/index.js b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/index.js index 1b7406b37022..82e9214f5539 100644 --- a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/index.js +++ b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/index.js @@ -6,7 +6,7 @@ export default function ({ loadTestFile }) { describe('upgrade assistant', function () { - this.tags('ciGroup7'); + this.tags('ciGroup2'); loadTestFile(require.resolve('./reindexing')); }); diff --git a/x-pack/test/visual_regression/tests/maps/index.js b/x-pack/test/visual_regression/tests/maps/index.js index de5c50e900ca..c080e5727b24 100644 --- a/x-pack/test/visual_regression/tests/maps/index.js +++ b/x-pack/test/visual_regression/tests/maps/index.js @@ -26,7 +26,7 @@ export default function ({ loadTestFile, getService }) { await esArchiver.unload('maps/kibana'); }); - this.tags('ciGroup10'); + this.tags('ciGroup5'); loadTestFile(require.resolve('./vector_styling')); }); }