nexus3-oss
nexus3-oss copied to clipboard
Improve molecule verify process
I've been doing some trial and error to leverage the Nexus API to verify/check if certain properties and values are updated during the molecule verify step.
This will allow us to implement more testing scenarios.
PR will follow shortly with some examples on how to contribute to this project.
@zeitounator I have been working on this over the weekend. After some digging through the molecule and testinfra docs I have come to the knowledge that testinfra is no longer the default verifier for molecule.
Few test cases I have created were also challenging or some even impossible to write using pytest and testinfra.
That made me decide to switch to the Ansible verifier for the tests I have written. One downside tho; Ansible verifier is much slower compared to testinfra. Unfortunately it's not possible to use multiple verifiers in a scenario and there's no plannend support for it, see: https://github.com/ansible/molecule/issues/3089
The suggested way of working with multiple verifiers is to have separate scenarios for it. I think thats a bit overkill.
At the moment there's just one testinfra test case for NPM. What should we do?
1: Write all verify tests using the Ansible verifier 2: Create different scenarios for testinfra and ansible verifiers 3: Anything else, open for suggestions
My view after several years maintaining this role is that the tests should be as light as possible and should not take time to be maintained. Sonatype is testing its own product and we should not reinvent the wheel. In the current tests:
- one is related to the reverse proxy functionality where a setting is needed in Apache to allow npm scoped packages downloads. (this also plays the role of testing nexus is alive...)
- the other was made at time apt just made it to nexus core and I'm seriously considering to drop it (considering the time I had to spend to revive the CI lately and the very little added value)
So unless the tests you plan to add have a clear and real added value for the role CI, I don't think it is worth to add any that go really beyond testing nexus is up and running and can respond to some basic requests.