mirror of
https://github.com/caddyserver/caddy.git
synced 2025-12-08 06:09:53 +00:00
testing: make it so caddytest launches an instance of caddy per server
This commit is contained in:
parent
c2ccf8690f
commit
b732a7999a
24 changed files with 1071 additions and 881 deletions
6
caddy.go
6
caddy.go
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue