Skip to content

Commit

Permalink
e2e: Remove the "Deploy-" prefix and "-busybox" suffix
Browse files Browse the repository at this point in the history
Adding the same text to all workload is not helpful. Shorter names
are important to make it easy to scan the logs.

Currently with test everything with deployment using busybox image. When
we will add new workload we can consider changing the names, but we need
just one word to make the workload unique.

I want to add vm based tests later, but these will run with a special
environment, so they can use different test suite.

Example logs with this change:

    2024-10-31T19:39:11.391+0200	INFO	subscr-rbd	Protecting workload
    2024-10-31T19:39:11.467+0200	INFO	appset-rbd	Workload running on dr1
    2024-10-31T19:39:11.467+0200	INFO	appset-rbd	Annotating placement
    2024-10-31T19:39:11.467+0200	INFO	appset-cephfs	Workload running on dr2
    2024-10-31T19:39:11.467+0200	INFO	appset-cephfs	Annotating placement
    2024-10-31T19:39:11.467+0200	INFO	subscr-rbd	Workload running on dr1
    2024-10-31T19:39:11.467+0200	INFO	subscr-rbd	Annotating placement
    2024-10-31T19:39:11.485+0200	INFO	appset-cephfs	Creating drpc
    2024-10-31T19:39:11.571+0200	INFO	appset-rbd	Creating drpc
    2024-10-31T19:39:11.767+0200	INFO	subscr-rbd	Creating drpc
    2024-10-31T19:40:37.560+0200	INFO	disapp-rbd	drpc is ready

Fixes: RamenDR#1597
Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs committed Nov 4, 2024
1 parent 0f1a627 commit 4edf3bb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion e2e/deployers/crud.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func DeleteSubscription(s Subscription, w workloads.Workload, log logr.Logger) e
}

func GetCombinedName(d Deployer, w workloads.Workload) string {
return strings.ToLower(d.GetName() + "-" + w.GetName() + "-" + w.GetAppName())
return strings.ToLower(d.GetName() + "-" + w.GetName())
}

func GetNamespace(d Deployer, w workloads.Workload) string {
Expand Down
3 changes: 2 additions & 1 deletion e2e/deployers/discoveredapps.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ func (d DiscoveredApps) Undeploy(w workloads.Workload) error {
}

func (d DiscoveredApps) IsWorkloadSupported(w workloads.Workload) bool {
return w.GetName() != "Deploy-cephfs"
// TODO: This works only for the default configuration. Replace with a more robust way.
return w.GetName() != "cephfs"
}
14 changes: 6 additions & 8 deletions e2e/exhaustive_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package e2e_test

import (
"fmt"
"strings"
"testing"

Expand Down Expand Up @@ -32,30 +31,29 @@ var (
Deployers = []deployers.Deployer{subscription, appset, discoveredApps}
)

func generateSuffix(storageClassName string) string {
suffix := storageClassName
func storageName(storageClassName string) string {
name := storageClassName

if strings.ToLower(storageClassName) == "rook-ceph-block" {
suffix = "rbd"
name = "rbd"
}

if strings.ToLower(storageClassName) == "rook-cephfs" {
suffix = "cephfs"
name = "cephfs"
}

return suffix
return name
}

func generateWorkloads([]workloads.Workload) {
pvcSpecs := util.GetPVCSpecs()
for _, pvcSpec := range pvcSpecs {
// add storageclass name to deployment name
suffix := generateSuffix(pvcSpec.StorageClassName)
deployment := &workloads.Deployment{
Path: GITPATH,
Revision: GITREVISION,
AppName: APPNAME,
Name: fmt.Sprintf("Deploy-%s", suffix),
Name: storageName(pvcSpec.StorageClassName),
PVCSpec: pvcSpec,
}
Workloads = append(Workloads, deployment)
Expand Down

0 comments on commit 4edf3bb

Please sign in to comment.