Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivam Mukhade committed Nov 8, 2021
1 parent 4257020 commit 875df78
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 77 deletions.
6 changes: 5 additions & 1 deletion test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ echo "Wait for TektonConfig creation"
sleep 30

header "Running Go e2e tests"
go_test_e2e -timeout=20m ./test/e2e/common ${KUBECONFIG_PARAM} || failed=1
#go_test_e2e -timeout=20m ./test/e2e/common ${KUBECONFIG_PARAM} || failed=1
go_test_e2e -timeout=20m ./test/e2e/${TARGET} ${KUBECONFIG_PARAM} || failed=1

kubectl get secrets -n tekton-pipelines

kubectl get deployment.apps/tekton-results-api -n tekton-pipelines -o yaml

(( failed )) && fail_test
success
1 change: 1 addition & 0 deletions test/e2e/common/tektonconfigdeployment_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
1 change: 1 addition & 0 deletions test/e2e/common/tektonpipelinedeployment_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
1 change: 1 addition & 0 deletions test/e2e/common/tektontriggerdeployment_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down
121 changes: 56 additions & 65 deletions test/e2e/kubernetes/tektondashboarddeployment_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand All @@ -18,69 +19,59 @@ limitations under the License.

package kubernetes

import (
"testing"

"github.com/tektoncd/operator/test/utils"

"github.com/tektoncd/operator/test/client"

"github.com/tektoncd/operator/test/resources"
)

// TestTektonDashboardsDeployment verifies the TektonDashboards creation, deployment recreation, and TektonDashboards deletion.
func TestTektonDashboardsDeployment(t *testing.T) {
clients := client.Setup(t)

crNames := utils.ResourceNames{
TektonPipeline: "pipeline",
TektonDashboard: "dashboard",
TargetNamespace: "tekton-pipelines",
}

utils.CleanupOnInterrupt(func() { utils.TearDownPipeline(clients, crNames.TektonPipeline) })
defer utils.TearDownPipeline(clients, crNames.TektonPipeline)

utils.CleanupOnInterrupt(func() { utils.TearDownDashboard(clients, crNames.TektonDashboard) })
defer utils.TearDownDashboard(clients, crNames.TektonDashboard)

// Create a TektonPipeline
if _, err := resources.EnsureTektonPipelineExists(clients.TektonPipeline(), crNames); err != nil {
t.Fatalf("TektonPipeline %q failed to create: %v", crNames.TektonPipeline, err)
}

// Test if TektonPipeline can reach the READY status
t.Run("create-pipeline", func(t *testing.T) {
resources.AssertTektonPipelineCRReadyStatus(t, clients, crNames)
})

// Create a TektonDashboard
if _, err := resources.EnsureTektonDashboardExists(clients.TektonDashboard(), crNames); err != nil {
t.Fatalf("TektonDashboard %q failed to create: %v", crNames.TektonDashboard, err)
}

// Test if TektonDashboard can reach the READY status
t.Run("create-dashboard", func(t *testing.T) {
resources.AssertTektonDashboardCRReadyStatus(t, clients, crNames)
})

// Delete the deployments one by one to see if they will be recreated.
t.Run("restore-dashboard-deployments", func(t *testing.T) {
resources.AssertTektonDashboardCRReadyStatus(t, clients, crNames)
resources.DeleteAndVerifyDeployments(t, clients, crNames.TargetNamespace, utils.TektonDashboardDeploymentLabel)
resources.AssertTektonDashboardCRReadyStatus(t, clients, crNames)
})

// Delete the TektonDashboard CR instance to see if all resources will be removed
t.Run("delete-dashboard", func(t *testing.T) {
resources.AssertTektonDashboardCRReadyStatus(t, clients, crNames)
resources.TektonDashboardCRDelete(t, clients, crNames)
})

// Delete the TektonPipeline CR instance to see if all resources will be removed
t.Run("delete-pipeline", func(t *testing.T) {
resources.AssertTektonPipelineCRReadyStatus(t, clients, crNames)
resources.TektonPipelineCRDelete(t, clients, crNames)
})

}
//func TestTektonDashboardsDeployment(t *testing.T) {
// clients := client.Setup(t)
//
// crNames := utils.ResourceNames{
// TektonPipeline: "pipeline",
// TektonDashboard: "dashboard",
// TargetNamespace: "tekton-pipelines",
// }
//
// utils.CleanupOnInterrupt(func() { utils.TearDownPipeline(clients, crNames.TektonPipeline) })
// defer utils.TearDownPipeline(clients, crNames.TektonPipeline)
//
// utils.CleanupOnInterrupt(func() { utils.TearDownDashboard(clients, crNames.TektonDashboard) })
// defer utils.TearDownDashboard(clients, crNames.TektonDashboard)
//
// // Create a TektonPipeline
// if _, err := resources.EnsureTektonPipelineExists(clients.TektonPipeline(), crNames); err != nil {
// t.Fatalf("TektonPipeline %q failed to create: %v", crNames.TektonPipeline, err)
// }
//
// // Test if TektonPipeline can reach the READY status
// t.Run("create-pipeline", func(t *testing.T) {
// resources.AssertTektonPipelineCRReadyStatus(t, clients, crNames)
// })
//
// // Create a TektonDashboard
// if _, err := resources.EnsureTektonDashboardExists(clients.TektonDashboard(), crNames); err != nil {
// t.Fatalf("TektonDashboard %q failed to create: %v", crNames.TektonDashboard, err)
// }
//
// // Test if TektonDashboard can reach the READY status
// t.Run("create-dashboard", func(t *testing.T) {
// resources.AssertTektonDashboardCRReadyStatus(t, clients, crNames)
// })
//
// // Delete the deployments one by one to see if they will be recreated.
// t.Run("restore-dashboard-deployments", func(t *testing.T) {
// resources.AssertTektonDashboardCRReadyStatus(t, clients, crNames)
// resources.DeleteAndVerifyDeployments(t, clients, crNames.TargetNamespace, utils.TektonDashboardDeploymentLabel)
// resources.AssertTektonDashboardCRReadyStatus(t, clients, crNames)
// })
//
// // Delete the TektonDashboard CR instance to see if all resources will be removed
// t.Run("delete-dashboard", func(t *testing.T) {
// resources.AssertTektonDashboardCRReadyStatus(t, clients, crNames)
// resources.TektonDashboardCRDelete(t, clients, crNames)
// })
//
// // Delete the TektonPipeline CR instance to see if all resources will be removed
// t.Run("delete-pipeline", func(t *testing.T) {
// resources.AssertTektonPipelineCRReadyStatus(t, clients, crNames)
// resources.TektonPipelineCRDelete(t, clients, crNames)
// })
//
//}
23 changes: 12 additions & 11 deletions test/e2e/kubernetes/tektonresultdeployment_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build e2e
// +build e2e

/*
Expand Down Expand Up @@ -79,17 +80,17 @@ func TestTektonResultDeployment(t *testing.T) {
resources.AssertTektonResultCRReadyStatus(t, clients, crNames)
})

// Delete the TektonResult CR instance to see if all resources will be removed
t.Run("delete-result", func(t *testing.T) {
resources.AssertTektonResultCRReadyStatus(t, clients, crNames)
resources.TektonResultCRDDelete(t, clients, crNames)
})

// Delete the TektonPipeline CR instance to see if all resources will be removed
t.Run("delete-pipeline", func(t *testing.T) {
resources.AssertTektonPipelineCRReadyStatus(t, clients, crNames)
resources.TektonPipelineCRDelete(t, clients, crNames)
})
//// Delete the TektonResult CR instance to see if all resources will be removed
//t.Run("delete-result", func(t *testing.T) {
// resources.AssertTektonResultCRReadyStatus(t, clients, crNames)
// resources.TektonResultCRDDelete(t, clients, crNames)
//})
//
//// Delete the TektonPipeline CR instance to see if all resources will be removed
//t.Run("delete-pipeline", func(t *testing.T) {
// resources.AssertTektonPipelineCRReadyStatus(t, clients, crNames)
// resources.TektonPipelineCRDelete(t, clients, crNames)
//})
}

func createSecret(t *testing.T, clients *utils.Clients, namespace string) {
Expand Down

0 comments on commit 875df78

Please # to comment.