Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/tests-selectable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
PR_LABELS: ${{ steps.get-labels.outputs.result }}
INT_LABELS: ${{ env.int_labels }}
E2E_LABELS: ${{ env.e2e_labels }}
SKIP_PREFIXES: "[\"focus\"]"
USE_JSON: true
run: |
make compute-labels
Expand Down
13 changes: 7 additions & 6 deletions test/e2e/alert_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var _ = Describe("Alert configuration tests", Label("alert-config", "alert-confi
actions.ProjectCreationFlow(test)
alertConfigFlow(test, alertConfigurations)
},
Entry("Test[alert-configs-1]: Project with 2 identical alert configs", Label("alert-configs-1"),
Entry("Test[alert-configs-1]: Project with 2 identical alert configs", Label("focus-alert-configs-1"),
model.DataProvider(
"alert-configs-1",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand Down Expand Up @@ -111,7 +111,7 @@ var _ = Describe("Alert configuration tests", Label("alert-config", "alert-confi
},
},
),
Entry("Test[alert-configs-2]: Project with 2 different alert configs", Label("alert-configs-2"),
Entry("Test[alert-configs-2]: Project with 2 different alert configs", Label("focus-alert-configs-2"),
model.DataProvider(
"alert-configs-2",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand Down Expand Up @@ -158,7 +158,7 @@ var _ = Describe("Alert configuration tests", Label("alert-config", "alert-confi
},
},
),
Entry("Test[alert-configs-3]: Project with an alert config containing a matcher", Label("alert-configs-3"),
Entry("Test[alert-configs-3]: Project with an alert config containing a matcher", Label("focus-alert-configs-3"),
model.DataProvider(
"alert-configs-3",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand Down Expand Up @@ -197,13 +197,14 @@ var _ = Describe("Alert configuration tests", Label("alert-config", "alert-confi
},
),
)

})

func alertConfigFlow(userData *model.TestDataProvider, alertConfigs []akov2.AlertConfiguration) {
By("Enable Alert Config Sync on Atlas Project", func() {
Expect(userData.K8SClient.Get(userData.Context, types.NamespacedName{Name: userData.Project.Name,
Namespace: userData.Project.Namespace}, userData.Project)).Should(Succeed())
Expect(userData.K8SClient.Get(userData.Context, types.NamespacedName{
Name: userData.Project.Name,
Namespace: userData.Project.Namespace,
}, userData.Project)).Should(Succeed())
userData.Project.Spec.AlertConfigurationSyncEnabled = true
userData.Project.Spec.AlertConfigurations = append(userData.Project.Spec.AlertConfigurations, alertConfigs...)
Expect(userData.K8SClient.Update(userData.Context, userData.Project)).Should(Succeed())
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/annotations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var _ = Describe("Annotations base test.", Label("deployment-annotations-ns"), f
mainCycle(test)
},
// TODO: fix test for deletion protection on, as it would fail to re-take the cluster after deletion
Entry("Simple configuration with keep resource policy annotation on deployment", Label("ns-crd"),
Entry("Simple configuration with keep resource policy annotation on deployment", Label("focus-ns-crd"),
model.DataProvider(
"operator-ns-crd",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/atlas_gov_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var _ = Describe("Atlas for Government", Label("atlas-gov"), func() {
})
})

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

It("Fail to manage when there are non supported features for Atlas for Government", Label("atlas-gov-unsupported"), func() {
It("Fail to manage when there are non supported features for Atlas for Government", Label("focus-atlas-gov-unsupported"), func() {
By("Creating a project to be managed by the operator", func() {
akoProject := &akov2.AtlasProject{
ObjectMeta: metav1.ObjectMeta{
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/auditing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var _ = Describe("UserLogin", Label("auditing"), func() {
actions.ProjectCreationFlow(test)
auditingFlow(test, &auditing)
},
Entry("Test[auditing]: User has project to which Auditing was added", Label("auditing"),
Entry("Test[auditing]: User has project to which Auditing was added", Label("focus-auditing"),
model.DataProvider(
"auditing",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/mongodb/mongodb-atlas-kubernetes/v2/test/helper/e2e/model"
)

var _ = Describe("User can deploy operator from bundles", func() {
var _ = Describe("User can deploy operator from bundles", Label("bundle-test"), func() {
var testData *model.TestDataProvider
var imageURL string

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

It("User can install operator with OLM", Label("bundle-test"), func() {
It("User can install operator with OLM", func() {
By("User creates configuration for a new Project and Deployment", func() {
testData = model.DataProvider(
"bundle-wide",
Expand Down
26 changes: 13 additions & 13 deletions test/e2e/cache_watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type tc struct {
}

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

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

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

Entry("Two namespaces when only those two are configured", Label("gets-two"), &tc{
Entry("Two namespaces when only those two are configured", Label("focus-gets-two"), &tc{
namespaces: []string{"ns1", "ns2", "ns3"},
watchNamespaces: []string{"ns1", "ns2"},
wantToFind: []string{"ns1", "ns2"},
}),
)

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

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

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

Entry("Two namespaces when only those two are configured", Label("list-two"), &tc{
Entry("Two namespaces when only those two are configured", Label("focus-list-two"), &tc{
namespaces: []string{"ns1", "ns2", "ns3"},
watchNamespaces: []string{"ns1", "ns2"},
wantToFind: []string{"ns1", "ns2"},
Expand Down Expand Up @@ -228,7 +228,6 @@ var _ = Describe("Reconciles test:", func() {
).To(Succeed())
if prj.Status.Common.ObservedGeneration == expectedObservedGeneration {
verifications += 1

}
return verifications > 15
}).WithPolling(time.Second).WithTimeout(40 * time.Second).Should(BeTrue())
Expand All @@ -241,19 +240,19 @@ var _ = Describe("Reconciles test:", func() {
})
},

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

Entry("One namespace when only one namespace is configured", Label("reconcile-one"), &tc{
Entry("One namespace when only one namespace is configured", Label("focus-reconcile-one"), &tc{
namespaces: []string{"ns1", "ns2", "ns3"},
watchNamespaces: []string{"ns1"},
wantToFind: []string{"ns1"},
}),

Entry("Two namespaces when only those two are configured", Label("reconcile-two"), &tc{
Entry("Two namespaces when only those two are configured", Label("focus-reconcile-two"), &tc{
namespaces: []string{"ns1", "ns2", "ns3"},
watchNamespaces: []string{"ns1", "ns2"},
wantToFind: []string{"ns1", "ns2"},
Expand Down Expand Up @@ -291,7 +290,8 @@ func setupSecrets(ctx context.Context, testData *model.TestDataProvider, namespa
secret := &corev1.Secret{}
return g.Expect(
testData.K8SClient.Get(ctx, types.NamespacedName{
Name: config.DefaultOperatorGlobalKey, Namespace: ns.GetName()}, secret),
Name: config.DefaultOperatorGlobalKey, Namespace: ns.GetName(),
}, secret),
).To(Succeed())
}).WithTimeout(time.Minute).Should(BeTrue())
}
Expand Down
8 changes: 5 additions & 3 deletions test/e2e/cloud_provider_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var _ = Describe("UserLogin", Label("cloud-access-role"), func() {
actions.ProjectCreationFlow(test)
cloudAccessRolesFlow(test, roles)
},
Entry("Test[cloud-access-role-aws-1]: User has project which was updated with AWS custom role", Label("cloud-access-role-aws-1"),
Entry("Test[cloud-access-role-aws-1]: User has project which was updated with AWS custom role", Label("focus-cloud-access-role-aws-1"),
model.DataProvider(
"cloud-access-role-aws-1",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand Down Expand Up @@ -103,8 +103,10 @@ func cloudAccessRolesFlow(userData *model.TestDataProvider, roles []cloudaccess.
})

By("Create project with cloud access role", func() {
Expect(userData.K8SClient.Get(userData.Context, types.NamespacedName{Name: userData.Project.Name,
Namespace: userData.Project.Namespace}, userData.Project)).Should(Succeed())
Expect(userData.K8SClient.Get(userData.Context, types.NamespacedName{
Name: userData.Project.Name,
Namespace: userData.Project.Namespace,
}, userData.Project)).Should(Succeed())
for _, role := range roles {
userData.Project.Spec.CloudProviderIntegrations = append(userData.Project.Spec.CloudProviderIntegrations, role.AccessRole)
}
Expand Down
18 changes: 9 additions & 9 deletions test/e2e/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
testData = test
mainCycle(test)
},
Entry("Trial - Simplest configuration with no backup and one Admin User", Label("ns-trial"),
Entry("Trial - Simplest configuration with no backup and one Admin User", Label("focus-ns-trial"),
model.DataProvider(
"operator-ns-trial",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand All @@ -62,7 +62,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
WithInitialDeployments(data.CreateBasicDeployment("basic-deployment")).
WithUsers(data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole())),
),
Entry("Almost Production - Backup and 2 DB users: one Admin and one read-only", Label("ns-backup2db", "long-run"),
Entry("Almost Production - Backup and 2 DB users: one Admin and one read-only", Label("focus-ns-backup2db", "focus-long-run"),
model.DataProvider(
"operator-ns-prodlike",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand All @@ -79,7 +79,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
data.BasicUser("admin", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole()),
data.BasicUser("user2", "user2", data.WithSecretRef("dbuser-secret-u2"), data.WithCustomRole(string(model.RoleCustomReadWrite), "Ships", "readWrite")),
)),
Entry("Multiregion AWS, Backup and 2 DBUsers", Label("ns-multiregion-aws-2"),
Entry("Multiregion AWS, Backup and 2 DBUsers", Label("focus-ns-multiregion-aws-2"),
model.DataProvider(
"operator-ns-multiregion-aws",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand All @@ -94,7 +94,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
WithUsers(data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole()),
data.BasicUser("user2", "user2", data.WithSecretRef("dbuser-secret-u2"), data.WithAdminRole())),
),
Entry("Multiregion Azure, Backup and 1 DBUser", Label("ns-multiregion-azure-1"),
Entry("Multiregion Azure, Backup and 1 DBUser", Label("focus-ns-multiregion-azure-1"),
model.DataProvider(
"operator-multiregion-azure",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess().CreateAsGlobalLevelKey(),
Expand All @@ -106,7 +106,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
WithInitialDeployments(data.CreateDeploymentWithMultiregionAzure("multiregion-azure-deployment")).
WithUsers(data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-azure"), data.WithAdminRole())),
),
Entry("Multiregion GCP, Backup and 1 DBUser", Label("ns-multiregion-gcp-1"),
Entry("Multiregion GCP, Backup and 1 DBUser", Label("focus-ns-multiregion-gcp-1"),
model.DataProvider(
"operator-multiregion-gcp",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess().CreateAsGlobalLevelKey(),
Expand All @@ -118,7 +118,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
WithInitialDeployments(data.CreateDeploymentWithMultiregionGCP("multiregion-gcp-deployment")).
WithUsers(data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-gcp"), data.WithAdminRole())),
),
Entry("Product Owner - Simplest configuration with ProjectOwner and update deployment to have backup", Label("ns-owner", "long-run"),
Entry("Product Owner - Simplest configuration with ProjectOwner and update deployment to have backup", Label("focus-ns-owner", "long-run"),
model.DataProvider(
"operator-ns-product-owner",
model.NewEmptyAtlasKeyType().WithRoles([]model.AtlasRoles{model.GroupOwner}).WithWhiteList([]string{"0.0.0.1/1", "128.0.0.0/1"}),
Expand All @@ -131,7 +131,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
WithUsers(
data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole()),
)),
Entry("Trial - Global connection", Label("ns-global-key"),
Entry("Trial - Global connection", Label("focus-ns-global-key"),
model.DataProvider(
"operator-ns-trial-global",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess().CreateAsGlobalLevelKey(),
Expand All @@ -145,7 +145,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
data.BasicUser("user1", "user1", data.WithSecretRef("dbuser-secret-u1"), data.WithAdminRole()),
),
),
Entry("Free - Users can use M0, default key", Label("ns-m0"),
Entry("Free - Users can use M0, default key", Label("focus-ns-m0"),
model.DataProvider(
"operator-ns-free",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess(),
Expand All @@ -157,7 +157,7 @@ var _ = Describe("Configuration namespaced. Deploy deployment", Label("deploymen
WithInitialDeployments(data.CreateFreeAdvancedDeployment("basic-free-deployment")).
WithUsers(data.BasicUser("user", "user1", data.WithSecretRef("dbuser-secret"), data.WithAdminRole())),
),
Entry("Free - Users can use M0, global", Label("ns-global-key-m0"),
Entry("Free - Users can use M0, global", Label("focus-ns-global-key-m0"),
model.DataProvider(
"operator-ns-free",
model.NewEmptyAtlasKeyType().UseDefaultFullAccess().CreateAsGlobalLevelKey(),
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/db_users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ var _ = Describe("Operator watch all namespace should create connection secrets
})
})

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

Expand Down
Loading
Loading