-
Notifications
You must be signed in to change notification settings - Fork 9
Generic sanity check for all collections #96
Comments
Sounds reasonable. But I have a question about this:
If a collection takes, say, two and a half months to fix it, would we still remove it from Ansible 7? Or would we "un-deprecate" it? Could we even do it, I mean how would we add to the changelog: We've deprecated this collection and wanted to remove it from Ansible 7 but we've changed our minds. |
I guess we can still un-deprecate it if we're happy with the result (and the explanation why it took so long). I guess this would work similarly to the document we're voting on in #90, i.e. we'd have a procedure described for this with possible conditions. |
But how would we document this in the changelog? There's |
I'd probably use |
All the ideas in the description sound good to me |
Do all collections actually have sanity tests? Especially if they are only containing roles, I'm uncertain if these are even doing much, they seem very geared towards Python code in plugins from a quick look. |
@MarkusTeufelberger the ones included in Ansible are required to run (and pass) sanity checks (though it's not clear how many actually do - fortinet.fortios is an example of a collection which obviously didn't run them before release). ansible-test's sanity checks don't do much for collections that only contain roles, but I think it's still a good idea to run them (it will also be rather quick), because a) the tests also check meta/runtime.yml (which you can have without plugins/modules) and changelog fragments (in case you use them), and b) hopefully sooner or later there will be a sanity check for role argument specs. |
FYI I have a WIP PR in which I provide an implementation to (optionally) run sanity tests on all the collections included the package as part of the build process: ansible-community/antsibull-build#419 |
I've ran a comprehensive sanity test on every collection included in 6.0.0a2 (minus pylint) and found that 67 collections (out of 98) are currently failing sanity tests, data is here: https://gist.github.com/dmsimard/8a0526917398b19410581568947ee0dc I'm not entirely positive if part of it could be due to ansible-test somehow not picking up the ignore files and need to double check but I figured I would at least share my preliminary findings for the time being and will update them if need be. |
Thanks @dmsimard, great work! I'm having a look at the output for
They're deprecated, so we didn't want to invest any more time in them. I thought this would ignore the errors: Interestingly, Then there are a lot of this:
I wonder why we don't see this in our Zuul jobs (see here for a recent CI run). Hmmm, we've already replaced Nevertheless, the question remains: Why don't we see this error in the Zuul jobs? |
The problems in community.general and community.network are very likely due to symlinks being converted to actual files by the build process (ansible-community/antsibull-build#218). (Also for c.g the wrong version is used, that's fixed in ansible-community/antsibull-build#421.) |
@mariolenz you don't see these errors in Zuul since you don't test against stable-2.13. You only test against devel (and the errors are correctly ignored in the ignore-2.14.txt), but then you test against milestone, which is a very out of date version of stable-2.13 (for example it does not have ansible/ansible#77268 which was merged on March 17th, which is what produces these errors). It basically is the state of the devel branch on 2022-02-14.
Since the whole of |
Thanks, that explains it. And now I remember: I couldn't ignore those in ignore-2.13.txt because milestone is so old that it doesn't know about them.
I think
|
Shouldn't the milestone branch have been advanced 2022-05-02? |
Maybe some collections test against the milestone branch, not against stable-2.13. We're doing exactly this in Now that the milestone branch has been advanced (ansible-collections/news-for-maintainers#16), we hopefully will see some improvements here because they run into problems in their CI. |
I've finished creating standalone issues in collection repositories where we picked up errors from sanity tests. @felixfontein pointed out in ansible-collections/community.dns#100 that running tests from the release tarball is not ideal because of a symlink issue described in ansible-community/antsibull-build#218 so I will address that by the time we run tests again. |
Sanity tests can be actually fixed like in ansible-collections/community.rabbitmq#121 but not released yet.
|
I should say: Yes.
Generally: Yes. But I think "on the spot" might be a bit extreme, as soon as possible and preferably befor the next Ansible release would be sufficient, wouldn't it? |
I fully agree! |
A quick recap and then an update:
It turns out there was something wrong:
I've re-run sanity tests for every packaged collection, this time installed with This time there were 38 failures out of 98 with many now passing and a few now failing (edit: this was mistakenly with 2.12, see edit at the end): I'll update the issues I've created and I've sent a WIP PR to ansible-build-data (changing the approach from within antsibull) so we can test this on a regular basis: ansible-community/ansible-build-data#122 Edit: While troubleshooting, I realized I mistakenly ran the tests with "ansible-galaxy collection install" from ansible-core 2.12 instead of 2.13.0rc1 🤦 It looks like that may be why there were less failures because it's back up to 59 now: I apologize for the confusion, even though the comparison between 2.12 and 2.13 may be interesting. |
@dmsimard The
Is it OK for you if I do? |
@mariolenz your help would be appreciated, sure ! I'd still like to understand why it is that these particular collections are failing from the tarball (and not from My initial objective was to test the package itself as it is shipped so it's unfortunate that we get different results but we have to start somewhere and it may be a better investment to focus on the collections that are failing when installing with galaxy. We can always circle back to the packaging later. |
@dmsimard I can't close those issues due to missing permissions :-/ But I've added a comment that they can be closed because of a false positive from our side. |
I've closed the remaining ones, thanks ! |
Worked through some of the collections and updated linked issues above (will edit this list for a first batch of updates to keep the noise down):
|
I haven't gotten around to re-visiting every collection issue yet but in the meantime, 6.0.0a3 is upon us and I've run sanity tests again with the latest releases of collections. We're down from 59 failures to 51 which is progress (full data here): |
@dmsimard Most of the issues in the collections that don't fail any more have been closed already. I have added a comment that the tests seem to succeed in 6.0.0a3 to the two or three remaining.
edit: Still open: |
distutils is deprecated in 3.10: https://peps.python.org/pep-0632/ Ansible requires it to be replaced[1] [1] ansible-community/community-topics#96 ansible-collections/news-for-maintainers#18 Change-Id: I2bae37f206319e8f9ace468f5b94f6be643b6a3c
distutils is deprecated in 3.10: https://peps.python.org/pep-0632/ Ansible requires it to be replaced[1] [1] ansible-community/community-topics#96 ansible-collections/news-for-maintainers#18 Change-Id: I2bae37f206319e8f9ace468f5b94f6be643b6a3c (cherry picked from commit ccbbc31)
@felixfontein Please close this issue if done, or open a new forum topic and then close the issue with a pointer to the new discussion: Community-topics: Archiving the repo |
I guess the place to continue the discussion is https://forum.ansible.com/t/testing-collections-within-the-ansible-package/2455. Thanks everyone! |
Summary
As ansible-community/ansible-build-data#114 showed we should really check the existing collections including in the Ansible package. Some ideas:
ansible-test sanity --docker -v
) on all collections. Let's specify one or two of the stable branches for that.What do you think?
Also it would be great to do some manual review (check whether CI is set up, look at least at some of the conditions from https://github.com/ansible-collections/overview/blob/main/collection_requirements.rst, ...), but that is very time consuming, and since we already struggle with reviewing new collections, I doubt we will find enough time to do this.
The text was updated successfully, but these errors were encountered: