A test framework for helping with E2E testing of Giant Swarm clusters.
go get github.com/giantswarm/clustertest
- Kubernetes client for interacting with the Management Cluster
- Kubernetes client for interacting with the Workload Clusters
- Wrapper types around Apps and their respective values ConfigMaps
- Wrapper types around Cluster apps (and their default-apps)
- Management (creation and deletion) or Organization resources
- Wait and polling helpers
- Override App versions using environment variables. (See
application
documentation for details)
Documentation can be found at: pkg.go.dev/github.com/giantswarm/clustertest.
ctx := context.Background()
framework, err := clustertest.New("capa_standard")
if err != nil {
panic(err)
}
cluster := application.NewClusterApp(utils.GenerateRandomName("t"), application.ProviderAWS).
WithOrg(organization.NewRandomOrg()).
WithAppValuesFile(
path.Clean("./test_data/cluster_values.yaml"),
path.Clean("./test_data/default-apps_values.yaml"),
)
client, err := framework.ApplyCluster(ctx, cluster)
// Run tests...
err = framework.DeleteCluster(ctx, cluster)