test: Use a template to prevent migrations from running for every test (#2462)

* test: Use a template to prevent migrations from running for every test

* Create a single makefile target

* Fix built-in race

* Extend timeout of built-in PostgreSQL fetch
This commit is contained in:
Kyle Carberry
2022-06-27 12:07:39 -05:00
committed by GitHub
parent d9da96cad0
commit 6429dfee1f
7 changed files with 63 additions and 38 deletions

View File

@ -83,9 +83,9 @@ func TestServer(t *testing.T) {
errC <- root.ExecuteContext(ctx)
}()
require.Eventually(t, func() bool {
_, err := cfg.URL().Read()
return err == nil
}, time.Minute, 25*time.Millisecond)
accessURLRaw, err := cfg.URL().Read()
return accessURLRaw != "" && err == nil
}, 3*time.Minute, 250*time.Millisecond)
cancelFunc()
require.ErrorIs(t, <-errC, context.Canceled)
})