Skip to content

Commit

Permalink
uptime - update monitor states endpoint api integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiqueclarke committed Apr 13, 2022
1 parent 6a9496c commit b78a773
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export const uptimeRouteWrapper: UMKibanaRouteWrapper = (uptimeRoute, server) =>

server.uptimeEsClient = uptimeEsClient;

if (isInspectorEnabled || server.isDev) {
if (
(isInspectorEnabled || server.isDev) &&
server.config.service?.username !== 'localKibanaIntegrationTestsUser'
) {
inspectableEsQueriesMap.set(request, []);
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ interface ExpectedMonitorStatesPage {
response: any;
statesIds: string[];
statuses: string[];
absFrom: number;
absTo: number;
size: number;
prevPagination: null | string;
nextPagination: null | string;
Expand All @@ -34,8 +32,6 @@ const checkMonitorStatesResponse = ({
response,
statesIds,
statuses,
absFrom,
absTo,
size,
prevPagination,
nextPagination,
Expand All @@ -52,11 +48,6 @@ const checkMonitorStatesResponse = ({
).to.eql(statuses);
(summaries ?? []).forEach((s) => {
expect(s.state.url.full).to.be.ok();
expect(Array.isArray(s.histogram?.points)).to.be(true);
(s.histogram?.points ?? []).forEach((point) => {
expect(point.timestamp).to.be.greaterThan(absFrom);
expect(point.timestamp).to.be.lessThan(absTo);
});
});
expect(prevPagePagination).to.be(prevPagination);
expect(nextPagePagination).to.eql(nextPagination);
Expand All @@ -68,8 +59,6 @@ export default function ({ getService }: FtrProviderContext) {
describe('monitor states endpoint', () => {
const from = '2019-09-11T03:30:04.380Z';
const to = '2019-09-11T03:40:34.410Z';
const absFrom = new Date(from).valueOf();
const absTo = new Date(to).valueOf();

it('will fetch monitor state data for the given filters and range', async () => {
const statusFilter = 'up';
Expand All @@ -83,8 +72,6 @@ export default function ({ getService }: FtrProviderContext) {
response: apiResponse.body,
statesIds: ['0002-up'],
statuses: ['up'],
absFrom,
absTo,
size: 1,
prevPagination: null,
nextPagination: null,
Expand Down Expand Up @@ -479,8 +466,6 @@ export default function ({ getService }: FtrProviderContext) {
checkMonitorStatesResponse({
response: nextData,
...expectedNextResults[page - 1],
absFrom,
absTo,
size,
});

Expand All @@ -492,8 +477,6 @@ export default function ({ getService }: FtrProviderContext) {
checkMonitorStatesResponse({
response: prevData,
...expectedPrevResults[page - 2],
absFrom,
absTo,
size,
});
}
Expand All @@ -520,8 +503,6 @@ export default function ({ getService }: FtrProviderContext) {
'0009-up',
],
statuses: ['up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'],
absFrom,
absTo,
size: LENGTH,
prevPagination: null,
nextPagination:
Expand Down

0 comments on commit b78a773

Please sign in to comment.