Skip to content

giantswarm/clustertest

Repository files navigation

clustertest

A test framework for helping with E2E testing of Giant Swarm clusters.

Installation

go get github.com/giantswarm/clustertest

Features

  • 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

Documentation can be found at: pkg.go.dev/github.com/giantswarm/clustertest.

Example Usage

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)