Skip to content

Commit

Permalink
testing: make it so caddytest launches an instance of caddy per server
Browse files Browse the repository at this point in the history
  • Loading branch information
elee1766 committed Jun 24, 2024
1 parent c2ccf86 commit b732a79
Show file tree
Hide file tree
Showing 24 changed files with 1,068 additions and 878 deletions.
6 changes: 5 additions & 1 deletion caddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"encoding/hex"
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"io/fs"
Expand Down Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit b732a79

Please sign in to comment.