test/

directory
v0.0.0-...-b25b198 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0

README

TKG Integration tests

What are these tests?

TKG integration tests validates the tkg client library used by the cluster, management-cluster plugins. Some of these tests leverages CAPD provider to be able to run without needing access to any external cloud infrastructure.

How to run these tests locally?

They are developed using the Ginkgo testing framework. Here are the steps to run them locally:

make tools
E2E_CONFIG=tkg/test/config/docker.yaml
hack/tools/bin/ginkgo -v -trace tkg/test/tkgctl/docker

If you want to run a single test

E2E_CONFIG=tkg/test/config/docker.yaml
hack/tools/bin/ginkgo -v -trace --focus="<test spec name/regex>" tkg/test/tkgctl/docker

In case of TKGS test cases, make sure sshuttle is running to connect tkgs cluster, also set HTTP_PROXY and HTTPS_PROXY values. Generate kube config file using the kubectl vsphere log, the token in tkgs kube config expires every 24hours, so need to regenerate kube config file. For the tkgs E2E_CONFIG config file, refer existing tkgs config from tkg/test/config/tkgs.yaml and do required changes. example:

sshuttle -r root@10.199.56.233 192.163.0.0/8 #let it keep running while running test cases
E2E_CONFIG=tkg/test/config/tkgs.yaml
HTTP_PROXY=192.163.1.163:3128
HTTPS_PROXY=192.163.1.163:3128
hack/tools/bin/ginkgo -v -trace tkg/test/tkgctl/tkgs

To run clusterclass based tests use hack/tools/bin/ginkgo -v -trace tkg/test/tkgctl/tkgs_cc in place of the final line.

Troubleshooting

If you are running the CAPD based integration tests on an Apple system, it is recommended that Docker Desktop is allocated the following resources at minimum:

  • Memory: 6GB+
  • Swap: 2GB+
  • Disk image size: 100GB+

Directories

Path Synopsis
cmp
strings
Package strings provides string related utilities for testing purposes.
Package strings provides string related utilities for testing purposes.
Package framework implements the test framework.
Package framework implements the test framework.
exec
Package exec implements command execution functionality.
Package exec implements command execution functionality.
tkgctl
shared
nolint:typecheck,goconst,gocritic,stylecheck,nolintlint
nolint:typecheck,goconst,gocritic,stylecheck,nolintlint

Jump to

Keyboard shortcuts

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