root: fix log level not being set to DEBUG for tests

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-07-18 21:45:08 +02:00
parent 6ddd6bfa72
commit 322a343c81
2 changed files with 2 additions and 9 deletions

View File

@ -416,9 +416,8 @@ MEDIA_URL = "/media/"
TEST = False TEST = False
TEST_RUNNER = "authentik.root.test_runner.PytestTestRunner" TEST_RUNNER = "authentik.root.test_runner.PytestTestRunner"
# We can't check TEST here as its set later by the test runner
LOG_LEVEL = CONFIG.y("log_level").upper() if not TEST else "DEBUG" LOG_LEVEL = CONFIG.y("log_level").upper() if "TF_BUILD" not in os.environ else "DEBUG"
structlog.configure_once( structlog.configure_once(
processors=[ processors=[

View File

@ -3,7 +3,6 @@ package gounicorn
import ( import (
"os" "os"
"os/exec" "os/exec"
"syscall"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"goauthentik.io/internal/config" "goauthentik.io/internal/config"
@ -37,11 +36,6 @@ func (g *GoUnicorn) initCmd() {
g.log.WithField("args", args).WithField("cmd", command).Debug("Starting gunicorn") g.log.WithField("args", args).WithField("cmd", command).Debug("Starting gunicorn")
g.p = exec.Command(command, args...) g.p = exec.Command(command, args...)
g.p.Env = os.Environ() g.p.Env = os.Environ()
// Don't pass ctrl-c to child
// since we handle it ourselves
g.p.SysProcAttr = &syscall.SysProcAttr{
Setpgid: true,
}
g.p.Stdout = os.Stdout g.p.Stdout = os.Stdout
g.p.Stderr = os.Stderr g.p.Stderr = os.Stderr
} }