mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-24 19:07:37 +00:00
chore: improve integration tests (#8727)
Improve integration tests:
- spliting the tests in TokenExchange to isolated instances and in
parallel
- corrected some test structure so that the check for Details is no done
anymore if the test already failed
- replace required-calls with assert-calls to not stop the testing
- add gofakeit for application, project and usernames(emails)
- add eventually checks for testing in actions v2, so the request only
get called when the execution is defined
- check for length of results in list/search endpoints to avoid index
errors
(cherry picked from commit 8d97363642)
This commit is contained in:
committed by
Livio Spring
parent
b6fad5ac83
commit
63a9312a8e
@@ -104,7 +104,7 @@ func TestServer_ListInstances(t *testing.T) {
|
||||
}
|
||||
require.NoError(t, err)
|
||||
got := resp.GetResult()
|
||||
assert.Len(t, got, len(tt.want))
|
||||
require.Len(t, got, len(tt.want))
|
||||
for i := 0; i < len(tt.want); i++ {
|
||||
assert.Equalf(t, tt.want[i].GetId(), got[i].GetId(), "instance[%d] id", i)
|
||||
}
|
||||
|
||||
@@ -140,13 +140,13 @@ func TestServer_Limits_Block(t *testing.T) {
|
||||
InstanceId: isoInstance.ID(),
|
||||
Block: gu.Ptr(true),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.NoError(t, err)
|
||||
// The following call ensures that an undefined bool is not deserialized to false
|
||||
_, err = integration.SystemClient().SetLimits(CTX, &system.SetLimitsRequest{
|
||||
InstanceId: isoInstance.ID(),
|
||||
AuditLogRetention: durationpb.New(time.Hour),
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.NoError(t, err)
|
||||
for _, tt := range tests {
|
||||
var isFirst bool
|
||||
t.Run(tt.name+" with blocking", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user