little-angry-clouds / kubernetes-binaries-managers

Kubernetes related binaries manager.
GNU General Public License v3.0
101 stars 11 forks source link

Add tests to check that oc and kubectl configuration are valid #27

Open alexppg opened 3 years ago

alexppg commented 3 years ago

See https://github.com/little-angry-clouds/kubernetes-binaries-managers/pull/26/.

TyBrown commented 3 years ago

I'm not quite sure how or even if it's worth testing the kubeconfig validation ourselves... given that we're having k8s.io/client-go/tools/clientcmd handle the parsing... it's doing it's own validation itself, so I think handling the error appropriately is probably the right path forward here.

Unless you mean a kind type test of some sort and validating that we don't get a panic?

alexppg commented 3 years ago

You maybe didn't see it because I didn't have activated the actions for PR forks, but there's some tests. The unitary, which as you say wouldn't make much sense to test. But there's also integration tests with https://github.com/bats-core/bats-core. It may make sense to add a test that messes the kubeconfig and ensures that it fails gracefully. It would go here: https://github.com/little-angry-clouds/kubernetes-binaries-managers/blob/master/tests/wrappers.test