Skip to content

Rename test modules to not collide #1639

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thegreyd
Copy link
Contributor

@thegreyd thegreyd commented May 23, 2025

When working in art-tools repo/dir as a whole, test discovery with pytest does not work correctly,
because of tests module name collision.

pytest --co - this stumps IDEs/extensions/workflows that rely on pytest discovery in the folder.

To get around this, rename test modules to align with their parent module, e.g. tests_doozer etc.

With this change pytest --co and pytest . in root dir should be green

Copy link
Contributor

openshift-ci bot commented May 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign sosiouxme for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@thegreyd thegreyd force-pushed the test_setup_tweaks branch from 47e28c5 to 77ce0d5 Compare May 23, 2025 04:52
@thegreyd thegreyd added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label May 23, 2025
@thegreyd thegreyd requested review from vfreex and locriandev May 23, 2025 05:00
Copy link
Contributor

openshift-ci bot commented May 23, 2025

@thegreyd: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/security 647e6d7 link false /test security

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@locriandev
Copy link
Contributor

I like the idea, tried the PR out but running pytest . or pytest -co but tests are failing on ImportError. It is also evident by the PR test run:

E   ImportError: cannot import name '__version__' from 'pyartcd' (unknown location)

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2025
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@@ -22,15 +22,15 @@
long_description=open('README.md').read(),
url="https://github.com/openshift-eng/art-tools/tree/main/doozer",
license="Apache License, Version 2.0",
packages=find_packages(exclude=["tests", "tests.*", "tests_functional", "tests_functional.*"]),
packages=find_packages(exclude=["tests.*"]),
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be

Suggested change
packages=find_packages(exclude=["tests.*"]),
packages=find_packages(exclude=["tests_doozer", "tests_doozer.*", "tests_functional_doozer", "tests_functional_doozer.*"]),

Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking we need similar changes for elliott and pyartcd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants