mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-22 04:48:46 +00:00
chore(test): streamline integration tests for instance management (#12243)
- Removed redundant relational instance handling in integration tests for adding and removing custom domains. - Simplified test cases by consolidating instance creation and context management. - Enhanced clarity and maintainability of test logic by reducing complexity in test structures. # Which Problems Are Solved `backed/v3` tests are flaky, but the code is not productive. Development is paused for the moment. Disabling flaky tests helps us to maintain the product easier. # How the Problems Are Solved - Removed redundant relational instance handling in integration tests for adding and removing custom domains. - Simplified test cases by consolidating instance creation and context management. - Enhanced clarity and maintainability of test logic by reducing complexity in test structures.newly introduced terms). # Additional Context - related to https://github.com/zitadel/zitadel/pull/12241 --------- Co-authored-by: Livio Spring <[email protected]> Co-authored-by: Copilot Autofix powered by AI <[email protected]>
This commit is contained in:
co-authored by
Livio Spring
Copilot Autofix powered by AI
parent
7019a03ec4
commit
f85a2373c5
@@ -5,7 +5,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/muhlemmer/gu"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
@@ -29,40 +28,3 @@ func EnsureInstanceFeature(t *testing.T, ctx context.Context, instance *Instance
|
||||
tick,
|
||||
"timed out waiting for ensuring instance feature")
|
||||
}
|
||||
|
||||
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
|
||||
func RelationalTablesEnableMatrix(t *testing.T, ctx context.Context, sysAuthZ context.Context) []RelationalTableFeatureMatrix {
|
||||
return []RelationalTableFeatureMatrix{
|
||||
func() RelationalTableFeatureMatrix {
|
||||
inst := NewInstance(sysAuthZ)
|
||||
instOwner := inst.WithAuthorizationToken(ctx, UserTypeIAMOwner)
|
||||
return RelationalTableFeatureMatrix{
|
||||
Name: "when relational tables are disabled",
|
||||
Inst: inst,
|
||||
InstOwner: instOwner,
|
||||
}
|
||||
}(),
|
||||
func() RelationalTableFeatureMatrix {
|
||||
inst := NewInstance(sysAuthZ)
|
||||
instOwner := inst.WithAuthorizationToken(ctx, UserTypeIAMOwner)
|
||||
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,
|
||||
}
|
||||
}(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user