Release v0.0.8
This release include example and doc updates, fixes, and new features.
Handlers to gracefully finish tests
A new feature was introduce to allow tests to gracefully recover, after a runtime panic, and execute the test environment's Finish
step. If a test writer would rather have tests abruptly end, that behavior can be turned off with the new flag disable-graceful-teardown
which would cause the test execution to stop, skipping any finalization steps in Finish
.
Multi-cluster test workflow
Certain tests can require more than one cluster to be available during execution. This release introduces the ability to start one or more test clusters as shown in the following snippet:
func TestMain(m *testing.M) {
testEnv = env.NewConfig()
clusterNames = []string{
envconf.RandomName("cluster-one", 16),
envconf.RandomName("cluster-two", 16),
}
testEnv.Setup(
func(ctx context.Context, config *envconf.Config) (context.Context, error) {
var err error
// create two clusters
for _, cluster := range clusterNames {
ctx, err = envfuncs.CreateKindCluster(cluster)(ctx, config)
if err != nil {
return ctx, err
}
}
return ctx, nil
},
).Finish(
func(ctx context.Context, config *envconf.Config) (context.Context, error) {
var err error
// shutdown clusters when done
for _, cluster := range clusterNames {
ctx, err = envfuncs.DestroyKindCluster(cluster)(ctx, config)
if err != nil {
return ctx, err
}
}
return ctx, nil
},
)
os.Exit(testEnv.Run(m))
}
For more information, see multi-cluster example.
Other notable updates
- Support for Helm package uninstall
- Project dependency update to Kubernetes 1.24.1
- Additional tests cases for the
Watch
functionality - New example showing how to test components running on a cloud provider (EKS, AKS, GKE, etc)
- And other minor fixes
Contributors
Special thanks to all who contributed to this release including:
- @fracasula
- @0xff-dev
- @harshanarayana
- @ernado
- @ShwethaKumbla
- @matrus2
- @twpayne
- @tklauser
- @mhofstetter
Changelog
- 9d551b5 Fix lint errors
- 5d2b591 Fix log output on errors during test lifecycle actions
- b7b9982 build: fix golangci-lint SA1019 io/ioutil
- e1b7605 GIT-138: add example of multi cluster test workflow
- ce742cf examples/wait_for_resources: fix Go code indentation in README
- 31960c4 Add env to distinguish type of cluster
- daf1681 Add example to readme
- ece3ddb docs: Fix some typos and code examples
- 3a33e3a Add example of how to use e2e framework with real cluster
- ebe68b0 additional test cases to validate watch functionality
- 50d84f2 GIT-141: enable panic handlers for ensuring Finish Steps
- 03e0588 update k8s dependencies to v1.24.1
- f255dbc docs(readme): fix test example
- 2ad0d74 Fix function call errors in README
- 48bbdfb feat: helm uninstall support