Skip to content

Commit

Permalink
Split test-suite-params by comma too apart from spaces
Browse files Browse the repository at this point in the history
Signed-off-by: Quique Llorente <ellorent@redhat.com>
  • Loading branch information
qinqon committed Jul 21, 2020
1 parent 526c666 commit 4990c71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion pkg/ginkgo-reporters/polarion_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (reporter *PolarionReporter) SpecSuiteWillBegin(config config.GinkgoConfigT
}

valuesString := ""
suiteParams := strings.Split(reporter.TestSuiteParams, " ")
suiteParams := splitAny(reporter.TestSuiteParams, " ,")
for _, s := range suiteParams {
keyValue := strings.Split(s, "=")
if len(keyValue) > 1 {
Expand Down Expand Up @@ -259,3 +259,10 @@ func addProperty(properties []PolarionProperty, key string, value string) []Pola
})
return properties
}

func splitAny(s string, seps string) []string {
splitter := func(r rune) bool {
return strings.ContainsRune(seps, r)
}
return strings.FieldsFunc(s, splitter)
}
8 changes: 6 additions & 2 deletions pkg/ginkgo-reporters/polarion_reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var _ = Describe("ginkgo_reporters", func() {
ProjectId: "QE",
PlannedIn: "QE_1.0",
LookupMethod: "id",
TestSuiteParams: "OS=EL7 SC=NFS",
TestSuiteParams: "OS=EL7 SC=NFS,ENV_TIER=TIER1",
TestRunTemplate: "QE_Regression_template",
TestRunTitle: "My run title",
}
Expand All @@ -70,6 +70,10 @@ var _ = Describe("ginkgo_reporters", func() {
Name: "polarion-custom-SC",
Value: "NFS",
},
{
Name: "polarion-custom-ENV_TIER",
Value: "TIER1",
},
{
Name: "polarion-project-id",
Value: "QE",
Expand All @@ -84,7 +88,7 @@ var _ = Describe("ginkgo_reporters", func() {
},
{
Name: "polarion-testrun-id",
Value: "QE_1.0_EL7_NFS",
Value: "QE_1.0_EL7_NFS_TIER1",
},
{
Name: "polarion-custom-isautomated",
Expand Down

0 comments on commit 4990c71

Please sign in to comment.