This project is under development
KubeVeritas
is a comprehensive Kubernetes testing framework developed in Golang, leveraging the Testify library. It empowers users to write and run test cases for their Kubernetes clusters with flexibility, ease of use, and high customizability. With features such as parallel test execution, xfail and xpass markers, and customizable reporting, k8s-test
offers a robust solution to validate and optimize Kubernetes deployments.
- Parallel Test Execution:
KubeVeritas
allows you to run tests concurrently, significantly reducing the total time required to execute your test cases while improving resource efficiency. - Parallel Test Suites:
KubeVeritas
extends the parallelism capabilities to test suites, enabling you to validate different aspects of your Kubernetes cluster simultaneously, further streamlining the testing process. - [Pending]xfail and xpass Markers:
KubeVeritas
incorporates xfail and xpass markers that help you flag tests that are expected to fail or pass, respectively. This feature is particularly useful when dealing with known issues or tracking improvements in your Kubernetes deployments. - [Pending]Customizable Reporting:
KubeVeritas
generates test reports in multiple formats, such as JUnit XML, JSON, and HTML, catering to different reporting needs. Additionally, it offers the option to create custom reporters to generate reports in your preferred format.
KubeVeritas
can be configured and run through a CLI interface. The following command-line options are available:
-parallelSuites
: Number of test suites to run in parallel (default: 1)-parallelTests
: Number of tests within a suite to run in parallel (default: 1)-kubeconfig
: Path to the kubeconfig file (default: empty string)
If no -kubeconfig
option is provided, k8s-test will attempt to use the KUBECONFIG
environment variable. If KUBECONFIG
is not set, k8s-test
will use the default ~/.kube/config
file.
To run KubeVeritas
, specify the test suites you want to run and the desired CLI options. For example:
k8s-test -parallelSuites=2 -kubeconfig=path/to/kubeconfig.yaml configmap calico
This command will run the configmap and calico test suites in parallel, using the specified kubeconfig file.
The Test Runner will generate logs and reports in a timestamped directory with the format 2006-01-02_15-04-05-logs
. This directory will be created in the current working directory of your program. Inside the logs directory, you will find the following files:
-
Log files: For each test in each test suite, a separate log file will be created. The log file names follow the format
<suite_name>_<test_name>.log
. These log files contain the standard output (stdout) generated by the corresponding test. -
Filtered JSON files: For each test suite, a filtered JSON file will be created. The file names follow the format
<suite_name>_filtered.json
. These files contain the JSON test results with the "output" action events excluded.
To contribute to KubeVeritas
, please follow these guidelines:
- Fork the repository and create a new branch for your feature or bug fix.
- Write tests for your code.
- Run
go test
and ensure that all tests pass. - Submit a pull request.
KubeVeritas
is licensed under the MIT License. See the LICENSE file for more information.