feat: add "dormant" user state (#8644)

This commit is contained in:
Marcin Tojek
2023-08-02 16:31:25 +02:00
committed by GitHub
parent d2c7c8e1d8
commit d6e9870209
40 changed files with 587 additions and 239 deletions

View File

@ -587,6 +587,14 @@ func createAnotherUserRetry(t *testing.T, client *codersdk.Client, organizationI
sessionToken = token.Key
}
if user.Status == codersdk.UserStatusDormant {
// Use admin client so that user's LastSeenAt is not updated.
// In general we need to refresh the user status, which should
// transition from "dormant" to "active".
user, err = client.User(context.Background(), user.Username)
require.NoError(t, err)
}
other := codersdk.New(client.URL)
other.SetSessionToken(sessionToken)
t.Cleanup(func() {