Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
$ pwd
$ dlv test              
Type 'help' for list of commands.
(dlv) funcs auditlog.Test*
(dlv) break TestLogFailedQuery
Breakpoint 1 set at 0x1ce06bb for ./middleware_test.go:83
(dlv) c
> ./middleware_test.go:83 (hits goroutine(78):1 total:1) (PC: 0x1ce06bb)
    78:                 require.Equal(t, nulls.NewString("{}"), entry.Response) // default is null so this confirms the second write succeeded
    79:                 require.Equal(t, nulls.NewString(""), entry.Error)
    80:         })
    81: }
=>  83: func TestLogFailedQuery(t *testing.T) {
    84:         conn, err := pop.Connect("test")
    85:         require.NoError(t, err)
    87:         // Simulate authenticated request
    88:         om, cluster := models.CreateRandomOrgUserAndCluster(t, conn)

Below is another example where tests for the intrusion server are being run. Note the two syntaxes for creating break points.

Code Block
$ pwd
/home/roach/go/src/                                                                                                                                                /0.0s
$ dlv test ./intrusion/server
Type 'help' for list of commands.
(dlv) break TestUseHttpAuditLogMiddlewareWithAuditLogFailure
Breakpoint 1 set at 0x6b50ffb for ./intrusion/server/middleware_test.go:134
(dlv) break ./intrusion/server/middleware_test.go:117
Breakpoint 2 set at 0x6b8cc46 for ./intrusion/server/middleware_test.go:117

Getting a Linux Delve binary onto a roachprod node