• Stars
    star
    206
  • Rank 189,437 (Top 4 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 6 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kubernetes integration testing in Python via pytest

kubetest

Build Status PyPI Documentation Status

Kubetest is a pytest plugin that makes it easier to manage a Kubernetes cluster within your integration tests. While you can use the Kubernetes Python client directly, this plugin provides some cluster and object management on top of that so you can spend less time setting up and tearing down tests and more time actually writing your tests. In particular, this plugin is useful for testing your Kubernetes infrastructure (e.g., ensure it deploys and behaves correctly) and for testing disaster recovery scenarios (e.g. delete a pod or deployment and inspect the aftermath).

Features:

  • Simple API for common cluster interactions.
  • Uses the Kubernetes Python client as the backend, so more complex custom actions are possible.
  • Load Kubernetes manifest YAMLs into their Kubernetes models.
  • Each test is run in its own namespace and the namespace is created and deleted automatically.
  • Detailed logging to help debug error cases.
  • Wait functions for object readiness and for object deletion.
  • Get container logs and search for expected logging output.
  • Plugin-managed RBAC permissions at test-case granularity using pytest markers.

For more information, see the kubetest documentation.

Installation

This plugin can be installed with pip

pip install kubetest

Note that the kubetest package has entrypoint hooks defined in its setup.py which allow it to be automatically made available to pytest. This means that it will run whenever pytest is run. Since kubetest expects a cluster to be set up and to be given configuration for that cluster, pytest will fail if those are not present. It is therefore recommended to only install kubetest in a virtual environment or other managed environment, such as a CI pipeline, where you can assure that cluster access and configuration are available.

Documentation

See the kubetest documentation page for details on command line usage, available fixtures and markers, and general pytest integration.

Feedback

Feedback for kubetest is greatly appreciated! If you experience any issues, find the documentation unclear, have feature requests, or just have questions about it, we'd love to know. Feel free to open an issue for any feedback you may have.

License

kubetest is released under the GPL-3.0 license.

More Repositories

1

netbox-virtual-circuit-plugin

A plugin for NetBox that supports Virtual Circuit management
Python
55
star
2

ipmi-simulator

ipmi_sim in a minimal Docker container
Shell
41
star
3

synse-server

An HTTP API for monitoring and controlling physical and virtual devices
Python
39
star
4

synse

Vapor IO's Synse Platform
22
star
5

fastapi-rfc7807

RFC-7807 compliant problem detail error response handler for FastAPI applications
Python
19
star
6

k8s-elector

A minimal kubernetes-native sidecar elector service.
Go
9
star
7

aionetbox

An async HTTP client for Netbox
Python
9
star
8

sctl

SCTL is not End2End encryption, instead SCTL is more of an envelope, in which you store secrets until they are needed, and those secrets should only remain available in plain text while the operation that needs them is active.
Go
8
star
9

containerlog

A lightweight, optimized, and opinionated structured logging library for Python, intended for containerized applications
Python
6
star
10

synse-ipmi-plugin

IPMI plugin for Synse
Go
6
star
11

fake-rpigpio

Fake RPi.GPIO drop in replacement for testing and development
Python
4
star
12

netbox-vpxe-plugin

Python
3
star
13

synse-sdk

SDK for Synse Plugins in Go
Go
3
star
14

synse-emulator-plugin

Emulator plugin for Synse
Go
3
star
15

synse-modbus-ip-plugin

Modbus over TCP/IP plugin for Synse
Go
2
star
16

snmp-emulator

A Dockerized SNMP emulator useful for testing and development
Shell
2
star
17

synse-amt-plugin

Intel AMT plugin for Synse
Go
1
star
18

tftp-server

A TFTP server in a docker image
Groovy
1
star
19

netcat

A slim, simple, netcat only container
Dockerfile
1
star
20

octool

Basic command line tool to help diagnose OpenConfig gRPC connections
Go
1
star
21

synse-snmp-plugin

SNMP plugin for Synse
Go
1
star
22

vapor-helm-starter

A Helm Chart starter template for a generic application at Vapor
Smarty
1
star
23

synse-server-grpc

The internal gRPC API for Synse Server and its plugins
Python
1
star
24

synse-client-python

Python client for interacting with Synse Server
Python
1
star
25

synse-charts

Helm charts for deploying the Synse project β›΅
Mustache
1
star
26

synse-cli

Unified CLI for the Synse platform
Go
1
star
27

synse-client-go

Golang client library for interacting with Synse Server
Go
1
star
28

whatis

Whatis bot server for Slack!
Python
1
star
29

deployment-tools

The tools needed to automate deployments, in a can.
Shell
1
star