Skip to content

Commit

Permalink
e2e: add LOG_TO_CONSOLE to enable fixture logging
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed Mar 22, 2022
1 parent a86a361 commit 2fd45fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/e2e/framework/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func NewKcpFixture(t *testing.T, cfgs ...KcpConfig) *KcpFixture {
wg.Add(len(servers))
for i, srv := range servers {
var opts []RunOption
if cfgs[i].LogToConsole {
if LogToConsoleEnvSet() || cfgs[i].LogToConsole {
opts = append(opts, WithLogStreaming)
}
if InProcessEnvSet() || cfgs[i].RunInProcess {
Expand Down Expand Up @@ -137,6 +137,11 @@ func InProcessEnvSet() bool {
return inProcess
}

func LogToConsoleEnvSet() bool {
inProcess, _ := strconv.ParseBool(os.Getenv("LOG_TO_CONSOLE"))
return inProcess
}

func NewOrganizationFixture(t *testing.T, server RunningServer) (orgClusterName string) {
ctx, cancelFunc := context.WithCancel(context.Background())
t.Cleanup(cancelFunc)
Expand Down

0 comments on commit 2fd45fc

Please sign in to comment.