-
Notifications
You must be signed in to change notification settings - Fork 67
Remove flakiness from ssh-keys integration tests #7427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Remove flakiness from ssh-keys integration tests #7427
Conversation
Skipping CI for Draft Pull Request. |
/test all |
/test pre-dashboard-web-check |
/test all |
/test pre-dashboard-web-check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small comments
@@ -26,6 +26,7 @@ export enum Condition { | |||
NotBe = 'not.be', | |||
NotBeChecked = 'not.be.checked', | |||
NotBeVisible = 'not.be.visible', | |||
NotBeDisabled = 'not.be.disabled', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't NotBeDisabled
is the same of BeEnabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“not disabled” == “enabled” Another way of testing assertions using negative expression but if that make harder form understanding POV let me know wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally, I think it might be a bit redundant, but I’m okay if you feel it makes more sense to keep it.
this.Buttons.openDialog.click(); | ||
this.Elements.addDialogInput.type(name).then(_ => this._strategy?.onCreate()); | ||
this.Buttons.openDialog.click({force: true}); | ||
this.Elements.addDialogInput.should(Condition.BeVisible).should(Condition.NotBeDisabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we use Condition.BeEnabled
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes no difference IMO, if we use Not.Be.Disabled or Be.Enabled which technically means input should ready for input keystrokes
Reasoning same as above “not disabled” == “enabled” but if "Be.Enabled" makes more sense let me know.
Happy to Change!
thx
{ | ||
"/api/v1/*": "/$1", | ||
"/api/v2/*": "/$1" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to add an empty line at the end of the file here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also why do we need this file ?
we have one inside fixtures/routes.json
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, there is only routes.json / db.json (checking in main branch)
- Currently, there’s only
routes.json
anddb.json
inmain
. - In this PR, I have moved them into
cypress/fixtures
for better organization — they’re related to e2e tests. - From my understanding, they’re mainly used to make sure
json-server
runs and aren’t used for test mocks. - We already have
datacenter(s).json
files andEndpoints.ts
for API endpoints.
FYI: Instead of deleting i have moved these files into cypress/fixtures folder + updated package.json script to PICK those files from cypress/fixtures
path
let me know if something problematic in the following change or my understanding
Thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good 👍
but i think we need to add an empty line at the end of the file here
if ($warning.length > 0) { | ||
cy.reload(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add this to settings/defaults.spec.ts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can but TBH, i didn't found an issue while running default.spec however we can add it but I think there is not need to add extra check for default.spec unless it was problematic same as of ssh-keys.spec
thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one other thing is that if '.no-data-warning' is not found then it will fail right ? so i think that is not right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahmadhamzh did you mean .no-data-warning
if class is removed or changed to something else it shouldn't fail or did you mean to keep trying multiple times and fail then?
Ah! I see what you mean in case warning doesn't exists cypress will try to fetch warning and if it fails test will fail too. Which shouldn't be the case. Hmmm I see.
@@ -59,8 +59,16 @@ describe('SSH Key Management Story', () => { | |||
Pages.expect(View.Clusters.Default); | |||
}); | |||
|
|||
it('should create the cluster with ssh key', {retries: 3}, () => { | |||
it('should create the cluster with ssh key', () => { | |||
Pages.Clusters.List.visit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this already been done in the previous step ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each it
block runs independently if it was handled in beforeEach block then we might not need this line but to be explicit we need to navigate to list page once this test runs.
thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO there's no point in visiting the clusters list page if we're not going to perform any action there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, I thought the Pages.Wizard.visit()
is navigating directly to wizard. But in other case, @ahmadhamzh is correct, we're already navigating to clusters list page in previous test. I agree that all tests should run independently but in this case every test is dependent on previous one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback Response
@@ -59,8 +59,16 @@ describe('SSH Key Management Story', () => { | |||
Pages.expect(View.Clusters.Default); | |||
}); | |||
|
|||
it('should create the cluster with ssh key', {retries: 3}, () => { | |||
it('should create the cluster with ssh key', () => { | |||
Pages.Clusters.List.visit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each it
block runs independently if it was handled in beforeEach block then we might not need this line but to be explicit we need to navigate to list page once this test runs.
thoughts?
if ($warning.length > 0) { | ||
cy.reload(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can but TBH, i didn't found an issue while running default.spec however we can add it but I think there is not need to add extra check for default.spec unless it was problematic same as of ssh-keys.spec
thoughts?
this.Buttons.openDialog.click(); | ||
this.Elements.addDialogInput.type(name).then(_ => this._strategy?.onCreate()); | ||
this.Buttons.openDialog.click({force: true}); | ||
this.Elements.addDialogInput.should(Condition.BeVisible).should(Condition.NotBeDisabled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes no difference IMO, if we use Not.Be.Disabled or Be.Enabled which technically means input should ready for input keystrokes
Reasoning same as above “not disabled” == “enabled” but if "Be.Enabled" makes more sense let me know.
Happy to Change!
thx
@@ -26,6 +26,7 @@ export enum Condition { | |||
NotBe = 'not.be', | |||
NotBeChecked = 'not.be.checked', | |||
NotBeVisible = 'not.be.visible', | |||
NotBeDisabled = 'not.be.disabled', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“not disabled” == “enabled” Another way of testing assertions using negative expression but if that make harder form understanding POV let me know wdyt?
{ | ||
"/api/v1/*": "/$1", | ||
"/api/v2/*": "/$1" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, there is only routes.json / db.json (checking in main branch)
- Currently, there’s only
routes.json
anddb.json
inmain
. - In this PR, I have moved them into
cypress/fixtures
for better organization — they’re related to e2e tests. - From my understanding, they’re mainly used to make sure
json-server
runs and aren’t used for test mocks. - We already have
datacenter(s).json
files andEndpoints.ts
for API endpoints.
FYI: Instead of deleting i have moved these files into cypress/fixtures folder + updated package.json script to PICK those files from cypress/fixtures
path
let me know if something problematic in the following change or my understanding
Thx
# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md | ||
|
||
approvers: | ||
- sig-ui | ||
|
||
reviewers: | ||
- sig-ui | ||
|
||
labels: | ||
- sig-ui | ||
|
||
options: | ||
no_parent_owners: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this files due to moving files under cypress/fixtures folder?
Any thoughts on this?
if ($warning.length > 0) { | ||
cy.reload(); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one other thing is that if '.no-data-warning' is not found then it will fail right ? so i think that is not right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure we don't need this file anymore ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes —
db.json
and routes.json
have been moved to modules/web/cypress/fixtures
and related scripts updated in package.json
.
Therefore, there’s no need for an OWNER file there anymore, as the directory no longer contains any files.
@@ -26,6 +26,7 @@ export enum Condition { | |||
NotBe = 'not.be', | |||
NotBeChecked = 'not.be.checked', | |||
NotBeVisible = 'not.be.visible', | |||
NotBeDisabled = 'not.be.disabled', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally, I think it might be a bit redundant, but I’m okay if you feel it makes more sense to keep it.
{ | ||
"/api/v1/*": "/$1", | ||
"/api/v2/*": "/$1" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good 👍
but i think we need to add an empty line at the end of the file here
Pages.Members.accessSideNavItem(); | ||
Pages.SSHKeys.visit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test was failing as DDN menu was not opened and DOM node is not visible therefore fails.
Where as Pages.SSHKeys.visit()
only clicks the button if DDN is opened.
reference test: should create the ssh key
…izard for cluster creation instead of dep on prev test case
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pre-dashboard-web-integration-tests |
…pec before cluster creation
/test pre-dashboard-web-integration-tests |
/test pre-dashboard-web-integration-tests-ce |
There was a failure (on different scenario) for ssh keys spec: https://minio.worker.ci.k8c.io/dashboard-cypress-artifacts/pr-7427-pre-dashboard-web-integration-tests-1934999113099644928/videos/ssh-keys.spec.ts.mp4 |
What this PR does / why we need it:
This PR fixes flakiness in ssh-keys integration tests
Which issue(s) this PR fixes:
Fixes #6940
What type of PR is this?
/kind bug
/find failing-test
Special notes for your reviewer:
Does this PR introduce a user-facing change? Then add your Release Note here:
Documentation: