diff --git a/pkg/hubtest/parser_assert.go b/pkg/hubtest/parser_assert.go index e27d7d878..d579a1be4 100644 --- a/pkg/hubtest/parser_assert.go +++ b/pkg/hubtest/parser_assert.go @@ -321,9 +321,14 @@ func LoadParserDump(filepath string) (*ParserResults, error) { stages = append(stages, k) } sort.Strings(stages) - /*the very last one is set to 'success' which is just a bool indicating if the line was successfully parsed*/ - lastStage := stages[len(stages)-2] - + var lastStage string + //Loop over stages to find last successful one with at least one parser + for i := len(stages) - 2; i >= 0; i-- { + if len(pdump[stages[i]]) != 0 { + lastStage = stages[i] + break + } + } parsers := make([]string, 0, len(pdump[lastStage])) for k := range pdump[lastStage] { parsers = append(parsers, k)