ROX-12893: Wait for more requests in configmanagement integration tests#3268
Merged
pedrottimark merged 14 commits intomasterfrom Oct 3, 2022
Merged
ROX-12893: Wait for more requests in configmanagement integration tests#3268pedrottimark merged 14 commits intomasterfrom
pedrottimark merged 14 commits intomasterfrom
Conversation
added 7 commits
September 30, 2022 15:32
|
Images are ready for the commit at 859fe34. To use with deploy scripts, first |
added 7 commits
October 2, 2022 18:56
Contributor
Author
|
/test ui-unit-tests |
1 similar comment
Contributor
Author
|
/test ui-unit-tests |
vjwilson
approved these changes
Oct 3, 2022
Contributor
vjwilson
left a comment
There was a problem hiding this comment.
Looks good as-is, but I would go ahead and use the constants you have commented.
| import withAuth from '../../helpers/basicAuth'; | ||
| import { triggerScan } from '../../helpers/compliance'; | ||
|
|
||
| // const entitiesKey = 'controls'; // omit to minimize changed lines |
Contributor
There was a problem hiding this comment.
Not sure it's worth delaying this change by commenting this pattern in each of the files.
Contributor
Author
There was a problem hiding this comment.
I will open a follow up use constants and to split it with pair of context into pair of it tests.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Test failure
A test-specific request times out while there is a problem with generic requests.
Analysis
This is only the second investigation to examine the build-log.text file. The first was in #2799
Compare 3 occurrences of refreshing auth token:
Circumstantial evidence suggests that Refreshing the GKE auth token affects tests that call
cy.visitmethod (which does not wait for any requests, which have problems in the picture above) instead of visit helper functions (which do wait for generic and container-specific requests).Success: certexpiration.test.js which calls
visitMainDashboardhelper functionFailure: configmanagement/nodes.test.js which calls
cy.visitmethodSuccess: policies/policyWizardStep3.test.js which calls
visitPolicieshelper functionIn this test run, there are 3 occurrences at 15 minute intervals. It seems like there could be twice as many, because test runs last for 90 to 120 minutes.
Solution
cy.visitwith visit functions. After these changes: 57 results in 18 files, some of which are skipped. That is, configmanagement folder had the largest number of occurrences, therefore would have been next in line, except that it is an abandoned container. However, CI did not get the memo to give it a break.Change summary
Edit cypress/constants/ConfigManagementPage.js
Edit cypress/constants/apiEndpoints.js
Edit cypress/helpers/configWorkflowUtils.js
Edit test files
entitiesKeyas an example, but comment it out to minimize changed lines.triggerScanfor Compliance scan withinteractAndWaitForConfigurationManagementScanfunction.clickOnRowEntitybecause redundant withentityListCountMatchesTableLinkCountfunction calls.Lessons learned
cy.serverandcy.requestwithcy.intercepta year ago.context(description, callback)blocks. However, it is a synonym fordescribewhich is a parent ofitnot a child of it (pardon pun). Therefore, a test failure does not include the contextual string. The only reason why I did not split dual-context tests into pairs of tests is to minimize changed.Suggestion
For future work on workflow containers, provide the following in the container (not globally) with key of path segment for plural entities like clusters.
Internal strings:
If possible, supersede singular path segments (to distinguish entity page from classic side panel) with the usual plurals whatevers/id or primaries/id1/secondaries/id2, if 2 levels continue in the future.
Do not use in query strings of page addresses if breadcrumb context continues into the future (separate from side panel as presentation page architecture). That is, use same clusters in query string as for path segment.
External strings do not transform internal strings with
capitalize,pluralizeand so on for use as page text!If UI has a clear and simple source of truth for each type of entities, then integration tests are easier to understand and helper functions are easier to write.
Checklist
Testing Performed