From 621fd9bdec1835becd27d0b68a890176a8fb7315 Mon Sep 17 00:00:00 2001 From: Livio Spring Date: Thu, 12 Mar 2026 07:24:40 +0100 Subject: [PATCH] test: fix matrix for relation table tests (#11757) # Which Problems Are Solved In #11239 , the helper function for matrix tests (without the relational tables enabled) was changed, but the feature was never enabled in the matrix. Some integration tests currently can't even succeed because of missing implementations. # How the Problems Are Solved This PR correctly enables the feature where intended and returns the state into the matrix. This allows returning early for some tests which cannot succeed yet. Corresponding todos have been re-added as well. # Additional Changes None # Additional Context - relates to #11239 - requires backport to v4.x --- .../grpc/org/v2beta/integration_test/org_test.go | 16 ++++++++++++++-- internal/integration/feature.go | 9 +++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/internal/api/grpc/org/v2beta/integration_test/org_test.go b/internal/api/grpc/org/v2beta/integration_test/org_test.go index 31d27e138..eb1576cd3 100644 --- a/internal/api/grpc/org/v2beta/integration_test/org_test.go +++ b/internal/api/grpc/org/v2beta/integration_test/org_test.go @@ -372,18 +372,21 @@ func TestServer_UpdateOrganization(t *testing.T) { tt.Run("unhappy: no permission", func(ttt *testing.T) { // given - organisation, orgName, _ := createOrg(sysAuthZ, ttt, client) + organisation, _, _ := createOrg(sysAuthZ, ttt, client) // when _, err := client.UpdateOrganization( inst.WithAuthorizationToken(ctx, integration.UserTypeOrgOwner), &v2beta_org.UpdateOrganizationRequest{ Id: organisation.Id, - Name: orgName, + Name: integration.OrganizationName(), }, ) // then + if relTableCase.Enabled { + ttt.Skip("TODO: remove when permission model is implemented in relational tables") + } assert.Error(ttt, err) }) }) @@ -738,6 +741,9 @@ func TestServer_DeleteOrganization(t *testing.T) { _, err := client.DeleteOrganization(u, &v2beta_org.DeleteOrganizationRequest{Id: organisation.Id}) // then + if relTableTestCase.Enabled { + tttt.Skip("TODO: remove when permission model is implemented in relational tables") + } assert.ErrorContains(tttt, err, "membership not found") }) } @@ -833,6 +839,9 @@ func TestServer_ActivateOrganization(t *testing.T) { _, err = client.ActivateOrganization(u, &v2beta_org.ActivateOrganizationRequest{Id: organisation.Id}) // then + if testCase.Enabled { + tttt.Skip("TODO: remove when permission model is implemented in relational tables") + } assert.ErrorContains(tttt, err, "membership not found") }) } @@ -903,6 +912,9 @@ func TestServer_DeactivateOrganization(t *testing.T) { _, err := client.DeactivateOrganization(u, &v2beta_org.DeactivateOrganizationRequest{Id: organisation.Id}) // then + if testCase.Enabled { + tttt.Skip("TODO: remove when permission model is implemented in relational tables") + } assert.ErrorContains(tttt, err, "membership not found") }) } diff --git a/internal/integration/feature.go b/internal/integration/feature.go index 6a3f6d4d8..4d8920859 100644 --- a/internal/integration/feature.go +++ b/internal/integration/feature.go @@ -34,6 +34,7 @@ type RelationalTableFeatureMatrix struct { Name string Inst *Instance InstOwner context.Context + Enabled bool } // TODO(IAM-Marco): Once we have gotten rid of eventstore, this can be removed @@ -51,12 +52,16 @@ func RelationalTablesEnableMatrix(t *testing.T, ctx context.Context, sysAuthZ co func() RelationalTableFeatureMatrix { inst := NewInstance(sysAuthZ) instOwner := inst.WithAuthorizationToken(ctx, UserTypeIAMOwner) - _, err := inst.Client.FeatureV2.SetInstanceFeatures(instOwner, &feature.SetInstanceFeaturesRequest{EnableRelationalTables: gu.Ptr(false)}) - require.NoError(t, err) + EnsureInstanceFeature(t, ctx, inst, &feature.SetInstanceFeaturesRequest{ + EnableRelationalTables: gu.Ptr(true), + }, func(tt *assert.CollectT, got *feature.GetInstanceFeaturesResponse) { + assert.True(tt, got.GetEnableRelationalTables().GetEnabled(), "expected relational tables to be enabled") + }) return RelationalTableFeatureMatrix{ Name: "when relational tables are enabled", Inst: inst, InstOwner: instOwner, + Enabled: true, } }(), }