mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add database dump and dbfake logging (#19144)
relates to #778 Somehow in `TestWorkspaceAgent` the agent with the test instance identifier is not being added to the database, or is getting deleted. I'm adding some additional logging to `dbfake` and setting the affected tests to dump postgres on error, to see if we can get to the bottom of the issue.
This commit is contained in:
@@ -206,7 +206,7 @@ func DumpOnFailure(t testing.TB, connectionURL string) {
|
||||
outPath := filepath.Join(cwd, snakeCaseName+"."+timeSuffix+".test.sql")
|
||||
dump, err := PGDump(connectionURL)
|
||||
if err != nil {
|
||||
t.Errorf("dump on failure: failed to run pg_dump")
|
||||
t.Errorf("dump on failure: failed to run pg_dump: %s", err.Error())
|
||||
return
|
||||
}
|
||||
if err := os.WriteFile(outPath, normalizeDump(dump), 0o600); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user