forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Uptime] Unskip flaky tests (elastic#130059)
* unskip flaky test * move Observer location test to Synthetics e2e * uptime - update monitor states endpoint api integration tests * uptime - reskip flaky tests Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit 250e3f9) # Conflicts: # x-pack/plugins/uptime/server/rest_api/uptime_route_wrapper.ts
- Loading branch information
1 parent
b1dde38
commit 40da471
Showing
10 changed files
with
122 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export * from './locations'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { journey, step, before, Page } from '@elastic/synthetics'; | ||
import { makeChecksWithStatus } from '../../helpers/make_checks'; | ||
import { monitorDetailsPageProvider } from '../../page_objects/monitor_details'; | ||
|
||
journey('Observer location', async ({ page, params }: { page: Page; params: any }) => { | ||
const monitorDetails = monitorDetailsPageProvider({ page, kibanaUrl: params.kibanaUrl }); | ||
|
||
const NO_LOCATION_MONITOR_ID = 'location-testing-id'; | ||
|
||
const LESS_AVAIL_MONITOR_ID = 'less-availability-monitor'; | ||
|
||
const addMonitorWithNoLocation = async () => { | ||
/** | ||
* This mogrify function will strip the documents of their location | ||
* data (but preserve their location name), which is necessary for | ||
* this test to work as desired. | ||
* @param d current document | ||
*/ | ||
const mogrifyNoLocation = (d: any) => { | ||
if (d.observer?.geo?.location) { | ||
d.observer.geo.location = undefined; | ||
} | ||
return d; | ||
}; | ||
await makeChecksWithStatus( | ||
params.getService('es'), | ||
NO_LOCATION_MONITOR_ID, | ||
5, | ||
2, | ||
10000, | ||
{}, | ||
'up', | ||
mogrifyNoLocation | ||
); | ||
}; | ||
|
||
const addLessAvailMonitor = async () => { | ||
await makeChecksWithStatus( | ||
params.getService('es'), | ||
LESS_AVAIL_MONITOR_ID, | ||
5, | ||
2, | ||
10000, | ||
{}, | ||
'up' | ||
); | ||
await makeChecksWithStatus( | ||
params.getService('es'), | ||
LESS_AVAIL_MONITOR_ID, | ||
5, | ||
2, | ||
10000, | ||
{}, | ||
'down' | ||
); | ||
}; | ||
|
||
before(async () => { | ||
await addMonitorWithNoLocation(); | ||
await addLessAvailMonitor(); | ||
}); | ||
|
||
step('navigate to overview', async () => { | ||
await monitorDetails.navigateToOverviewPage(); | ||
}); | ||
|
||
step('login to Kibana', async () => { | ||
await monitorDetails.loginToKibana(); | ||
}); | ||
|
||
step('navigate to monitor details for no locaiton monitor', async () => { | ||
await monitorDetails.navigateToMonitorDetails(NO_LOCATION_MONITOR_ID); | ||
}); | ||
|
||
step('displays the overall availability', async () => { | ||
await monitorDetails.waitForLoadingToFinish(); | ||
const availability = '100.00 %'; | ||
await monitorDetails.assertText({ text: availability }); | ||
}); | ||
|
||
step('displays less monitor availability', async () => { | ||
await monitorDetails.navigateToOverviewPage(); | ||
await monitorDetails.navigateToMonitorDetails(LESS_AVAIL_MONITOR_ID); | ||
await monitorDetails.assertText({ text: '50.00 %' }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 16 additions & 106 deletions
122
x-pack/test/api_integration/apis/uptime/rest/__snapshots__/monitor_states_real_data.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.