samba-in-kubernetes / samba-operator

An operator for a Samba as a service on PVCs in kubernetes
Apache License 2.0
120 stars 24 forks source link

Integration test organizational cleanups #223

Closed phlogistonjohn closed 2 years ago

phlogistonjohn commented 2 years ago

I started working on making the tests more robust and immediately became annoyed with our approach to organization as well a the semi-non-deterministic execution of the test due to our use of a map.

This may be a bit overkill but I hope it makes things more maintainable and less prone to becoming a jumble if parts are copy-n-pasted in the future.

The new TestGroup type allows a much more consistent and deterministic way of grouping test suites and other (child) test groups. Beyond this PR the hope is that one only needs to think about the test group very rarely and can mostly copy the structure of the initfunctions in the other files that have test suites to execute.

Because determinism could possibly lead to implicit dependencies between tests I also amused myself by adding a Shuffle method that can be invoked through an environment variable. This causes the tests to be run in a randomized order. It is not enabled by default. I have not committed to the idea, but I am considering enabling it for the scheduled runs of the CI (but not PRs). Either way, its there in case we (I) want it.

This is part one of many(?) organizational changes of the integration tests as I hack my way through the weeds that have grown in the test code.

phlogistonjohn commented 2 years ago

/retest centos-ci/sink-clustered/mini-k8s-1.23

phlogistonjohn commented 2 years ago

/test centos-ci/sink-clustered/mini-k8s-1.23

phlogistonjohn commented 2 years ago

Thanks for looking at this PR so quickly!