Skip to content

Commit

Permalink
fix: empty suites
Browse files Browse the repository at this point in the history
If a suite didn't contain a name, we added an empty string in place of the name. In the new version, we will skip empty suites.
  • Loading branch information
gibiw committed Sep 16, 2024
1 parent 8ebaeef commit 788f8cb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions internal/parsers/junit/junit.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,16 @@ func convertTestSuites(testSuites TestSuites) []models.Result {
for _, testCase := range testSuite.TestCases {
relation := models.Relation{
Suite: models.Suite{
Data: []models.SuiteData{
{
Title: testSuites.Name,
},
},
Data: []models.SuiteData{},
},
}

if testSuites.Name != "" {
relation.Suite.Data = append(relation.Suite.Data, models.SuiteData{
Title: testSuites.Name,
})
}

parts := strings.Split(testSuite.Name, string(filepath.Separator))
if len(parts) > 1 {
for _, part := range parts {
Expand Down

0 comments on commit 788f8cb

Please sign in to comment.