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

when running testr, avoid emitting this warning #10

Merged
merged 1 commit into from
Apr 22, 2020
Merged

Conversation

javierggt
Copy link
Collaborator

@javierggt javierggt commented Apr 18, 2020

Description

This PR introduces changes to silence a warning ska_helpers.version emits whenever it can't figure out the version. In particular, this warning is emitted during testr runs. The resulting warning is then misinterpreted as a failure.

Strictly speaking, the warning is correct, because pytest seems to be importing the module incorrectly. It does that while climbing the directory tree until it finds the root of the package. In the end, it does the right import and everything is ok. At this point the warning was emitted already.

These are possible solutions:

  1. silence the warning when a TESTR_ variable is in os.environ.
  2. set a specific environment variable to silence this warning.
  3. Modify the log parsing tests to correctly interpret and skip this warning.
  4. have ska_helpers.version climb the directory tree to find its root.

This PR implements the first option. Second could also be. I would hesitate to implement the fourth.

Testing

  • Passes unit tests on MacOS, linux, Windows (at least one required)
  • Functional testing: runtestr passes when doing it on Ska.Shell.

Fixes #

@javierggt
Copy link
Collaborator Author

Perhaps we should approve this before closing sot/skare3/pull/342

Copy link
Member

@taldcroft taldcroft left a comment

Choose a reason for hiding this comment

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

Looks fine as a workaround, no impact to default by-hand testing.

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