Skip to content

Commit

Permalink
Merge branch 'master' into unskip_core_app_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 22, 2021
2 parents 948a5d9 + 556a882 commit 5058a3d
Show file tree
Hide file tree
Showing 40 changed files with 845 additions and 833 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ for x in functional jest; do
# Need to override COVERAGE_INGESTION_KIBANA_ROOT since json file has original intake worker path
export COVERAGE_INGESTION_KIBANA_ROOT=/dev/shm/workspace/kibana
fi

node scripts/ingest_coverage.js --verbose --path ${COVERAGE_SUMMARY_FILE} --vcsInfoPath ./VCS_INFO.txt --teamAssignmentsPath $TEAM_ASSIGN_PATH
# running in background to speed up ingestion
node scripts/ingest_coverage.js --verbose --path ${COVERAGE_SUMMARY_FILE} --vcsInfoPath ./VCS_INFO.txt --teamAssignmentsPath $TEAM_ASSIGN_PATH &
done
wait

echo "### Ingesting Code Coverage - Complete"
echo ""
13 changes: 12 additions & 1 deletion test/accessibility/services/a11y/analyze_with_axe.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,19 @@ export function analyzeWithAxe(context, options, callback) {
selector: '[data-test-subj="comboBoxSearchInput"] *',
},
{
// EUI bug: https://github.com/elastic/eui/issues/4474
id: 'aria-required-parent',
selector: '[class=*"euiDataGridRowCell"][role="gridcell"] ',
selector: '[class=*"euiDataGridRowCell"][role="gridcell"]',
},
{
// 3rd-party library; button has aria-describedby
id: 'button-name',
selector: '[data-rbd-drag-handle-draggable-id]',
},
{
// EUI bug: https://github.com/elastic/eui/issues/4536
id: 'duplicate-id',
selector: '.euiSuperDatePicker *',
},
],
});
Expand Down
2 changes: 1 addition & 1 deletion test/functional/services/dashboard/panel_actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function DashboardPanelActionsProvider({ getService, getPageObjects }: Ft

async clickExpandPanelToggle() {
log.debug(`clickExpandPanelToggle`);
this.openContextMenu();
await this.openContextMenu();
const isActionVisible = await testSubjects.exists(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ);
if (!isActionVisible) await this.clickContextMenuMoreItem();
await testSubjects.click(TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ);
Expand Down
15 changes: 13 additions & 2 deletions test/functional/services/toasts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,21 @@ export function ToastsProvider({ getService }: FtrProviderContext) {
public async dismissAllToasts() {
const list = await this.getGlobalToastList();
const toasts = await list.findAllByCssSelector(`.euiToast`);

if (toasts.length === 0) return;

for (const toast of toasts) {
await toast.moveMouseTo();
const dismissButton = await testSubjects.findDescendant('toastCloseButton', toast);
await dismissButton.click();

if (await testSubjects.descendantExists('toastCloseButton', toast)) {
try {
const dismissButton = await testSubjects.findDescendant('toastCloseButton', toast);
await dismissButton.click();
} catch (err) {
// ignore errors
// toasts are finnicky because they can dismiss themselves right before you close them
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ export function ServiceStatsFetcher({
serviceAnomalyStats,
}: ServiceStatsFetcherProps) {
const {
urlParams: { start, end },
uiFilters,
urlParams: { environment, start, end },
} = useUrlParams();

const {
Expand All @@ -46,12 +45,12 @@ export function ServiceStatsFetcher({
endpoint: 'GET /api/apm/service-map/service/{serviceName}',
params: {
path: { serviceName },
query: { start, end, uiFilters: JSON.stringify(uiFilters) },
query: { environment, start, end },
},
});
}
},
[serviceName, start, end, uiFilters],
[environment, serviceName, start, end],
{
preservePreviousData: false,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ export function AnnotationsContextProvider({
children: React.ReactNode;
}) {
const { serviceName } = useParams<{ serviceName?: string }>();
const { urlParams, uiFilters } = useUrlParams();
const { start, end } = urlParams;
const { environment } = uiFilters;
const { urlParams } = useUrlParams();
const { environment, start, end } = urlParams;

const { data = INITIAL_STATE } = useFetcher(
(callApmApi) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function getServiceMapServiceNodeInfo({
searchAggregatedTransactions,
}: Options & { serviceName: string }) {
return withApmSpan('get_service_map_node_stats', async () => {
const { start, end, uiFilters } = setup;
const { start, end } = setup;

const filter: ESFilter[] = [
{ term: { [SERVICE_NAME]: serviceName } },
Expand All @@ -66,7 +66,7 @@ export function getServiceMapServiceNodeInfo({

const minutes = Math.abs((end - start) / (1000 * 60));
const taskParams = {
environment: uiFilters.environment,
environment,
filter,
searchAggregatedTransactions,
minutes,
Expand Down
6 changes: 4 additions & 2 deletions x-pack/plugins/apm/server/routes/service_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { setupRequest } from '../lib/helpers/setup_request';
import { getServiceMap } from '../lib/service_map/get_service_map';
import { getServiceMapServiceNodeInfo } from '../lib/service_map/get_service_map_service_node_info';
import { createRoute } from './create_route';
import { environmentRt, rangeRt, uiFiltersRt } from './default_api_types';
import { environmentRt, rangeRt } from './default_api_types';
import { notifyFeatureUsage } from '../feature';
import { getSearchAggregatedTransactions } from '../lib/helpers/aggregated_transactions';
import { isActivePlatinumLicense } from '../../common/license_check';
Expand Down Expand Up @@ -67,7 +67,7 @@ export const serviceMapServiceNodeRoute = createRoute({
path: t.type({
serviceName: t.string,
}),
query: t.intersection([rangeRt, uiFiltersRt]),
query: t.intersection([environmentRt, rangeRt]),
}),
options: { tags: ['access:apm'] },
handler: async ({ context, request }) => {
Expand All @@ -81,13 +81,15 @@ export const serviceMapServiceNodeRoute = createRoute({

const {
path: { serviceName },
query: { environment },
} = context.params;

const searchAggregatedTransactions = await getSearchAggregatedTransactions(
setup
);

return getServiceMapServiceNodeInfo({
environment,
setup,
serviceName,
searchAggregatedTransactions,
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/lens/public/drag_drop/drag_drop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
.lnsDragDrop-isDropTarget {
@include lnsDroppable;
@include lnsDroppableActive;
> * {
pointer-events: none;
}
}

.lnsDragDrop-isActiveGroup {
Expand Down
82 changes: 35 additions & 47 deletions x-pack/plugins/lens/public/drag_drop/drag_drop.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
ReorderProvider,
DragDropIdentifier,
DraggingIdentifier,
DropTargets,
DropIdentifier,
} from './providers';
import { act } from 'react-dom/test-utils';
import { DropType } from '../types';
Expand All @@ -32,6 +32,7 @@ describe('DragDrop', () => {
setDragging: jest.fn(),
setActiveDropTarget: jest.fn(),
activeDropTarget: undefined,
dropTargetsByOrder: undefined,
keyboardMode: false,
setKeyboardMode: () => {},
setA11yMessage: jest.fn(),
Expand Down Expand Up @@ -255,11 +256,10 @@ describe('DragDrop', () => {
dragging = { id: '1', humanData: { label: 'Label1' } };
}}
setActiveDropTarget={setActiveDropTarget}
activeDropTarget={
({ activeDropTarget: value } as unknown) as DragContextState['activeDropTarget']
}
activeDropTarget={value as DragContextState['activeDropTarget']}
keyboardMode={false}
setKeyboardMode={(keyboardMode) => true}
dropTargetsByOrder={undefined}
registerDropTarget={jest.fn()}
>
<DragDrop
Expand Down Expand Up @@ -349,12 +349,10 @@ describe('DragDrop', () => {
dragging: { ...items[0].value, ghost: { children: <div />, style: {} } },
setActiveDropTarget,
setA11yMessage,
activeDropTarget: {
activeDropTarget: { ...items[1].value, onDrop, dropType: 'move_compatible' },
dropTargetsByOrder: {
'2,0,1,0': { ...items[1].value, onDrop, dropType: 'move_compatible' },
'2,0,2,0': { ...items[2].value, onDrop, dropType: 'replace_compatible' },
},
activeDropTarget: { ...items[1].value, onDrop, dropType: 'move_compatible' },
dropTargetsByOrder: {
'2,0,1,0': { ...items[1].value, onDrop, dropType: 'move_compatible' },
'2,0,2,0': { ...items[2].value, onDrop, dropType: 'replace_compatible' },
},
keyboardMode: true,
}}
Expand Down Expand Up @@ -463,11 +461,9 @@ describe('DragDrop', () => {
dragging: { ...items[0].value, ghost: { children: <div>Hello</div>, style: {} } },
setActiveDropTarget,
setA11yMessage,
activeDropTarget: {
activeDropTarget: { ...items[1].value, onDrop, dropType: 'move_compatible' },
dropTargetsByOrder: {
'2,0,1,0': { ...items[1].value, onDrop, dropType: 'move_compatible' },
},
activeDropTarget: { ...items[1].value, onDrop, dropType: 'move_compatible' },
dropTargetsByOrder: {
'2,0,1,0': { ...items[1].value, onDrop, dropType: 'move_compatible' },
},
keyboardMode: true,
}}
Expand Down Expand Up @@ -525,11 +521,12 @@ describe('DragDrop', () => {
keyboardMode = mode;
}),
setActiveDropTarget: (target?: DragDropIdentifier) => {
activeDropTarget = { activeDropTarget: target } as DropTargets;
activeDropTarget = target as DropIdentifier;
},
activeDropTarget,
setA11yMessage,
registerDropTarget,
dropTargetsByOrder: undefined,
};

const dragDropSharedProps = {
Expand Down Expand Up @@ -665,13 +662,11 @@ describe('DragDrop', () => {
const component = mountComponent({
dragging: { ...items[0] },
keyboardMode: true,
activeDropTarget: {
activeDropTarget: undefined,
dropTargetsByOrder: {
'2,0,0': undefined,
'2,0,1': { ...items[1], onDrop, dropType: 'reorder' },
'2,0,2': { ...items[2], onDrop, dropType: 'reorder' },
},
activeDropTarget: undefined,
dropTargetsByOrder: {
'2,0,0': undefined,
'2,0,1': { ...items[1], onDrop, dropType: 'reorder' },
'2,0,2': { ...items[2], onDrop, dropType: 'reorder' },
},
setActiveDropTarget,
setA11yMessage,
Expand All @@ -693,15 +688,12 @@ describe('DragDrop', () => {
test(`Keyboard navigation: user can drop element to an activeDropTarget`, () => {
const component = mountComponent({
dragging: { ...items[0] },
activeDropTarget: {
activeDropTarget: { ...items[2], dropType: 'reorder', onDrop },
dropTargetsByOrder: {
'2,0,0': { ...items[0], onDrop, dropType: 'reorder' },
'2,0,1': { ...items[1], onDrop, dropType: 'reorder' },
'2,0,2': { ...items[2], onDrop, dropType: 'reorder' },
},
activeDropTarget: { ...items[2], dropType: 'reorder', onDrop },
dropTargetsByOrder: {
'2,0,0': { ...items[0], onDrop, dropType: 'reorder' },
'2,0,1': { ...items[1], onDrop, dropType: 'reorder' },
'2,0,2': { ...items[2], onDrop, dropType: 'reorder' },
},

keyboardMode: true,
});
const keyboardHandler = component
Expand Down Expand Up @@ -747,13 +739,11 @@ describe('DragDrop', () => {
const component = mountComponent({
dragging: { ...items[0] },
keyboardMode: true,
activeDropTarget: {
activeDropTarget: undefined,
dropTargetsByOrder: {
'2,0,0': undefined,
'2,0,1': { ...items[1], onDrop, dropType: 'reorder' },
'2,0,2': { ...items[2], onDrop, dropType: 'reorder' },
},
activeDropTarget: undefined,
dropTargetsByOrder: {
'2,0,0': undefined,
'2,0,1': { ...items[1], onDrop, dropType: 'reorder' },
'2,0,2': { ...items[2], onDrop, dropType: 'reorder' },
},
setA11yMessage,
});
Expand Down Expand Up @@ -799,15 +789,13 @@ describe('DragDrop', () => {
{...defaultContext}
keyboardMode={true}
activeDropTarget={{
activeDropTarget: {
...items[1],
onDrop,
dropType: 'reorder',
},
dropTargetsByOrder: {
'2,0,1,0': undefined,
'2,0,1,1': { ...items[1], onDrop, dropType: 'reorder' },
},
...items[1],
onDrop,
dropType: 'reorder',
}}
dropTargetsByOrder={{
'2,0,1,0': undefined,
'2,0,1,1': { ...items[1], onDrop, dropType: 'reorder' },
}}
dragging={{ ...items[0] }}
setActiveDropTarget={setActiveDropTarget}
Expand Down
Loading

0 comments on commit 5058a3d

Please sign in to comment.