From d269b3fb4f3c73a84c8f1500de0d7ebb18596833 Mon Sep 17 00:00:00 2001 From: Nelly Credi Date: Tue, 17 Mar 2020 19:45:13 +0200 Subject: [PATCH] Allow setting Polarion lookup method 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 --- pkg/ginkgo-reporters/polarion_reporter.go | 4 +++- pkg/ginkgo-reporters/polarion_reporter_test.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/ginkgo-reporters/polarion_reporter.go b/pkg/ginkgo-reporters/polarion_reporter.go index dbdf5c6..94ef8f7 100644 --- a/pkg/ginkgo-reporters/polarion_reporter.go +++ b/pkg/ginkgo-reporters/polarion_reporter.go @@ -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 { @@ -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) { @@ -102,7 +104,7 @@ func (reporter *PolarionReporter) SpecSuiteWillBegin(config config.GinkgoConfigT }, { Name: "polarion-lookup-method", - Value: "id", + Value: reporter.LookupMethod, }, { Name: "polarion-custom-plannedin", diff --git a/pkg/ginkgo-reporters/polarion_reporter_test.go b/pkg/ginkgo-reporters/polarion_reporter_test.go index 9727750..4c43e3d 100644 --- a/pkg/ginkgo-reporters/polarion_reporter_test.go +++ b/pkg/ginkgo-reporters/polarion_reporter_test.go @@ -55,6 +55,7 @@ var _ = Describe("ginkgo_reporters", func() { ProjectId: "QE", PlannedIn: "QE_1.0", Tier: "tier1", + LookupMethod: "id", } properties = PolarionProperties{