Skip to content

Comments

remove calls to set the timepicker in Lens tests, use default time#145656

Closed
LeeDr wants to merge 14 commits intoelastic:mainfrom
LeeDr:lensDefaultTimespan
Closed

remove calls to set the timepicker in Lens tests, use default time#145656
LeeDr wants to merge 14 commits intoelastic:mainfrom
LeeDr:lensDefaultTimespan

Conversation

@LeeDr
Copy link

@LeeDr LeeDr commented Nov 18, 2022

Summary

ref: #113998

These Lens tests had 85 calls to set the timepicker (all to the same default time) but the default time was already being set to that same time in the index file;

https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/lens/group1/index.ts#L56
https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/lens/group2/index.ts#L56
https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/lens/group3/index.ts#L56

UPDATE: I reverted the changes to group2 and 3 because of test failures. I can probably remove most of the calls to PageObjects.lens.goToTimeRange() but I'll leave it to another PR.

UPDATE: Currently have removed 27 calls to goToTimeRange. Each call takes about 4.5 seconds on my laptop. So this PR should take about 2 minutes off the tests in lens/group1

@LeeDr LeeDr marked this pull request as ready for review November 21, 2022 17:15
@LeeDr LeeDr requested a review from a team as a code owner November 21, 2022 17:15
@LeeDr LeeDr added Team:QA Platform QA t// test_xpack_functional release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor v8.6.0 v8.7.0 labels Nov 21, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-qa (Team:QA)

@dej611
Copy link
Contributor

dej611 commented Nov 21, 2022

UPDATE: Currently have removed 27 calls to goToTimeRange. Each call takes about 4.5 seconds on my laptop. So this PR should take about 2 minutes off the tests in lens/group1

That sounds great.
I was wondering whether it might make sense to leave the calls there in case the default date time changes, but add a check on top of the goToTimeRange method to check whether the time picker is already set at the right timing, and then exit earlier.

@LeeDr
Copy link
Author

LeeDr commented Nov 21, 2022

UPDATE: Currently have removed 27 calls to goToTimeRange. Each call takes about 4.5 seconds on my laptop. So this PR should take about 2 minutes off the tests in lens/group1

That sounds great. I was wondering whether it might make sense to leave the calls there in case the default date time changes, but add a check on top of the goToTimeRange method to check whether the time picker is already set at the right timing, and then exit earlier.

UPDATE: Currently have removed 27 calls to goToTimeRange. Each call takes about 4.5 seconds on my laptop. So this PR should take about 2 minutes off the tests in lens/group1

That sounds great. I was wondering whether it might make sense to leave the calls there in case the default date time changes, but add a check on top of the goToTimeRange method to check whether the time picker is already set at the right timing, and then exit earlier.

After a bunch of testing and trying to change setAbsoluteRange to check the current timepicker settings I found that defaultStartTime and defaultStartTimeUTC are off by 1 day. I don't think that was intentional. So I'm going to create a new PR to see if I can get tests to pass with those start times lined up. Once I see how that goes I'll come back to this.

defaultStartTime = 'Sep 19, 2015 @ 06:31:44.000';
defaultEndTime = 'Sep 23, 2015 @ 18:31:44.000';
defaultStartTimeUTC = '2015-09-18T06:31:44.000Z';
defaultEndTimeUTC = '2015-09-23T18:31:44.000Z';

@LeeDr LeeDr marked this pull request as draft November 21, 2022 23:19
@kibana-ci
Copy link

kibana-ci commented Nov 28, 2022

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #12 / Response actions history With Data should refresh data when autoRefresh is toggled on

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 442 448 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 68 74 +6
osquery 110 117 +7
securitySolution 519 525 +6
total +21

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@LeeDr
Copy link
Author

LeeDr commented Nov 30, 2022

UPDATE: Currently have removed 27 calls to goToTimeRange. Each call takes about 4.5 seconds on my laptop. So this PR should take about 2 minutes off the tests in lens/group1

That sounds great. I was wondering whether it might make sense to leave the calls there in case the default date time changes, but add a check on top of the goToTimeRange method to check whether the time picker is already set at the right timing, and then exit earlier.

I've done this in (not yet merged) #146462 if you would like to review that.

@lukeelmers lukeelmers closed this Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:QA Platform QA t// test_xpack_functional v8.6.0 v8.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants