Skip to content

Commit

Permalink
Updates e2e tests for v1beta1
Browse files Browse the repository at this point in the history
initial changes to e2e & test/utils

enhanced & more structured changes to test samples

resolved import dependencies
  • Loading branch information
apoorvajagtap committed Sep 26, 2023
1 parent ed489b6 commit 5809ec0
Show file tree
Hide file tree
Showing 91 changed files with 7,160 additions and 405 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
k8s.io/client-go v0.25.6
k8s.io/code-generator v0.25.6
k8s.io/kubectl v0.25.6
k8s.io/utils v0.0.0-20221012122500-cfd413dd9e85
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
knative.dev/pkg v0.0.0-20221123011842-b78020c16606
sigs.k8s.io/controller-runtime v0.13.1
sigs.k8s.io/yaml v1.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,8 @@ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+O
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4=
k8s.io/kubectl v0.25.6 h1:uGoNw4vF+O62NTwRqM40gMCEI5ujw2g0ocT6dDPt55c=
k8s.io/kubectl v0.25.6/go.mod h1:sqtVRxDlZdaSusmLVysYo8S7h4mB/Fe8YWvt2KCle3k=
k8s.io/utils v0.0.0-20221012122500-cfd413dd9e85 h1:cTdVh7LYu82xeClmfzGtgyspNh6UxpwLWGi8R4sspNo=
k8s.io/utils v0.0.0-20221012122500-cfd413dd9e85/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/pkg v0.0.0-20221123011842-b78020c16606 h1:bHozIhJtQE9/SVQkVX2vqnoJGJt6zo7J0jnkLFX3Crw=
knative.dev/pkg v0.0.0-20221123011842-b78020c16606/go.mod h1:DMTRDJ5WRxf/DrlOPzohzfhSuJggscLZ8EavOq9O/x8=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
2 changes: 1 addition & 1 deletion pkg/image/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/google/go-containerregistry/pkg/v1/random"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/shipwright-io/build/pkg/image"
"github.com/shipwright-io/build/test/utils"
utils "github.com/shipwright-io/build/test/utils/v1alpha1"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/build/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/shipwright-io/build/pkg/config"
"github.com/shipwright-io/build/pkg/controller/fakes"
buildController "github.com/shipwright-io/build/pkg/reconciler/build"
"github.com/shipwright-io/build/test"
test "github.com/shipwright-io/build/test/v1alpha1_samples"
)

var _ = Describe("Reconcile Build", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/buildrun/buildrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/shipwright-io/build/pkg/controller/fakes"
buildrunctl "github.com/shipwright-io/build/pkg/reconciler/buildrun"
"github.com/shipwright-io/build/pkg/reconciler/buildrun/resources"
"github.com/shipwright-io/build/test"
test "github.com/shipwright-io/build/test/v1alpha1_samples"
)

var _ = Describe("Reconcile BuildRun", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/buildrun/resources/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
build "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/pkg/controller/fakes"
"github.com/shipwright-io/build/pkg/reconciler/buildrun/resources"
"github.com/shipwright-io/build/test"
test "github.com/shipwright-io/build/test/v1alpha1_samples"
)

var _ = Describe("Build Resource", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/buildrun/resources/conditions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
build "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/pkg/controller/fakes"
"github.com/shipwright-io/build/pkg/reconciler/buildrun/resources"
"github.com/shipwright-io/build/test"
test "github.com/shipwright-io/build/test/v1alpha1_samples"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
corev1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/buildrun/resources/image_processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/pkg/config"
"github.com/shipwright-io/build/pkg/reconciler/buildrun/resources"
"github.com/shipwright-io/build/test/utils"
utils "github.com/shipwright-io/build/test/utils/v1alpha1"
pipeline "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/buildrun/resources/results_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

build "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/pkg/reconciler/buildrun/resources"
"github.com/shipwright-io/build/test"
test "github.com/shipwright-io/build/test/v1alpha1_samples"

pipelinev1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
"k8s.io/apimachinery/pkg/types"
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/buildrun/resources/service_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/pkg/controller/fakes"
"github.com/shipwright-io/build/pkg/reconciler/buildrun/resources"
"github.com/shipwright-io/build/test"
test "github.com/shipwright-io/build/test/v1alpha1_samples"
corev1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/buildrun/resources/strategies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/pkg/controller/fakes"
"github.com/shipwright-io/build/pkg/reconciler/buildrun/resources"
"github.com/shipwright-io/build/test"
test "github.com/shipwright-io/build/test/v1alpha1_samples"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
Expand Down
4 changes: 2 additions & 2 deletions pkg/reconciler/buildrun/resources/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"github.com/shipwright-io/build/pkg/config"
"github.com/shipwright-io/build/pkg/env"
"github.com/shipwright-io/build/pkg/reconciler/buildrun/resources"
"github.com/shipwright-io/build/test"
"github.com/shipwright-io/build/test/utils"
utils "github.com/shipwright-io/build/test/utils/v1alpha1"
test "github.com/shipwright-io/build/test/v1alpha1_samples"
)

var _ = Describe("GenerateTaskrun", func() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/pkg/reconciler/buildrun/resources"
"github.com/shipwright-io/build/test/utils"
utils "github.com/shipwright-io/build/test/utils/v1alpha1"
)

func generateTestID(id string) string {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"k8s.io/apimachinery/pkg/types"

buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/test/utils"
utils "github.com/shipwright-io/build/test/utils/v1alpha1"
)

var _ = Describe("For a Kubernetes cluster with Tekton and build installed", func() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
. "github.com/onsi/gomega"

buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/test"
test "github.com/shipwright-io/build/test/v1alpha1_samples"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/utils/pointer"
Expand Down
File renamed without changes.
53 changes: 53 additions & 0 deletions test/e2e/v1alpha1/e2e_suite_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright The Shipwright Contributors
//
// SPDX-License-Identifier: Apache-2.0

package e2e_test

import (
"os"
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

utils "github.com/shipwright-io/build/test/utils/v1alpha1"
)

var (
testBuild *utils.TestBuild
stop = make(chan struct{})
)

func TestE2E(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "E2E Suite")
}

var (
_ = BeforeSuite(func() {
var (
ok bool
err error
)

testBuild, err = utils.NewTestBuild()
Expect(err).ToNot(HaveOccurred())

testBuild.Namespace, ok = os.LookupEnv("TEST_NAMESPACE")
Expect(ok).To(BeTrue(), "TEST_NAMESPACE should be set")
Expect(testBuild.Namespace).ToNot(BeEmpty())

// create the pipeline service account
Logf("Creating the pipeline service account")
createPipelineServiceAccount(testBuild)

// create the container registry secret
Logf("Creating the container registry secret")
createContainerRegistrySecret(testBuild)
})

_ = AfterSuite(func() {
close(stop)
})
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/shipwright-io/build/pkg/apis"
buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1"
"github.com/shipwright-io/build/test/utils"
utils "github.com/shipwright-io/build/test/utils/v1alpha1"
)

const (
Expand Down
Loading

0 comments on commit 5809ec0

Please sign in to comment.