Skip to content

Commit

Permalink
Allow setting Polarion lookup method
Browse files Browse the repository at this point in the history
Used to be hardcoded id,
but we cannot put ids in all of our testing repos,
so adding the option to use name
(which is more risky as test names often change)

Signed-off-by: Nelly Credi <ncredi@redhat.com>
  • Loading branch information
nellyc committed Mar 17, 2020
1 parent 934db05 commit d269b3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/ginkgo-reporters/polarion_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func init() {
flag.StringVar(&Polarion.Filename, "polarion-report-file", "polarion_results.xml", "Set Polarion report file path")
flag.StringVar(&Polarion.PlannedIn, "polarion-custom-plannedin", "", "Set Polarion planned-in ID")
flag.StringVar(&Polarion.Tier, "test-tier", "", "Set test tier number")
flag.StringVar(&Polarion.LookupMethod, "polarion-lookup-method", "id", "Set Polarion lookup method - id or name")
}

type PolarionTestSuite struct {
Expand Down Expand Up @@ -85,6 +86,7 @@ type PolarionReporter struct {
ProjectId string
PlannedIn string
Tier string
LookupMethod string
}

func (reporter *PolarionReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) {
Expand All @@ -102,7 +104,7 @@ func (reporter *PolarionReporter) SpecSuiteWillBegin(config config.GinkgoConfigT
},
{
Name: "polarion-lookup-method",
Value: "id",
Value: reporter.LookupMethod,
},
{
Name: "polarion-custom-plannedin",
Expand Down
1 change: 1 addition & 0 deletions pkg/ginkgo-reporters/polarion_reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var _ = Describe("ginkgo_reporters", func() {
ProjectId: "QE",
PlannedIn: "QE_1.0",
Tier: "tier1",
LookupMethod: "id",
}

properties = PolarionProperties{
Expand Down

0 comments on commit d269b3f

Please sign in to comment.