MCPcopy Index your code
hub / github.com/coder/coder / TestAuditLogDefaultLimit

Function TestAuditLogDefaultLimit

coderd/database/querier_test.go:2571–2592  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2569}
2570
2571func TestAuditLogDefaultLimit(t *testing.T) {
2572 t.Parallel()
2573 if testing.Short() {
2574 t.SkipNow()
2575 }
2576
2577 sqlDB := testSQLDB(t)
2578 err := migrations.Up(sqlDB)
2579 require.NoError(t, err)
2580 db := database.New(sqlDB)
2581
2582 for i := 0; i < 110; i++ {
2583 dbgen.AuditLog(t, db, database.AuditLog{})
2584 }
2585
2586 ctx := testutil.Context(t, testutil.WaitShort)
2587 rows, err := db.GetAuditLogsOffset(ctx, database.GetAuditLogsOffsetParams{})
2588 require.NoError(t, err)
2589 // The length should match the default limit of the SQL query.
2590 // Updating the sql query requires changing the number below to match.
2591 require.Len(t, rows, 100)
2592}
2593
2594func TestAuditLogCount(t *testing.T) {
2595 t.Parallel()

Callers

nothing calls this directly

Calls 8

UpFunction · 0.92
NewFunction · 0.92
AuditLogFunction · 0.92
ContextFunction · 0.92
SkipNowMethod · 0.80
testSQLDBFunction · 0.70
GetAuditLogsOffsetMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected