-
Notifications
You must be signed in to change notification settings - Fork 906
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
pytest: DX - Support targeting specific tests using make pytest
w/ PYTEST_TESTS
#7681
pytest: DX - Support targeting specific tests using make pytest
w/ PYTEST_TESTS
#7681
Conversation
356ec4c
to
340385c
Compare
@s373nZ This functionality is already achievable by:
A typical command for me to run a test looks like:
Some options available in the code are:
While the testing documentation could be expanded with additional details, should we close this PR, or is there something I am overlooking? |
@ShahanaFarooqui Thank you very much for the example and comprehensive explanation. That definitely helps to understand more how you are using it more in practice. As I mentioned in the PR description, under my setup, I have to manually fix the Personally, I still think there's a case to be made for this PR in the spirit of "it doesn't hurt", but I'm totally fine with closing this PR if you like. It was just a small nuisance and improvement I thought to offer. Thanks for the consideration. |
@s373nZ I missed the part about needing to export I tested the change with & without PYTEST_TESTS and it works perfectly.
We can implement this change, but please ensure to include the relevant details in the testing documentation as well. |
@ShahanaFarooqui I added the usage of |
8df46dc
to
951d07e
Compare
94cbd2e
to
2e0c523
Compare
Moved the line re: |
2e0c523
to
5d4234f
Compare
Merged two ACK 5d4234f. |
5d4234f
to
b4285ad
Compare
Select tests by setting the `PYTEST_TESTS` environment variable. Changelog-None
Also update the table of optional environment variables to set when running the integration tests.
b4285ad
to
da7f95a
Compare
This is a small PR intended to slightly improve developer experience. When running the Pytest integration testing suite locally using the command
make pytest
, the build system takes care of altering the local context variablePYTHONPATH
to make sure contributed modules are accessible to the process. While this works great for running the entire test suite, oftentimes developers are concerned with repeatedly running a subset of the tests, the particular test relevant to the functionality they are working on, or some problematic tests which the suite reports failing.Currently, in order to target specific tests for a
pytest
run, a developer might:make pytest
PYTHONPATH
PYTHONPATH
variablepytest
outside of theMakefile
context and feeding in the targeted list of files and tests cases to the local commandThis PR suggests supporting the pass-through of a variable named
PYTEST_TESTS
which defaults totests/
and can be set in a similar fashion toPYTEST_PAR
andPYTEST_OPTS
. This would allow developers to skip a few steps in setting up their local environment for runningpytest
and enjoy some of theMakefile
's sane defaults if desired. For example,Certainly, experienced CLN developers already have more convenient workflows, so please let me know if there is a more accessible convention for this.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked: