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

add skip kw to test function #12362

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bruchar1
Copy link
Member

No description provided.

Copy link
Member

@dcbaker dcbaker left a comment

Choose a reason for hiding this comment

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

I noticed one small code thing. I don't have an opinion on whether this is a good idea or not, see if anyone else weighs in

mesonbuild/interpreter/interpreter.py Outdated Show resolved Hide resolved
@eli-schwartz
Copy link
Member

I don't understand the purpose of this feature.

What does "to keep the test in the list of available tests" mean? It's not actually available.
Why is it being skipped? Does it not work? Shouldn't it be marked as EXPECTEDFAIL after running and failing? This also means that you know when it starts working (UNEXPECTEDPASS is an error).
Is the test missing some requirements? We have a way for the test itself to communicate this at runtime rather than hardcoding it in the test definition.

If none of this is suitable, and you just want to keep the test in meson.build, why not comment it out?

@bruchar1
Copy link
Member Author

In my monorepo, I have a suite of python tests needing pytest for running them. If pytest is not found, I cannot run the tests, but I don't want to prevent other parts of the project being configured. I could just put the test into a conditional block, but then trying to run it would result in an error that the test does not exist. With a conditional skip: not pytest.found(), the test still exists, but will not try to run if pytest is not there, and will be reported as skipped, so I know some tests did not run at all.

@petere
Copy link
Contributor

petere commented Nov 2, 2023

I was referred to this PR from here. I just want to support this feature, it addresses a need that we have identified.

It would be nice if a reason for the skip could also be given (like in my prototype patch), by an additional string argument somewhere. But that might be out of scope for this patch, looking at how the code is structured.

@bruchar1
Copy link
Member Author

rebased and targeted for 1.4.0

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.

None yet

4 participants