From c87d26c4f6dd7d3b09d6f4f9a872083116fd3421 Mon Sep 17 00:00:00 2001 From: miampf Date: Thu, 27 Jun 2024 14:42:58 +0000 Subject: [PATCH] ci: improve debug logging for e2e tests (#649) --- cli/cmd/generate.go | 2 +- e2e/internal/contrasttest/contrasttest.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/cmd/generate.go b/cli/cmd/generate.go index dbbd05dcbf..13702f626f 100644 --- a/cli/cmd/generate.go +++ b/cli/cmd/generate.go @@ -498,7 +498,7 @@ func generatePolicyForFile(ctx context.Context, genpolicyPath, regoPath, policyP fmt.Sprintf("--yaml-file=%s", yamlPath), } genpolicy := exec.CommandContext(ctx, genpolicyPath, args...) - genpolicy.Env = append(genpolicy.Env, "RUST_LOG=info") + genpolicy.Env = append(genpolicy.Env, "RUST_LOG=info", "RUST_BACKTRACE=1") logFilter := newLogTranslator(logger) defer logFilter.stop() diff --git a/e2e/internal/contrasttest/contrasttest.go b/e2e/internal/contrasttest/contrasttest.go index ca6b9aab38..c2c500a673 100644 --- a/e2e/internal/contrasttest/contrasttest.go +++ b/e2e/internal/contrasttest/contrasttest.go @@ -143,6 +143,7 @@ func (ct *ContrastTest) Generate(t *testing.T) { generate := cmd.NewGenerateCmd() generate.Flags().String("workspace-dir", "", "") // Make generate aware of root flags + generate.Flags().String("log-level", "debug", "") generate.SetArgs(args) generate.SetOut(io.Discard) errBuf := &bytes.Buffer{}