Skip to content

CP-49928/static-vdis: Add tests (1/3 of: prepare move to python3/) #5740

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

Conversation

bernhardkaindl
Copy link
Collaborator

@bernhardkaindl bernhardkaindl commented Jun 26, 2024

Summary:

  • CP-49928: Cover (test) the functions list_vdis() and fresh_name() of static-vdis
  • This is a pre-condition to apply typing fixes to them (to satisfy diff-cover checks in CI)
    • Details moved to my 1st comment below.

Adding just for information: @ashwin9390, @stephenchengCloud

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
@bernhardkaindl bernhardkaindl force-pushed the static_vdis-test_functions_before_type_fixes branch from 1a21de9 to d6ac6a6 Compare June 26, 2024 23:08
Copy link
Collaborator Author

@bernhardkaindl bernhardkaindl left a comment

Choose a reason for hiding this comment

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

Details:

This PR extracts the 1st commit of #5731 for a smaller/split review and merge:

Before scripts/static-vdis can be moved to the python3 tree, the pytype warnings need to be fixed.

  • For this, a few functions need tiny, mostly stylistic changes to satisfy type checking warnings.

But before we can do that:

  • the functions need code coverage to pass the diff-coverage check in CI.

Hence, add two simple test cases to:

  • cover these functions
    and to
  • test them to ensure that they continue to work.

PS:

By already having the approvals of @psafont and @stephenchengCloud as part of #5731, this already has two approvals:

  • One by @psafont (1 of two needed member approvals) and one by @stephenchengCloud as a guest.
  • I opened this just to make the remaining PR that fixes the type warnings much smaller.

Updates applied:

@bernhardkaindl bernhardkaindl changed the title CP-49928: Cover (test) the functions list_vdis() and fresh_name() of static-vdis . CP-49928/static-vdis: Add tests (1/3 of: prepare move to python3/) Jun 27, 2024
Copy link
Contributor

@contificate contificate left a comment

Choose a reason for hiding this comment

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

Giving approval to unblock these merges. There are already 2 ticks from people more qualified to review this than me, it'd be good to get some movement.

@bernhardkaindl bernhardkaindl merged commit f225cc4 into xapi-project:feature/py3 Jul 2, 2024
14 checks passed
bernhardkaindl added a commit to xenserver-next/xen-api that referenced this pull request Jul 2, 2024
Warning fix (for pyright) in scripts/static-vdis:
- fresh_name is covered by github.com/xapi-project/pull/5740

Details: Always return a value in fresh_name():
- Was already so, but pyright doesn't "understand" this.
- Fix the warning by de-indenting `return 0` of fresh_name()

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
@bernhardkaindl bernhardkaindl deleted the static_vdis-test_functions_before_type_fixes branch July 2, 2024 13:32
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.

4 participants