Skip to content

Commit 5d69fdd

Browse files
CLOUDP-349099: Renamed 2nd level Ginkgo labels (#2808)
* Renamed 2nd level Ginkgo labels * Fixed broken label * Make selectable e2e and int tests skip focus prefixed labels * Avoid bundle-test --------- Co-authored-by: jose.vazquez <[email protected]>
1 parent 4baf4b3 commit 5d69fdd

27 files changed

+140
-117
lines changed

.github/workflows/tests-selectable.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
PR_LABELS: ${{ steps.get-labels.outputs.result }}
7979
INT_LABELS: ${{ env.int_labels }}
8080
E2E_LABELS: ${{ env.e2e_labels }}
81+
SKIP_PREFIXES: "[\"focus\"]"
8182
USE_JSON: true
8283
run: |
8384
make compute-labels

test/e2e/alert_config_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var _ = Describe("Alert configuration tests", Label("alert-config", "alert-confi
5858
actions.ProjectCreationFlow(test)
5959
alertConfigFlow(test, alertConfigurations)
6060
},
61-
Entry("Test[alert-configs-1]: Project with 2 identical alert configs", Label("alert-configs-1"),
61+
Entry("Test[alert-configs-1]: Project with 2 identical alert configs", Label("focus-alert-configs-1"),
6262
model.DataProvider(
6363
"alert-configs-1",
6464
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
@@ -111,7 +111,7 @@ var _ = Describe("Alert configuration tests", Label("alert-config", "alert-confi
111111
},
112112
},
113113
),
114-
Entry("Test[alert-configs-2]: Project with 2 different alert configs", Label("alert-configs-2"),
114+
Entry("Test[alert-configs-2]: Project with 2 different alert configs", Label("focus-alert-configs-2"),
115115
model.DataProvider(
116116
"alert-configs-2",
117117
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
@@ -158,7 +158,7 @@ var _ = Describe("Alert configuration tests", Label("alert-config", "alert-confi
158158
},
159159
},
160160
),
161-
Entry("Test[alert-configs-3]: Project with an alert config containing a matcher", Label("alert-configs-3"),
161+
Entry("Test[alert-configs-3]: Project with an alert config containing a matcher", Label("focus-alert-configs-3"),
162162
model.DataProvider(
163163
"alert-configs-3",
164164
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
@@ -197,13 +197,14 @@ var _ = Describe("Alert configuration tests", Label("alert-config", "alert-confi
197197
},
198198
),
199199
)
200-
201200
})
202201

203202
func alertConfigFlow(userData *model.TestDataProvider, alertConfigs []akov2.AlertConfiguration) {
204203
By("Enable Alert Config Sync on Atlas Project", func() {
205-
Expect(userData.K8SClient.Get(userData.Context, types.NamespacedName{Name: userData.Project.Name,
206-
Namespace: userData.Project.Namespace}, userData.Project)).Should(Succeed())
204+
Expect(userData.K8SClient.Get(userData.Context, types.NamespacedName{
205+
Name: userData.Project.Name,
206+
Namespace: userData.Project.Namespace,
207+
}, userData.Project)).Should(Succeed())
207208
userData.Project.Spec.AlertConfigurationSyncEnabled = true
208209
userData.Project.Spec.AlertConfigurations = append(userData.Project.Spec.AlertConfigurations, alertConfigs...)
209210
Expect(userData.K8SClient.Update(userData.Context, userData.Project)).Should(Succeed())

test/e2e/annotations_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var _ = Describe("Annotations base test.", Label("deployment-annotations-ns"), f
4646
mainCycle(test)
4747
},
4848
// TODO: fix test for deletion protection on, as it would fail to re-take the cluster after deletion
49-
Entry("Simple configuration with keep resource policy annotation on deployment", Label("ns-crd"),
49+
Entry("Simple configuration with keep resource policy annotation on deployment", Label("focus-ns-crd"),
5050
model.DataProvider(
5151
"operator-ns-crd",
5252
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),

test/e2e/atlas_gov_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
9696
})
9797
})
9898

99-
It("Manage all supported Atlas for Government features", Label("atlas-gov-supported"), func() {
99+
It("Manage all supported Atlas for Government features", Label("focus-atlas-gov-supported"), func() {
100100
By("Preparing API Key for integrations", func() {
101101
secret := &corev1.Secret{
102102
ObjectMeta: metav1.ObjectMeta{
@@ -612,7 +612,7 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
612612
})
613613
})
614614

615-
It("Fail to manage when there are non supported features for Atlas for Government", Label("atlas-gov-unsupported"), func() {
615+
It("Fail to manage when there are non supported features for Atlas for Government", Label("focus-atlas-gov-unsupported"), func() {
616616
By("Creating a project to be managed by the operator", func() {
617617
akoProject := &akov2.AtlasProject{
618618
ObjectMeta: metav1.ObjectMeta{

test/e2e/auditing_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var _ = Describe("UserLogin", Label("auditing"), func() {
4949
actions.ProjectCreationFlow(test)
5050
auditingFlow(test, &auditing)
5151
},
52-
Entry("Test[auditing]: User has project to which Auditing was added", Label("auditing"),
52+
Entry("Test[auditing]: User has project to which Auditing was added", Label("focus-auditing"),
5353
model.DataProvider(
5454
"auditing",
5555
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),

test/e2e/bundle_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/model"
3333
)
3434

35-
var _ = Describe("User can deploy operator from bundles", func() {
35+
var _ = Describe("User can deploy operator from bundles", Label("focus-quatantine-bundle-test"), func() {
3636
var testData *model.TestDataProvider
3737
var imageURL string
3838

@@ -52,7 +52,7 @@ var _ = Describe("User can deploy operator from bundles", func() {
5252
})
5353
})
5454

55-
It("User can install operator with OLM", Label("bundle-test"), func() {
55+
It("User can install operator with OLM", func() {
5656
By("User creates configuration for a new Project and Deployment", func() {
5757
testData = model.DataProvider(
5858
"bundle-wide",

test/e2e/cache_watch_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type tc struct {
4545
}
4646

4747
var _ = Describe("Kubernetes cache watch test:", Label("cache-watch"), func() {
48-
DescribeTable("Cache gets", Label("watch-gets"),
48+
DescribeTable("Cache gets", Label("focus-watch-gets"),
4949
func(ctx context.Context, testCase *tc) {
5050
testData := model.DataProvider(
5151
fmt.Sprintf("cache-%s", CurrentSpecReport().LeafNodeLabels[0]),
@@ -77,26 +77,26 @@ var _ = Describe("Kubernetes cache watch test:", Label("cache-watch"), func() {
7777
})
7878
},
7979

80-
Entry("From all namespaces when no namespace config is set", Label("gets-all"), &tc{
80+
Entry("From all namespaces when no namespace config is set", Label("focus-gets-all"), &tc{
8181
namespaces: []string{"ns1", "ns2", "ns3"},
8282
watchNamespaces: nil,
8383
wantToFind: []string{"ns1", "ns2", "ns3"},
8484
}),
8585

86-
Entry("One namespace when only one namespace is configured", Label("gets-one"), &tc{
86+
Entry("One namespace when only one namespace is configured", Label("focus-gets-one"), &tc{
8787
namespaces: []string{"ns1", "ns2", "ns3"},
8888
watchNamespaces: []string{"ns1"},
8989
wantToFind: []string{"ns1"},
9090
}),
9191

92-
Entry("Two namespaces when only those two are configured", Label("gets-two"), &tc{
92+
Entry("Two namespaces when only those two are configured", Label("focus-gets-two"), &tc{
9393
namespaces: []string{"ns1", "ns2", "ns3"},
9494
watchNamespaces: []string{"ns1", "ns2"},
9595
wantToFind: []string{"ns1", "ns2"},
9696
}),
9797
)
9898

99-
DescribeTable("Cache lists", Label("watch-lists"),
99+
DescribeTable("Cache lists", Label("focus-watch-lists"),
100100
func(ctx context.Context, testCase *tc) {
101101
testData := model.DataProvider(
102102
fmt.Sprintf("cache-%s", CurrentSpecReport().LeafNodeLabels[0]),
@@ -129,19 +129,19 @@ var _ = Describe("Kubernetes cache watch test:", Label("cache-watch"), func() {
129129
})
130130
},
131131

132-
Entry("From all namespaces when no namespace config is set", Label("list-all"), &tc{
132+
Entry("From all namespaces when no namespace config is set", Label("focus-list-all"), &tc{
133133
namespaces: []string{"ns1", "ns2", "ns3"},
134134
watchNamespaces: nil,
135135
wantToFind: []string{"ns1", "ns2", "ns3"},
136136
}),
137137

138-
Entry("One namespace when only one namespace is configured", Label("list-one"), &tc{
138+
Entry("One namespace when only one namespace is configured", Label("focus-list-one"), &tc{
139139
namespaces: []string{"ns1", "ns2", "ns3"},
140140
watchNamespaces: []string{"ns1"},
141141
wantToFind: []string{"ns1"},
142142
}),
143143

144-
Entry("Two namespaces when only those two are configured", Label("list-two"), &tc{
144+
Entry("Two namespaces when only those two are configured", Label("focus-list-two"), &tc{
145145
namespaces: []string{"ns1", "ns2", "ns3"},
146146
watchNamespaces: []string{"ns1", "ns2"},
147147
wantToFind: []string{"ns1", "ns2"},
@@ -228,7 +228,6 @@ var _ = Describe("Reconciles test:", func() {
228228
).To(Succeed())
229229
if prj.Status.Common.ObservedGeneration == expectedObservedGeneration {
230230
verifications += 1
231-
232231
}
233232
return verifications > 15
234233
}).WithPolling(time.Second).WithTimeout(40 * time.Second).Should(BeTrue())
@@ -241,19 +240,19 @@ var _ = Describe("Reconciles test:", func() {
241240
})
242241
},
243242

244-
Entry("All namespaces when no namespace config is set", Label("reconcile-all"), &tc{
243+
Entry("All namespaces when no namespace config is set", Label("focus-reconcile-all"), &tc{
245244
namespaces: []string{"ns1", "ns2", "ns3"},
246245
watchNamespaces: nil,
247246
wantToFind: []string{"ns1", "ns2", "ns3"},
248247
}),
249248

250-
Entry("One namespace when only one namespace is configured", Label("reconcile-one"), &tc{
249+
Entry("One namespace when only one namespace is configured", Label("focus-reconcile-one"), &tc{
251250
namespaces: []string{"ns1", "ns2", "ns3"},
252251
watchNamespaces: []string{"ns1"},
253252
wantToFind: []string{"ns1"},
254253
}),
255254

256-
Entry("Two namespaces when only those two are configured", Label("reconcile-two"), &tc{
255+
Entry("Two namespaces when only those two are configured", Label("focus-reconcile-two"), &tc{
257256
namespaces: []string{"ns1", "ns2", "ns3"},
258257
watchNamespaces: []string{"ns1", "ns2"},
259258
wantToFind: []string{"ns1", "ns2"},
@@ -291,7 +290,8 @@ func setupSecrets(ctx context.Context, testData *model.TestDataProvider, namespa
291290
secret := &corev1.Secret{}
292291
return g.Expect(
293292
testData.K8SClient.Get(ctx, types.NamespacedName{
294-
Name: config.DefaultOperatorGlobalKey, Namespace: ns.GetName()}, secret),
293+
Name: config.DefaultOperatorGlobalKey, Namespace: ns.GetName(),
294+
}, secret),
295295
).To(Succeed())
296296
}).WithTimeout(time.Minute).Should(BeTrue())
297297
}

test/e2e/cloud_provider_integration_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var _ = Describe("UserLogin", Label("cloud-access-role"), func() {
6363
actions.ProjectCreationFlow(test)
6464
cloudAccessRolesFlow(test, roles)
6565
},
66-
Entry("Test[cloud-access-role-aws-1]: User has project which was updated with AWS custom role", Label("cloud-access-role-aws-1"),
66+
Entry("Test[cloud-access-role-aws-1]: User has project which was updated with AWS custom role", Label("focus-cloud-access-role-aws-1"),
6767
model.DataProvider(
6868
"cloud-access-role-aws-1",
6969
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
@@ -103,8 +103,10 @@ func cloudAccessRolesFlow(userData *model.TestDataProvider, roles []cloudaccess.
103103
})
104104

105105
By("Create project with cloud access role", func() {
106-
Expect(userData.K8SClient.Get(userData.Context, types.NamespacedName{Name: userData.Project.Name,
107-
Namespace: userData.Project.Namespace}, userData.Project)).Should(Succeed())
106+
Expect(userData.K8SClient.Get(userData.Context, types.NamespacedName{
107+
Name: userData.Project.Name,
108+
Namespace: userData.Project.Namespace,
109+
}, userData.Project)).Should(Succeed())
108110
for _, role := range roles {
109111
userData.Project.Spec.CloudProviderIntegrations = append(userData.Project.Spec.CloudProviderIntegrations, role.AccessRole)
110112
}

test/e2e/configuration_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
5050
testData = test
5151
mainCycle(test)
5252
},
53-
Entry("Trial - Simplest configuration with no backup and one Admin User", Label("ns-trial"),
53+
Entry("Trial - Simplest configuration with no backup and one Admin User", Label("focus-ns-trial"),
5454
model.DataProvider(
5555
"operator-ns-trial",
5656
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
@@ -62,7 +62,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
6262
WithInitialDeployments(data.CreateBasicDeployment("basic-deployment")).
6363
WithUsers(data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole())),
6464
),
65-
Entry("Almost Production - Backup and 2 DB users: one Admin and one read-only", Label("ns-backup2db", "long-run"),
65+
Entry("Almost Production - Backup and 2 DB users: one Admin and one read-only", Label("focus-ns-backup2db", "focus-long-run"),
6666
model.DataProvider(
6767
"operator-ns-prodlike",
6868
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
@@ -79,7 +79,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
7979
data.BasicUser("admin", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole()),
8080
data.BasicUser("user2", "user2", data.WithSecretRef("dbuser-secret-u2"), data.WithCustomRole(string(model.RoleCustomReadWrite), "Ships", "readWrite")),
8181
)),
82-
Entry("Multiregion AWS, Backup and 2 DBUsers", Label("ns-multiregion-aws-2"),
82+
Entry("Multiregion AWS, Backup and 2 DBUsers", Label("focus-ns-multiregion-aws-2"),
8383
model.DataProvider(
8484
"operator-ns-multiregion-aws",
8585
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
@@ -94,7 +94,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
9494
WithUsers(data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole()),
9595
data.BasicUser("user2", "user2", data.WithSecretRef("dbuser-secret-u2"), data.WithAdminRole())),
9696
),
97-
Entry("Multiregion Azure, Backup and 1 DBUser", Label("ns-multiregion-azure-1"),
97+
Entry("Multiregion Azure, Backup and 1 DBUser", Label("focus-ns-multiregion-azure-1"),
9898
model.DataProvider(
9999
"operator-multiregion-azure",
100100
model.NewEmptyAtlasKeyType().UseDefaultFullAccess().CreateAsGlobalLevelKey(),
@@ -106,7 +106,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
106106
WithInitialDeployments(data.CreateDeploymentWithMultiregionAzure("multiregion-azure-deployment")).
107107
WithUsers(data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-azure"), data.WithAdminRole())),
108108
),
109-
Entry("Multiregion GCP, Backup and 1 DBUser", Label("ns-multiregion-gcp-1"),
109+
Entry("Multiregion GCP, Backup and 1 DBUser", Label("focus-ns-multiregion-gcp-1"),
110110
model.DataProvider(
111111
"operator-multiregion-gcp",
112112
model.NewEmptyAtlasKeyType().UseDefaultFullAccess().CreateAsGlobalLevelKey(),
@@ -118,7 +118,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
118118
WithInitialDeployments(data.CreateDeploymentWithMultiregionGCP("multiregion-gcp-deployment")).
119119
WithUsers(data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-gcp"), data.WithAdminRole())),
120120
),
121-
Entry("Product Owner - Simplest configuration with ProjectOwner and update deployment to have backup", Label("ns-owner", "long-run"),
121+
Entry("Product Owner - Simplest configuration with ProjectOwner and update deployment to have backup", Label("focus-ns-owner", "long-run"),
122122
model.DataProvider(
123123
"operator-ns-product-owner",
124124
model.NewEmptyAtlasKeyType().WithRoles([]model.AtlasRoles{model.GroupOwner}).WithWhiteList([]string{"0.0.0.1/1", "128.0.0.0/1"}),
@@ -131,7 +131,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
131131
WithUsers(
132132
data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole()),
133133
)),
134-
Entry("Trial - Global connection", Label("ns-global-key"),
134+
Entry("Trial - Global connection", Label("focus-ns-global-key"),
135135
model.DataProvider(
136136
"operator-ns-trial-global",
137137
model.NewEmptyAtlasKeyType().UseDefaultFullAccess().CreateAsGlobalLevelKey(),
@@ -145,7 +145,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
145145
data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole()),
146146
),
147147
),
148-
Entry("Free - Users can use M0, default key", Label("ns-m0"),
148+
Entry("Free - Users can use M0, default key", Label("focus-ns-m0"),
149149
model.DataProvider(
150150
"operator-ns-free",
151151
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
@@ -157,7 +157,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
157157
WithInitialDeployments(data.CreateFreeAdvancedDeployment("basic-free-deployment")).
158158
WithUsers(data.BasicUser("user", "user1", data.WithSecretRef("dbuser-secret"), data.WithAdminRole())),
159159
),
160-
Entry("Free - Users can use M0, global", Label("ns-global-key-m0"),
160+
Entry("Free - Users can use M0, global", Label("focus-ns-global-key-m0"),
161161
model.DataProvider(
162162
"operator-ns-free",
163163
model.NewEmptyAtlasKeyType().UseDefaultFullAccess().CreateAsGlobalLevelKey(),

test/e2e/db_users_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ var _ = Describe("Operator watch all namespace should create connection secrets
178178
})
179179
})
180180

181-
var _ = Describe("Operator fails if local credentials is mentioned but unavailable", Label("users", "users-no-creds"), func() {
181+
var _ = Describe("Operator fails if local credentials is mentioned but unavailable", Label("focus-users", "focus-users-no-creds"), func() {
182182
var testData *model.TestDataProvider
183183
namespace := utils.RandomName("namespace")
184184

0 commit comments

Comments
 (0)