testing: make it so caddytest launches an instance of caddy per server

This commit is contained in:
a 2024-06-23 19:58:42 -05:00
parent c2ccf8690f
commit b732a7999a
No known key found for this signature in database
GPG key ID: 374BC539FE795AF0
24 changed files with 1071 additions and 881 deletions

View file

@ -20,6 +20,7 @@ import (
"encoding/hex"
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"io/fs"
@ -778,7 +779,10 @@ func exitProcess(ctx context.Context, logger *zap.Logger) {
} else {
logger.Error("unclean shutdown")
}
os.Exit(exitCode)
// check if we are in test environment, and dont call exit if we are
if flag.Lookup("test.v") == nil && !strings.Contains(os.Args[0], ".test") {
os.Exit(exitCode)
}
}()
if remoteAdminServer != nil {