Skip to content

bobcatfish/testing-crds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing CRDs

This repo accompanies the talk Testing Kubernetes CRDs at Kubecon Shanghai 2018.

Tests

Test pyramid, unit at the bottom, then integration and end to end at the top

Integration tests with kubebuilder

These tests are generated by kubebuilder and use Ginkgo. They will start a controller process and api server locally.

The test (which hasn't been modified from the default) lives in feline_controller_test.go.

To run these tests:

go test ./pkg/controller/feline

End to end tests

After you have deployed the controller, you can run the integration tests against the current-context cluster in your kube config:

go test -v -count=1 -tags=e2e ./client-go/test
go test -v -count=1 -tags=e2e ./kubebuilder/test

-count=1 is the idiomatic way to disable test caching.

You can override the kubeconfig and context if you'd like:

go test -v -tags=e2e -count=1 ./client-go/test --kubeconfig ~/special/kubeconfig --cluster myspecialcluster

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages