k8s-test

module
v0.0.0-...-a4c1b39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2023 License: MIT

README

KubeVeritas

This project is under development

Introduction

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.

Key Features

  1. 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.
  2. 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.
  3. [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.
  4. [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.

Usage

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.

Output

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.

Contributing

To contribute to KubeVeritas, please follow these guidelines:

  1. Fork the repository and create a new branch for your feature or bug fix.
  2. Write tests for your code.
  3. Run go test and ensure that all tests pass.
  4. Submit a pull request.

License

KubeVeritas is licensed under the MIT License. See the LICENSE file for more information.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL