Skip to content

crossplane-contrib/xp-testing

Repository files navigation

End-to-end test framework for Crossplane providers

xp-testing is a library enabling end-to-end tests for Crossplane providers, based on kubernetes-sigs/e2e-framework.

This testing framework helps to set up test suites, by handling the deployments of crossplane and providers & ensures providers are loaded into the cluster & helpers to speedup test development.

  • pkg/resources helps with handling of importing and deleting of resources while testing & an opinionated way to create Test Features
  • pkg/setup provides a default cluster setup, ready to take just the most necessary information and boostrap the test suite
  • pkg/upgrade provides basic functionality to compose provider upgrade test features
  • pkg/xpconditions supports with assertions
  • pkg/xpenvfuncs provide basic functions to compose a test environment

Getting Started and Documentation

For getting started guides, installation, deployment, and administration, check latest Crossplane document.

A reference implementation of xp-testing is available in provider-argocd.

The nop_upgrade_test demonstrates the upgrade test functionality with provider-nop.

Custom Crossplane installers

For air-gapped environments or to bypass charts.crossplane.io (e.g., when installing from a local tarball, OCI registry, or mirror), set setup.ClusterSetup.CrossplaneInstallFunc to a custom env.Func that produces the Crossplane control plane.

The custom installer MUST satisfy the package-cache contract:

  1. Create namespace crossplane-system.
  2. Set up a PV+PVC named <cacheName> backed by /cache/xpkg on the kind control-plane node.
  3. helm install crossplane <chartRef> --set packageCache.pvc=<cacheName>.

Without these, InstallCrossplaneProvider's xpkg loading deposits the package into a host directory the Crossplane pod can't read, and providers fail Healthy with failed to get pre-cached package with pull policy Never.

See xpenvfuncs.InstallCrossplane for the reference implementation.

Contributing

xp-testing is a community driven project and we welcome contributions. See the Crossplane Contributing guidelines to get started.

Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please open an issue.

Contact

Please use the following to reach members of the community:

Governance and Owners

xp-testing is run according to the same Governance and Ownership structure as the core Crossplane project.

Code of Conduct

xp-testing adheres to the same Code of Conduct as the core Crossplane project.

Licensing

xp-testing is under the Apache 2.0 license.

Credits

Initially developed by v0lkc, mirzakopic and their team at SAP.

About

A Go framework for end-to-end testing of @crossplane providers

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors