Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove must-gather E2E test #1497

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions tests/e2e/backup_restore_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ type BackupRestoreCase struct {

type ApplicationBackupRestoreCase struct {
BackupRestoreCase
ApplicationTemplate string
PvcSuffixName string
MustGatherFiles []string // list of files expected in must-gather under quay.io.../clusters/clustername/... ie. "namespaces/openshift-adp/oadp.openshift.io/dpa-ts-example-velero/ts-example-velero.yml"
MustGatherValidationFunction *func(string) error // validation function for must-gather where string parameter is the path to "quay.io.../clusters/clustername/"
ApplicationTemplate string
PvcSuffixName string
}

func todoListReady(preBackupState bool, twoVol bool, database string) VerificationFunction {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/lib/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func RunMustGather(oc_cli string, artifact_dir string) error {
ocClient := oc_cli
ocAdmin := "adm"
mustGatherCmd := "must-gather"
mustGatherImg := "--image=quay.io/konveyor/oadp-must-gather:latest"
mustGatherImg := "--image=ttl.sh/oadp/must-gather:mateus-test"
destDir := "--dest-dir=" + artifact_dir

cmd := exec.Command(ocClient, ocAdmin, mustGatherCmd, mustGatherImg, destDir)
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/lib/dpa_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (v *DpaCustomResource) Build(backupRestoreType BackupRestoreType) *oadpv1al
}
// Uncomment to override plugin images to use
dpaSpec.UnsupportedOverrides = map[oadpv1alpha1.UnsupportedImageKey]string{
// oadpv1alpha1.VeleroImageKey: "quay.io/konveyor/velero:oadp-1.1",
oadpv1alpha1.VeleroImageKey: "quay.io/konveyor/velero:oadp-1.4",
}
return &dpaSpec
}
Expand Down
29 changes: 12 additions & 17 deletions tests/e2e/must-gather_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package e2e_test
import (
"log"
"os"
"strings"
"time"

"github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -46,7 +45,7 @@ var _ = ginkgo.Describe("Backup and restore tests with must-gather", func() {
gomega.Expect(err).ToNot(gomega.HaveOccurred())
clusterDir := ""
for _, dirEntry := range dirEntries {
if dirEntry.IsDir() && strings.HasPrefix(dirEntry.Name(), "quay-io") {
if dirEntry.IsDir() {
mustGatherImageDir := baseReportDir + "/must-gather/" + dirEntry.Name()
// extract must-gather.tar.gz
err = lib.ExtractTarGz(mustGatherImageDir, "must-gather.tar.gz")
Expand All @@ -57,22 +56,22 @@ var _ = ginkgo.Describe("Backup and restore tests with must-gather", func() {
for _, cluster := range clusters {
if cluster.IsDir() {
clusterDir = mustGatherDir + "/clusters/" + cluster.Name()
if clusterDir != "" {
for _, file := range []string{
"namespaces/" + namespace + "/oadp.openshift.io/dpa-ts-" + instanceName + "/ts-" + instanceName + ".yml",
"namespaces/" + namespace + "/velero.io/backupstoragelocations.velero.io/ts-" + instanceName + "-1.yaml",
} {
log.Printf("checking if %v is present in must-gather", file)
_, err := os.Stat(clusterDir + "/" + file)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
}
}
}
}
}
if len(brCase.MustGatherFiles) > 0 && clusterDir != "" {
for _, file := range brCase.MustGatherFiles {
_, err := os.Stat(clusterDir + "/" + file)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
}
if brCase.MustGatherValidationFunction != nil && clusterDir != "" {
err = (*brCase.MustGatherValidationFunction)(clusterDir)
gomega.Expect(err).ToNot(gomega.HaveOccurred())
}
},
ginkgo.Entry("Mongo application DATAMOVER", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ginkgo.FEntry("Mongo application DATAMOVER", ginkgo.FlakeAttempts(flakeAttempts), ApplicationBackupRestoreCase{
ApplicationTemplate: "./sample-applications/mongo-persistent/mongo-persistent-csi.yaml",
BackupRestoreCase: BackupRestoreCase{
Namespace: "mongo-persistent",
Expand All @@ -82,10 +81,6 @@ var _ = ginkgo.Describe("Backup and restore tests with must-gather", func() {
PostRestoreVerify: todoListReady(false, false, "mongo"),
BackupTimeout: 20 * time.Minute,
},
MustGatherFiles: []string{
"namespaces/" + namespace + "/oadp.openshift.io/dpa-ts-" + instanceName + "/ts-" + instanceName + ".yml",
"namespaces/" + namespace + "/velero.io/backupstoragelocations.velero.io/ts-" + instanceName + "-1.yaml",
},
}, nil),
)
})
4 changes: 2 additions & 2 deletions tests/e2e/upgrade_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ var _ = ginkgo.Describe("OADP upgrade scenarios", ginkgo.Ordered, func() {
subscriptionSource = "redhat-operators"
}

log.Print("Creating Subscription oadp-operator")
log.Printf("Creating Subscription %v", subscriptionPackage)
subscription := v1alpha1.Subscription{
ObjectMeta: metav1.ObjectMeta{
Name: "oadp-operator",
Name: subscriptionPackage,
Namespace: namespace,
},
Spec: &v1alpha1.SubscriptionSpec{
Expand Down