mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 19:51:39 +00:00
Allow defers to run in TestMain
in federation API tests
This commit is contained in:
parent
028963af1c
commit
b5a497a0c0
@ -55,6 +55,7 @@ var servers = map[string]*server{
|
|||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
// Set up the server key API for each "server" that we
|
// Set up the server key API for each "server" that we
|
||||||
// will use in our tests.
|
// will use in our tests.
|
||||||
|
os.Exit(func() int {
|
||||||
for _, s := range servers {
|
for _, s := range servers {
|
||||||
// Generate a new key.
|
// Generate a new key.
|
||||||
_, testPriv, err := ed25519.GenerateKey(nil)
|
_, testPriv, err := ed25519.GenerateKey(nil)
|
||||||
@ -108,7 +109,8 @@ func TestMain(m *testing.M) {
|
|||||||
|
|
||||||
// Now that we have built our server key APIs, start the
|
// Now that we have built our server key APIs, start the
|
||||||
// rest of the tests.
|
// rest of the tests.
|
||||||
os.Exit(m.Run())
|
return m.Run()
|
||||||
|
}())
|
||||||
}
|
}
|
||||||
|
|
||||||
type MockRoundTripper struct{}
|
type MockRoundTripper struct{}
|
||||||
|
Loading…
Reference in New Issue
Block a user