Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored tests to use golang testing
This PR refactors the E2E tests to use the standard `go test` runner. That allows us to use standard tooling for error handling, parallelism, skipping and failing tests and so on. It can be executed like so: ``` go test --kubernikus kubernikus.eu-nl-1.cloud.sap --kluster demo -v --cleanup=false --reuse ``` It is now possible to pass `--kluster` flag to specify the name of a kluster. If omitted a random name is generated. It is useful in combination with `--reuse` that skips Kluster creation and tries to use and existing kluster with given name. To easy with cleanup and running tests against the same kluster multiple times, all test objects like pods and services are created in a unique namespace. There's also a `--cleanup` flag. It allows to skip the cleanup steps. I ran with the idea to order the tests manually. So, we have a single Test that runs all over tests in a predefined order. It goes against the pure philosophy but works. Also, all setup and cleanup methods are also tests. Mainly for the reason that it can be parallelised and grouped easily. The `exec` functionality has been "migrated" from the kubernetes/e2e suite. We don't need to shell-out to `kubectl` anymore. The Authentication against Kubernikus (Openstack) and the Kubernetes Kluster has been refactored into the `framework` package. Wherever we need to wait and timeout the `client-go`'s wait package is being used. All global state is gone. The framworks are initialised from flags and ENV in the setup `TestRunner` and passed to structs for each "suite" of tests.
- Loading branch information