Skip to content

hpcsc/e2e-envtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

e2e-envtest

An example to demonstrate running e2e tests for an application that is supposed to be deployed to Kubernetes.

This application is also dependent on Kubernetes API (use Kubernetes client to query API server)

Run

(Require Taskfile)

task e2e

Test set up

Before the e2e test is run:

  • kubebuilder envtest binaries (which contain etcd, kube-apiserver, kubectl) are downloaded and extracted to ./bin/envtest
  • main application is built and placed at ./bin/e2e-envtest

When e2e test is run:

  • It starts envtest using binaries from ./bin/envtest
  • It writes kubernetes rest config file (returned from envtest setup) to a temporary file in filesystem (./bin/kubeconfig). This file will be used by main application to interact with envtest
  • It sets up test data (create 2 test namespaces in envtest in this case)
  • It uses Go exec.Command() to execute main application binary
  • It verifies main application output and any side effect
  • It shuts down envtest and delete temporary kubeconfig file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published