Skip to content

Commit

Permalink
adding task if runninag in debug (#149)
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Hurley <shawn@hurley.page>
  • Loading branch information
shawn-hurley committed Jul 3, 2024
1 parent b81e850 commit ca40e4c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions analysis/analysis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func TestApplicationAnalysis(t *testing.T) {
tc.Task.State = "Ready"
assert.Should(t, RichClient.Task.Update(&tc.Task))

_, debug := os.LookupEnv("DEBUG")
// Wait until task finishes
var task *api.Task
var err error
Expand All @@ -150,6 +151,9 @@ func TestApplicationAnalysis(t *testing.T) {
t.Error("Analyze Task failed. Details:")
pp.Println(task)
}
if debug {
pp.Println(task)
}

var gotAppAnalyses []api.Analysis
var gotAnalysis api.Analysis
Expand Down Expand Up @@ -211,12 +215,12 @@ func TestApplicationAnalysis(t *testing.T) {
if len(got.Incidents) != len(expected.Incidents) {
t.Errorf("Different amount of incidents error. Got %d, expected %d.", len(got.Incidents), len(expected.Incidents))
missing, unexpected := getIncidentsDiff(expected.Incidents, got.Incidents)
for _, incident := range missing {
for _, incident := range missing {
fmt.Printf("Expected incident not found: %s line %d.\n", incident.File, incident.Line)
}
for _, incident := range unexpected {
}
for _, incident := range unexpected {
fmt.Printf("Unexpected incident found: %s line %d.\n", incident.File, incident.Line)
}
}

} else {
// Ensure stable order of Incidents.
Expand Down

0 comments on commit ca40e4c

Please sign in to comment.