Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
test(e2e): add ability to configure the image registry for test images
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Slaton <[email protected]>
  • Loading branch information
Tyler Slaton authored and tylerslaton committed Sep 27, 2022
1 parent 1c97e66 commit 1bea93e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ test-unit: setup-envtest ## Run the unit tests
eval $$($(SETUP_ENVTEST) use -p env $(ENVTEST_VERSION)) && go test -tags $(GO_BUILD_TAGS) -count=1 -short $(UNIT_TEST_DIRS)

FOCUS := $(if $(TEST),-v -focus "$(TEST)")
E2E_FLAGS ?= ""
test-e2e: ginkgo ## Run the e2e tests
$(GINKGO) --tags $(GO_BUILD_TAGS) -trace -progress $(FOCUS) test/e2e
$(GINKGO) --tags $(GO_BUILD_TAGS) $(E2E_FLAGS) -trace -progress $(FOCUS) test/e2e

e2e: KIND_CLUSTER_NAME=rukpak-e2e
e2e: rukpakctl run image-registry kind-load-bundles registry-load-bundles test-e2e kind-cluster-cleanup ## Run e2e tests against an ephemeral kind cluster
Expand Down
5 changes: 5 additions & 0 deletions test/e2e/image_repo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package e2e

// ImageRepo is meant to be set via -ldflags during execution of this code
// where it will then be used to configure the testing suite.
var ImageRepo = "testdata/bundles"
32 changes: 16 additions & 16 deletions test/e2e/plain_provisioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var _ = Describe("plain provisioner bundle", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:valid",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:valid"),
},
},
},
Expand Down Expand Up @@ -107,7 +107,7 @@ var _ = Describe("plain provisioner bundle", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:valid",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:valid"),
},
},
},
Expand Down Expand Up @@ -286,7 +286,7 @@ var _ = Describe("plain provisioner bundle", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:non-existent-tag",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:non-existent-tag"),
},
},
},
Expand Down Expand Up @@ -360,7 +360,7 @@ var _ = Describe("plain provisioner bundle", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:empty",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:empty"),
},
},
},
Expand Down Expand Up @@ -409,7 +409,7 @@ var _ = Describe("plain provisioner bundle", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:no-manifests",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:no-manifests"),
},
},
},
Expand Down Expand Up @@ -1136,7 +1136,7 @@ var _ = Describe("plain provisioner bundle", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:subdir",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:subdir"),
},
},
},
Expand Down Expand Up @@ -1346,7 +1346,7 @@ var _ = Describe("plain provisioner bundledeployment", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:valid",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:valid"),
},
},
},
Expand Down Expand Up @@ -1582,7 +1582,7 @@ var _ = Describe("plain provisioner bundledeployment", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:valid",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:valid"),
},
},
},
Expand Down Expand Up @@ -1641,7 +1641,7 @@ var _ = Describe("plain provisioner bundledeployment", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:invalid-missing-crds",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:invalid-missing-crds"),
},
},
},
Expand Down Expand Up @@ -1708,7 +1708,7 @@ var _ = Describe("plain provisioner bundledeployment", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:subdir",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:subdir"),
},
},
},
Expand Down Expand Up @@ -1772,7 +1772,7 @@ var _ = Describe("plain provisioner bundledeployment", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:dependent",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:dependent"),
},
},
},
Expand Down Expand Up @@ -1829,7 +1829,7 @@ var _ = Describe("plain provisioner bundledeployment", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:provides",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:provides"),
},
},
},
Expand Down Expand Up @@ -1890,7 +1890,7 @@ var _ = Describe("plain provisioner bundledeployment", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:invalid-crds-and-crs",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:invalid-crds-and-crs"),
},
},
},
Expand Down Expand Up @@ -1940,7 +1940,7 @@ var _ = Describe("plain provisioner garbage collection", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:valid",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:valid"),
},
},
},
Expand Down Expand Up @@ -2022,7 +2022,7 @@ var _ = Describe("plain provisioner garbage collection", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:valid",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:valid"),
},
},
},
Expand Down Expand Up @@ -2116,7 +2116,7 @@ var _ = Describe("plain provisioner garbage collection", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/plain-v0:valid",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "plain-v0:valid"),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/registry_provisioner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var _ = Describe("registry provisioner bundle", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/registry:valid",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "registry:valid"),
},
},
},
Expand Down Expand Up @@ -100,7 +100,7 @@ var _ = Describe("registry provisioner bundle", func() {
Source: rukpakv1alpha1.BundleSource{
Type: rukpakv1alpha1.SourceTypeImage,
Image: &rukpakv1alpha1.ImageSource{
Ref: "testdata/bundles/registry:invalid",
Ref: fmt.Sprintf("%v/%v", ImageRepo, "registry:invalid"),
},
},
},
Expand Down

0 comments on commit 1bea93e

Please sign in to comment.