CI good practice #13138
Replies: 3 comments 3 replies
-
Yes, it's the best practice to test as installed: https://blog.ganssle.io/articles/2019/08/test-as-installed.html. Different people do this differently, though. I've seen some just removing the locally importable thing. Others do Personally, I use a combination of these and even have an action for running tests from sdists instead of Git checkouts. Here's one of my recent examples: https://github.com/ansible/awx-plugins/tree/0d569b5/.github/workflows. Note that it takes a number of things to extremes and uses tox as a workflow tool (which is what I recommend for ensuring local runs are close to the CI). |
Beta Was this translation helpful? Give feedback.
-
One option is to use an |
Beta Was this translation helpful? Give feedback.
-
Thanks for both your answers and the reference! I do use separate "project" and "test" folders, with the pytest configuration [tool.pytest.ini_options]
testpaths = "test" I didn't realize that this meant that pytest was ran "from Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello,
In my CI workflow, amongst others, I wish to test the following:
First question is:
Is it considered a better practice to run pytest against the installed wheel vs against the local source code?
Second question is:
If the answer to the first question is yes, how to do that? Because I'm sure manipulating the
sys.path
to remove.
is a bad idea.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions