Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement(tests): Kubernetes E2E test framework (#2702)
* Correct test-integration-kubernetes at Makefile Signed-off-by: MOZGIII <[email protected]> * Fix the tag overwrite logic at scripts/deploy-kubernetes-test.sh Signed-off-by: MOZGIII <[email protected]> * Make scripts/test-integration-kubernetes.sh more tweakable Signed-off-by: MOZGIII <[email protected]> * Reorder namespace and global config deletion command The idea is namespace removal takes the longest, so we'd rather leave it hanging than config deletion. Then is user gets tired of waiting and sends a SIGINT we don't leave the global config dangling - just the namespace removal, which will complete in the background. So it's just a user experience improvement. Signed-off-by: MOZGIII <[email protected]> * Add kubernetes-test-framework Signed-off-by: MOZGIII <[email protected]> * Implement a first PoC kubernetes test Signed-off-by: MOZGIII <[email protected]> * K8s integration test is really an e2e test, rename accordingly Signed-off-by: MOZGIII <[email protected]> * Do not even publish container image at CI since we use "none" minikube driver Signed-off-by: MOZGIII <[email protected]> * Isolate kubernetes e2e tests via requried-features Signed-off-by: MOZGIII <[email protected]> * Add lock to the test framework Signed-off-by: MOZGIII <[email protected]> * Add some test cases to k8s e2e tests Signed-off-by: MOZGIII <[email protected]> * Add the ability to use quick debug builds in e2e tests Useful to speed up the development cycles Signed-off-by: MOZGIII <[email protected]> * Use a single thread for test Signed-off-by: MOZGIII <[email protected]> * Made test framework async Signed-off-by: MOZGIII <[email protected]> * Allow specifying scope Signed-off-by: MOZGIII <[email protected]> * Correct arguments preparation for cargo test at scripts/test-e2e-kubernetes.sh Signed-off-by: MOZGIII <[email protected]> * Get rid of $(RUN) at test-e2e-kubernetes target at Makefile Signed-off-by: MOZGIII <[email protected]> * Set LOG at distribution/kubernetes/vector-namespaced.yaml Signed-off-by: MOZGIII <[email protected]> * Add a test to validate the pods are properly excluded This tool a while to implement, and required that we make framework async. Signed-off-by: MOZGIII <[email protected]> * Fix a typo Signed-off-by: MOZGIII <[email protected]> * Add test to assert we properly collect logs from multiple namespaces Signed-off-by: MOZGIII <[email protected]> * Polish the test framework API Signed-off-by: MOZGIII <[email protected]> * Add E2E tests section to the contribution guide Signed-off-by: MOZGIII <[email protected]> * Kubernetes E2E tests are no longer experimental, should work consistently Signed-off-by: MOZGIII <[email protected]> * Add kubernetes version to the test name Signed-off-by: MOZGIII <[email protected]> * Bump minikube Signed-off-by: MOZGIII <[email protected]> * Bump kubernetes releases Signed-off-by: MOZGIII <[email protected]> * Use minikube cache instead of manually moving image around Signed-off-by: MOZGIII <[email protected]> * Test against multiple container runtimes Signed-off-by: MOZGIII <[email protected]> * Remove unused repeating_echo_cmd Signed-off-by: MOZGIII <[email protected]> * Display timeout Signed-off-by: MOZGIII <[email protected]> * Shorter title Signed-off-by: MOZGIII <[email protected]> * Switch to docker driver at minikube Signed-off-by: MOZGIII <[email protected]> * Remove the no_newline_at_eol test Turns out, this test was invalid. The root cause with this is that, in essence, Kubernetes expects logs to consist of line, with line being defined as in POSIX - a sequence of characters *ending with \n*. Thus it's *not valid* to emit a log line without the terminating newline symbol in Kubernetes. One effect of this is that when using the CRI log format, lines won't be considered complete until we emit a newline character arrives - and the additional content before the newline will be added to the log line that's missing the newline. Given all of the above, there's no reason for this test to exist. The reason it was added was the behaviour detail of the docker log driver, but it's a mere implementation detail, and it we should abstract from it. The original statement of the test is also ill-posed, cause, as explained above, it's non-partial messages (and, generally speaking, any message) that doesn't end with newline isn't a valid log line in the first place. Signed-off-by: MOZGIII <[email protected]> * Increase timeout to rollout vector to 30s Signed-off-by: MOZGIII <[email protected]> * Temporarily disable crio Signed-off-by: MOZGIII <[email protected]> * Apply workaround for CRIO Signed-off-by: MOZGIII <[email protected]> * Fix clippy Signed-off-by: MOZGIII <[email protected]> * Unset log level in skaffold dev config to fallback to the one set in container Signed-off-by: MOZGIII <[email protected]> * Add exec_tail to the test framework Signed-off-by: MOZGIII <[email protected]> * Fix a typo at the comment Signed-off-by: MOZGIII <[email protected]> * Fix the typos and styling at the crate doccomment Signed-off-by: MOZGIII <[email protected]> * Bump k8s versions for E2E tests at CI Signed-off-by: MOZGIII <[email protected]> * Rename template params to pascal case Signed-off-by: MOZGIII <[email protected]> * Remove Drop from ResourceFile Signed-off-by: MOZGIII <[email protected]> * Proper authors Signed-off-by: MOZGIII <[email protected]> * Rename crate to k8s-test-framework More in-line with the naming patterns of the rest of the k8s-related crates. Signed-off-by: MOZGIII <[email protected]> * Correct kubectl comment at the interface Signed-off-by: MOZGIII <[email protected]> * Bumped k8s and minikube versions at CI Signed-off-by: MOZGIII <[email protected]> * Add a comment explaining the timeout at pod filtering test Signed-off-by: MOZGIII <[email protected]> * Rollback minikube to 0.11.0 Signed-off-by: MOZGIII <[email protected]> * Update CONTRIBUTING.md Co-authored-by: Ana Hobden <[email protected]> Signed-off-by: MOZGIII <[email protected]> * Update distribution/kubernetes/vector-namespaced.yaml Co-authored-by: Ana Hobden <[email protected]> Signed-off-by: MOZGIII <[email protected]> * Fix an error at CONTRIBUTING.md Signed-off-by: MOZGIII <[email protected]> * Remove a trivial line from the doc Signed-off-by: MOZGIII <[email protected]> * Do second attemtp to start up minikube if the first one failed Signed-off-by: MOZGIII <[email protected]> * Print minikube logs if it fails to start Signed-off-by: MOZGIII <[email protected]> * Provide a default for CONTAINER_IMAGE_REPO if USE_MINIKUBE_CACHE is set Signed-off-by: MOZGIII <[email protected]> * Update the CONTRIBUTING.md for CONTAINER_IMAGE_REPO default if USE_MINIKUBE_CACHE is set Signed-off-by: MOZGIII <[email protected]> * Increase all rollout/wait timeouts to one minute Signed-off-by: MOZGIII <[email protected]> * Fix syntax error around minikube start command Signed-off-by: MOZGIII <[email protected]> * Rollback k8s v1.16.13 to v1.16.12 at CI Signed-off-by: MOZGIII <[email protected]> * Add minikube cache autodetection Signed-off-by: MOZGIII <[email protected]> * Document USE_MINIKUBE_CACHE=auto mode Signed-off-by: MOZGIII <[email protected]> * Add a note on minikube bug to CONTRIBUTING.md Signed-off-by: MOZGIII <[email protected]> * Add a note on minikube on ZFS to CONTRIBUTING.md Signed-off-by: MOZGIII <[email protected]> * Fix the doc comment at scripts/deploy-kubernetes-test.sh Signed-off-by: MOZGIII <[email protected]> * Apply a workaround for kubectl from snap Signed-off-by: MOZGIII <[email protected]> * Extract and reuse scripts/skaffold-dockerignore.sh Signed-off-by: MOZGIII <[email protected]> Co-authored-by: Ana Hobden <[email protected]>
- Loading branch information