Skip to content
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

test: Use wait_text to check an empty string #1195

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

skobyda
Copy link
Contributor

@skobyda skobyda commented Sep 4, 2023

Using wait_in_text(selector, "") always validates as true (since empty string is always subset of any string), rendering the test useless.

@martinpitt
Copy link
Member

wait_js_cond(ph_text_is("#pool-myPoolTwo-system-volume-VolumeOne-usedby","")): Uncaught (in promise) Error: actual text: subVmTest1

... and it fails

@skobyda
Copy link
Contributor Author

skobyda commented Sep 4, 2023

wait_js_cond(ph_text_is("#pool-myPoolTwo-system-volume-VolumeOne-usedby","")): Uncaught (in promise) Error: actual text: subVmTest1

... and it fails

So the test was really useless

Using wait_in_text(selector, "") always validates as true (since empty
string is always subset of any string), rendering the test useless.
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing the test properly!

@@ -235,6 +235,19 @@ def run_admin(self, cmd, connectionName='system'):
else:
return m.execute(cmd)

def deleteDisk(self, target, vm_name="subVmTest1"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You just defined this function without using this anywhere. Forgot to commit something?

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@martinpitt martinpitt merged commit a50d88e into cockpit-project:main Sep 6, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants