test: session v2beta corrected like v2 (#9350)

# Which Problems Are Solved

Ordering of sessions in v2beta is still relevant in the integration
tests.

# How the Problems Are Solved

Correct the integration tests on session service v2beta like in v2.

# Additional Changes

None

# Additional Context

Failing integration tests in pipeline.
This commit is contained in:
Stefan Benz 2025-02-12 11:46:14 +01:00 committed by GitHub
parent 840da5be2d
commit 39a7977e34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -493,6 +493,12 @@ func TestServer_ListSessions(t *testing.T) {
return
}
// expected count of sessions is not equal to created dependencies
if !assert.Len(ttt, tt.want.Sessions, len(infos)) {
return
}
// expected count of sessions is not equal to received sessions
if !assert.Equal(ttt, got.Details.TotalResult, tt.want.Details.TotalResult) || !assert.Len(ttt, got.Sessions, len(tt.want.Sessions)) {
return
}
@ -503,8 +509,17 @@ func TestServer_ListSessions(t *testing.T) {
tt.want.Sessions[i].CreationDate = infos[i].Details.GetChangeDate()
tt.want.Sessions[i].ChangeDate = infos[i].Details.GetChangeDate()
verifySession(ttt, got.Sessions[i], tt.want.Sessions[i], time.Minute, tt.wantExpirationWindow, infos[i].UserID, tt.wantFactors...)
// only check for contents of the session, not sorting for now
found := false
for _, session := range got.Sessions {
if session.Id == infos[i].ID {
verifySession(ttt, session, tt.want.Sessions[i], time.Minute, tt.wantExpirationWindow, infos[i].UserID, tt.wantFactors...)
found = true
}
}
assert.True(t, found)
}
integration.AssertListDetails(ttt, tt.want, got)
}, retryDuration, tick)
})