-
Notifications
You must be signed in to change notification settings - Fork 22
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
Sanity tests use Python version, they should not do that #120
Comments
The correct way to run sanity tests is to pick one Python version for every ansible-core/ansible-base/Ansible version, use that Python version to install ansible-core, and run |
@felixfontein I think the confusion on your pick one comes from this page. It lists a RANGE of python for each version of Ansible, and for things that want to test the widest variety of support with the sanity plugin. Only choosing one:one doesn't seem to give wide coverage. However the docker solution is also interesting, but I don't think there is any documentation on WHY you want to use the docker version, and/or python version, and different ansible versions, and how best to do that. I'd love to pick your brain on what we should do. I even just tried running the docker with python version and got
|
@sean-m-sullivan There is a reason why the CI of ansible/ansible has always (or at least for the last four+ years) been using |
okay, do see a collection with this set, But I am looking now, under the docs, looking at varous places, and not seeing anything about a config file or what should be in it. Is there somewhere I should be looking? So we should install a version of ansible, and then run ansible-test sanity --docker -v Maybe we should have a way of running sanity docker that has runs different versions of ansible and then runs tests like you say with different versions of python? just trying to understand this, so I can upgrade my testing |
The config file is documented here: https://github.com/ansible/ansible/blob/devel/test/lib/ansible_test/config/config.yml
What you usually do is install all versions of ansible-core that the collection supports, and for every one run So basically the matrix for sanity tests should only contain a list of ansible-core versions resp. branches ( |
Thanks this makes sense, I am thinking some of this should be in an ansible-doc page, so people can find it easier, but knowing about the docker option checking multiple versions of python, and the collection template, points me in the right direction. |
I agree, this isn't really (well) documented at the moment. |
I have a preference for this approach, each combination of python version and core version is reflected for unit, integration and sanity. I find this easier to navigate, isolate errors, and reproduce locally. Unless I'm missing something here, I think this provides the same coverage as a single https://github.com/ansible-collections/ansible.scm/actions/runs/6016182974 also- using a combination of the ansible extension and the tox-ansible plugin, each entry in the matrix shows in the vsCode test tree and allows for point and click running etc. (the tox functionality is still in preview and a little buggy) The same is avaiable at the command line
each can be run independantly, and the virtual environment is available for each after the test run for additional troubleshooting or debugging. This is all done with tools commonly used in the python ecosystem, tox and pytest. |
Combinations of Python version + core version make sense for integration tests. They can make sense for unit tests, for efficiency reasons, but they do not make sense for sanity tests. Most sanity tests have to be run once per core version, not multiple times. If you run them with every Python version supported by core, that's a waste of CI resources. Considering how scarce CI resources are (ansible-community/community-topics#237), not wasting CI resources should be a high priority. (Also I don't see why you need to do additional troubleshooting or debugging for sanity tests, except if the tests themselves are broken.) |
Sanity tests should not be run for specific Python versions. They should use
--docker
(for the default image) to run all sanity tests in a standarized environment.See for example https://docs.ansible.com/ansible/devel/community/collection_contributors/collection_requirements.html#ci-testing, which explicitly states
Considering that collections can and should explicitly avoid certain Python versions in https://github.com/ansible-network/github_actions/blob/main/.github/workflows/sanity.yml, this doesn't seem to be satisfied.
The text was updated successfully, but these errors were encountered: