From c549348d16da7df9161d08543f237071f219f818 Mon Sep 17 00:00:00 2001 From: MikelAlejoBR Date: Mon, 2 Mar 2026 09:27:28 -0500 Subject: [PATCH] investigate: test passes even without the proper SA permissions The "reset namespaces" test passes even though the PR which adds the "member" service account the, in theory, required permission to delete namespaces has not been merged. The test does not pass when running the tests locally, and in stage and production the feature does not work without that permission. SANDBOX-1067 --- test/e2e/namespaces_reset_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/e2e/namespaces_reset_test.go b/test/e2e/namespaces_reset_test.go index 5bc87826a..918287ce5 100644 --- a/test/e2e/namespaces_reset_test.go +++ b/test/e2e/namespaces_reset_test.go @@ -1,6 +1,7 @@ package e2e import ( + "context" "net/http" "testing" "time" @@ -13,6 +14,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/apimachinery/pkg/types" ) type namespaceResetFeatureIntegrationSuite struct { @@ -33,6 +36,7 @@ func (s *namespaceResetFeatureIntegrationSuite) SetupSuite() { // expected. func (s *namespaceResetFeatureIntegrationSuite) TestResetNamespaces() { // given + hostAwaitily := s.Host() memberAwaitily := s.Member1() // Create a new user signup for the test. @@ -107,4 +111,14 @@ func (s *namespaceResetFeatureIntegrationSuite) TestResetNamespaces() { require.NotEqual(s.T(), timestamp, fetchedNamespace.CreationTimestamp.Time, `the namespace "%s" appears to not have been recreated due to having the same creation timestamp as before`, fetchedNamespace.Name) } + + // DELETEME - printing the member service account's cluster role to check + // its permissions. + clusterRole := rbacv1.ClusterRole{} + err = hostAwaitily.Client.Get(context.TODO(), types.NamespacedName{Name: "toolchaincluster-" + memberAwaitily.Namespace}, &clusterRole) + require.NoError(s.T(), err, "unable to obtain the cluster role") + + s.T().Logf("ClusterRole: %+v", clusterRole) + + require.FailNow(s.T(), "the test succeeded but we are failing to gather information") }