×

CloudTest- Run tests with a repeatable multi-cluster Kubernetes environment

Shridhar Shah

Thursday, February 10th, 2022

2 min read

As part of the Network Service Mesh toolchain, it is an easy and environment-independent way to create Kubernetes clusters; and run go tests on them. CloudTest allows us to deploy and test cloud-native apps in a platform-agnostic way. It integrates easily into any CI (continuous integration) system.

Using CloudTest, we can deploy or run tests on any environment like Kind, K3d, EKS, GKE, etc. It helps in end-to-end testing of Kubernetes clusters starting from creation, installation, testing, and deletion, providing information about the Kubernetes cluster and its components.

CloudTest Architecture :

CloudTest_Architecture

Steps to run the Sample CloudTest for multiple clusters:

Prerequisite to be installed:

  • Kubectl
  • Kind
  • Golang
  1. Install CloudTest:
    $ go get github.com/networkservicemesh/cloudtest@master
    			and/or
    $ go get github.com/networkservicemesh/cloudtest
  1. Clone this repository to try the sample CloudTest:
    cloudtest-repository
  2. Run CloudTest:
    Run this CloudTest config: config

Command: (can be easily plugged in CI to run tests on the Kubernetes cluster )

$ cloudtest --config=.cloudtest.yaml

When the CloudTest gets executed, it creates a cluster based on the type of cluster set- Kind in this scenario. Makefile in this repository provides utility to create/delete cluster and get the kubeconfig of the cluster.

It runs the sample tests from here for multiple clusters: go-tests

CloudTest reporting and go tests execution section:

snap

  1. The expected outcome of CloudTest:
    The logs of the CloudTest are created in this directory:

    .results/output/..

The_expected_outcome_of_CloudTest

Refer to these logs here: output-logs

It creates the test report in junit.xml, refer here: junit-xml

Call for Action:

Plug CloudTest into your CI system now! Leverage the use of CloudTest to develop and test your cloud-native system without worrying about the type of environment.
Reach out to me for any questions.

Reference:

For more details: refer