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

Issue 696 shell availability #747

Merged
merged 3 commits into from
Sep 17, 2019
Merged

Conversation

nerdvegas
Copy link
Contributor

Relevant: #696

ajohns added 2 commits September 14, 2019 10:47
-add 'is_available' method to shells
-update tests to run only on available shells
-renamed 'shell_dependent' to more intuitive 'per_available_shell'
-made a Shell method a classmethod
@nerdvegas nerdvegas requested review from maxnbk and bfloch September 14, 2019 00:49
@maxnbk
Copy link
Contributor

maxnbk commented Sep 14, 2019

is the intention for the tests to pass or to show as skipped in the resulting selftest?
(because as implemented, they are passing rather than showing as skipped in the report, which is what I would have expected.)
If the intention is for them to pass, then consider this approved by me, if the opposite, there is more to do.
Tested on Cent.

@nerdvegas
Copy link
Contributor Author

You can't actually skip the test (ala unittest.skip/TestCase.skipTest). This is because the per_available_shell decorator just loops over the wrapped function - if you skip, the remaining runs in the loop would be skipped too. This may be solvable with some fancy meta programming, but IMO isn't worth the effort.

Now that you mention test skipping though, I see a couple of other things that could be done better. I'll update this PR shortly with those additional fixes.

Copy link
Contributor

@bfloch bfloch left a comment

Choose a reason for hiding this comment

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

Tested on Windows. This is a different computer than at work and I get 2 errors on rez-selftest with cmd and a bunch more on python 3.7. But I am certain this is unrelated to your PR since master seems to be be even worse. Will create separate issues for it after I verified it is not related to my super old windows machine here. Looking forward to github actions :)

@JeanChristopheMorinPerso
Copy link
Member

Will test this in a couple of hours on Arch Linux, so an ultra up-to-date system with Python 2 and 3.

And as I already said, we would highly benefit to start to use pytest. This would allow us to have more granular tests (parametrized) which would allow us to skip based on complex conditions. But that's probably gonna be later. Code wise for now it looks good.

@nerdvegas
Copy link
Contributor Author

I'm familiar with pytest and I agree it'd be great to update the tests to use it. One note on that before I forget - IIRC vendoring pytest is a little problematic as it brings in a bunch of dependencies. But I actually think pytest may be a case that doesn't have to be vendorized. The primary reason for vendoring is to make rezification of rez itself trivial. However, since the rez API itself does not require tests to be present, then pytest isn't required to be vendored. So, I think pytest could be included via standard requirements.txt so it gets installed into the rez virtualenv. It would actually make sense to include this via a "test" extra also.

If anyone wants to talk further about this then let's take it to slack/ticket rather that polluting this thread further :)

@nerdvegas nerdvegas merged commit 99e0ddb into master Sep 17, 2019
@bpabel bpabel deleted the issue_696-shell-availability branch January 19, 2023 20:33
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