Skip to content

Commit

Permalink
internal/session: add helper for listing sessions
Browse files Browse the repository at this point in the history
This is used in an enterprise test
  • Loading branch information
johanbrandhorst committed Dec 18, 2023
1 parent 6260815 commit dd5b6e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/session/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,10 @@ func TestTofu(t testing.TB) []byte {
func TestCert(jobId string) (ed25519.PrivateKey, []byte, error) {
return newCert(context.Background(), jobId, []string{"127.0.0.1", "localhost"}, time.Now().Add(5*time.Minute), rand.Reader)
}

// TestListSessions returns a list of sessions and the timestamp of the query for testing purposes
func TestListSessions(t testing.TB, ctx context.Context, repo *Repository) ([]*Session, time.Time) {
sess, ttime, err := repo.listSessions(ctx)
require.NoError(t, err)
return sess, ttime
}

0 comments on commit dd5b6e8

Please sign in to comment.