Skip to content

Command line tool for using the Giant Swarm app platform in integration tests.

License

Notifications You must be signed in to change notification settings

giantswarm/apptestctl

Repository files navigation

CircleCI

apptestctl

Command line tool for using the Giant Swarm app platform in integration tests. Give a Kubernetes cluster, it deployes app platform components (app-operator, chart-operator) and extra tools (chart-museum) to create an App CR testing evironment.

Installation

This project uses Go modules. Be sure to have it outside your $GOPATH or set GO111MODULE=on environment variable. Then regular go install should do the trick. Alternatively the following one-liner may help.

GO111MODULE=on go install -ldflags "-X 'github.com/giantswarm/apptestctl/pkg/project.gitSHA=$(git rev-parse HEAD)'" .

Usage

After creating a kind cluster on your local machine, type below command.

apptestctl bootstrap --kubeconfig="$(kind get kubeconfig)"

{"caller":"github.com/giantswarm/k8sclient/v5/pkg/k8srestconfig/rest_config.go:137","level":"debug","message":"creating REST config from kubeconfig","time":"2020-09-29T11:09:41.587218+00:00"}
{"caller":"github.com/giantswarm/k8sclient/v5/pkg/k8srestconfig/rest_config.go:145","level":"debug","message":"created REST config from kubeconfig","time":"2020-09-29T11:09:41.588999+00:00"}
...

It will automatically create all resources such as app-operator, chart-operator and CRDs for app testing.

Update CRDs

The bootstrap command installs CRDs in the group application.giantswarm.io. These are embedded in pkg/crds to avoid hitting GitHub API rate limits.

The CRD manifests can be synced with apiextensions using the Makefile.

make sync-crds