From b0a00bd897e3483747690628ddeb1427a5d5bf9c Mon Sep 17 00:00:00 2001 From: koodeex Date: Mon, 16 Oct 2023 18:32:14 +0300 Subject: [PATCH] [v0.6.29] fix label parsing if label value is number --- go.mod | 4 +- pkg/allure/label.go | 14 +++++- pkg/allure/label_test.go | 34 +++++++------- pkg/allure/result_test.go | 44 +++++++++---------- .../adapter/test_adapter_test.go | 14 +++--- .../allure_manager/manager/labels_test.go | 44 +++++++++---------- .../allure_manager/manager/provider_test.go | 6 +-- pkg/framework/go.mod | 2 +- pkg/framework/runner/suite_runner.go | 6 +-- 9 files changed, 89 insertions(+), 79 deletions(-) diff --git a/go.mod b/go.mod index 4537e10..ef2a5f6 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ replace ( require ( github.com/jackc/fake v0.0.0-20150926172116-812a484cc733 - github.com/ozontech/allure-go/pkg/allure v0.6.11 - github.com/ozontech/allure-go/pkg/framework v0.6.28 + github.com/ozontech/allure-go/pkg/allure v0.6.12 + github.com/ozontech/allure-go/pkg/framework v0.6.29 ) require ( diff --git a/pkg/allure/label.go b/pkg/allure/label.go index 189084a..8b7d7d8 100644 --- a/pkg/allure/label.go +++ b/pkg/allure/label.go @@ -1,10 +1,20 @@ package allure +import ( + "fmt" + "strings" +) + // Label is the implementation of the label. // A label is an entity used by Allure to make metrics and grouping of tests. type Label struct { - Name string `json:"name"` // Label's name - Value string `json:"value"` // Label's value + Name string `json:"name"` // Label's name + Value interface{} `json:"value"` // Label's value +} + +// GetValue returns label value as string +func (l *Label) GetValue() string { + return strings.Trim(fmt.Sprintf("%s", l.Value), "\"") } // NewLabel - builds and returns a new allure.Label. The label key depends on the passed LabelType. diff --git a/pkg/allure/label_test.go b/pkg/allure/label_test.go index 4e73f8b..8b341c0 100644 --- a/pkg/allure/label_test.go +++ b/pkg/allure/label_test.go @@ -99,21 +99,21 @@ func TestLabelCreation(t *testing.T) { require.Equal(t, lead.Name, Lead.ToString()) require.Equal(t, idAllure.Name, AllureID.ToString()) - require.Equal(t, "epicTest", epic.Value) - require.Equal(t, "featureTest", feature.Value) - require.Equal(t, "storyTest", story.Value) - require.Equal(t, "idTest", as_id.Value) - require.Equal(t, BLOCKER.ToString(), severity.Value) - require.Equal(t, "parentSuiteTest", parentSuite.Value) - require.Equal(t, "suiteTest", suite.Value) - require.Equal(t, "subSuiteTest", subsuite.Value) - require.Equal(t, "packageTest", _package.Value) - require.Equal(t, "threadTest", thread.Value) - require.Equal(t, "hostTest", host.Value) - require.Equal(t, "tagTest", tag.Value) - require.Equal(t, "frameWorkTest", framework.Value) - require.Equal(t, "languageTest", language.Value) - require.Equal(t, "ownerTest", owner.Value) - require.Equal(t, "leadTest", lead.Value) - require.Equal(t, "idAllureTest", idAllure.Value) + require.Equal(t, "epicTest", epic.GetValue()) + require.Equal(t, "featureTest", feature.GetValue()) + require.Equal(t, "storyTest", story.GetValue()) + require.Equal(t, "idTest", as_id.GetValue()) + require.Equal(t, BLOCKER.ToString(), severity.GetValue()) + require.Equal(t, "parentSuiteTest", parentSuite.GetValue()) + require.Equal(t, "suiteTest", suite.GetValue()) + require.Equal(t, "subSuiteTest", subsuite.GetValue()) + require.Equal(t, "packageTest", _package.GetValue()) + require.Equal(t, "threadTest", thread.GetValue()) + require.Equal(t, "hostTest", host.GetValue()) + require.Equal(t, "tagTest", tag.GetValue()) + require.Equal(t, "frameWorkTest", framework.GetValue()) + require.Equal(t, "languageTest", language.GetValue()) + require.Equal(t, "ownerTest", owner.GetValue()) + require.Equal(t, "leadTest", lead.GetValue()) + require.Equal(t, "idAllureTest", idAllure.GetValue()) } diff --git a/pkg/allure/result_test.go b/pkg/allure/result_test.go index 4784d95..9425265 100644 --- a/pkg/allure/result_test.go +++ b/pkg/allure/result_test.go @@ -31,7 +31,7 @@ func TestNewResult(t *testing.T) { require.Equal(t, getMD5Hash(getMD5Hash(testFullName)), result.HistoryID) require.Len(t, result.Labels, 1) require.Equal(t, Language.ToString(), result.Labels[0].Name) - require.Equal(t, runtime.Version(), result.Labels[0].Value) + require.Equal(t, runtime.Version(), result.Labels[0].GetValue()) require.Equal(t, now, result.Start) } @@ -43,7 +43,7 @@ func TestResult_GetLabel(t *testing.T) { require.NotNil(t, langLabel) require.Len(t, langLabel, 1) require.Equal(t, Language.ToString(), langLabel[0].Name) - require.Equal(t, runtime.Version(), langLabel[0].Value) + require.Equal(t, runtime.Version(), langLabel[0].GetValue()) } func TestResult_Begin(t *testing.T) { @@ -77,7 +77,7 @@ func TestResult_WithFrameWork(t *testing.T) { require.NotNil(t, label) require.Len(t, label, 1) require.Equal(t, Framework.ToString(), label[0].Name) - require.Equal(t, labelValue, label[0].Value) + require.Equal(t, labelValue, label[0].GetValue()) } func TestResult_WithHost(t *testing.T) { @@ -89,7 +89,7 @@ func TestResult_WithHost(t *testing.T) { require.NotNil(t, label) require.Len(t, label, 1) require.Equal(t, Host.ToString(), label[0].Name) - require.Equal(t, labelValue, label[0].Value) + require.Equal(t, labelValue, label[0].GetValue()) } func TestResult_WithLanguage(t *testing.T) { @@ -101,7 +101,7 @@ func TestResult_WithLanguage(t *testing.T) { require.NotNil(t, label) require.Len(t, label, 1) require.Equal(t, Language.ToString(), label[0].Name) - require.Equal(t, labelValue, label[0].Value) + require.Equal(t, labelValue, label[0].GetValue()) } func TestResult_WithPackage(t *testing.T) { @@ -113,7 +113,7 @@ func TestResult_WithPackage(t *testing.T) { require.NotNil(t, label) require.Len(t, label, 1) require.Equal(t, Package.ToString(), label[0].Name) - require.Equal(t, labelValue, label[0].Value) + require.Equal(t, labelValue, label[0].GetValue()) } func TestResult_WithParentSuite(t *testing.T) { @@ -125,7 +125,7 @@ func TestResult_WithParentSuite(t *testing.T) { require.NotNil(t, label) require.Len(t, label, 1) require.Equal(t, ParentSuite.ToString(), label[0].Name) - require.Equal(t, labelValue, label[0].Value) + require.Equal(t, labelValue, label[0].GetValue()) } func TestResult_WithSuite(t *testing.T) { @@ -137,7 +137,7 @@ func TestResult_WithSuite(t *testing.T) { require.NotNil(t, label) require.Len(t, label, 1) require.Equal(t, Suite.ToString(), label[0].Name) - require.Equal(t, labelValue, label[0].Value) + require.Equal(t, labelValue, label[0].GetValue()) } func TestResult_WithSubSuites(t *testing.T) { @@ -150,9 +150,9 @@ func TestResult_WithSubSuites(t *testing.T) { require.NotNil(t, label) require.Len(t, label, 2) require.Equal(t, SubSuite.ToString(), label[0].Name) - require.Equal(t, labelValue1, label[0].Value) + require.Equal(t, labelValue1, label[0].GetValue()) require.Equal(t, SubSuite.ToString(), label[1].Name) - require.Equal(t, labelValue2, label[1].Value) + require.Equal(t, labelValue2, label[1].GetValue()) } func TestResult_WithThread(t *testing.T) { @@ -164,7 +164,7 @@ func TestResult_WithThread(t *testing.T) { require.NotNil(t, label) require.Len(t, label, 1) require.Equal(t, Thread.ToString(), label[0].Name) - require.Equal(t, labelValue, label[0].Value) + require.Equal(t, labelValue, label[0].GetValue()) } func TestResult_SetStatusMessage(t *testing.T) { @@ -211,9 +211,9 @@ func TestResult_SetLabel(t *testing.T) { require.NotNil(t, label) require.Len(t, label, 2) require.Equal(t, Framework.ToString(), label[0].Name) - require.Equal(t, labelValue1, label[0].Value) + require.Equal(t, labelValue1, label[0].GetValue()) require.Equal(t, Host.ToString(), label[1].Name) - require.Equal(t, labelValue2, label[1].Value) + require.Equal(t, labelValue2, label[1].GetValue()) } func TestResult_SetNewLabelMap(t *testing.T) { @@ -230,13 +230,13 @@ func TestResult_SetNewLabelMap(t *testing.T) { require.NotNil(t, labelFramework) require.Len(t, labelFramework, 1) require.Equal(t, Framework.ToString(), labelFramework[0].Name) - require.Equal(t, labelValue1, labelFramework[0].Value) + require.Equal(t, labelValue1, labelFramework[0].GetValue()) labelHost := result.GetLabels(Host) require.NotNil(t, labelFramework) require.Len(t, labelFramework, 1) require.Equal(t, Host.ToString(), labelHost[0].Name) - require.Equal(t, labelValue2, labelHost[0].Value) + require.Equal(t, labelValue2, labelHost[0].GetValue()) } func TestResult_WithLaunchTags_noTags(t *testing.T) { @@ -255,9 +255,9 @@ func TestResult_WithLaunchTags_withTags(t *testing.T) { labels := result.GetLabels(Tag) require.Len(t, labels, 2) require.Equal(t, Tag.ToString(), labels[0].Name) - require.Equal(t, "tag1", labels[0].Value) + require.Equal(t, "tag1", labels[0].GetValue()) require.Equal(t, Tag.ToString(), labels[1].Name) - require.Equal(t, "tag2", labels[1].Value) + require.Equal(t, "tag2", labels[1].GetValue()) } func TestResult_WithLabels(t *testing.T) { @@ -272,9 +272,9 @@ func TestResult_WithLabels(t *testing.T) { labels := result.Labels require.Len(t, labels, 2) require.Equal(t, Framework.ToString(), labels[0].Name) - require.Equal(t, labelValue1, labels[0].Value) + require.Equal(t, labelValue1, labels[0].GetValue()) require.Equal(t, Language.ToString(), labels[1].Name) - require.Equal(t, labelValue2, labels[1].Value) + require.Equal(t, labelValue2, labels[1].GetValue()) } func TestResult_PrintAttachments(t *testing.T) { @@ -333,7 +333,7 @@ func TestResult_Print(t *testing.T) { require.Len(t, emptyResult.Labels, 1) require.Equal(t, result.Labels[0].Name, emptyResult.Labels[0].Name) - require.Equal(t, result.Labels[0].Value, emptyResult.Labels[0].Value) + require.Equal(t, result.Labels[0].GetValue(), emptyResult.Labels[0].GetValue()) require.Equal(t, result.Start, emptyResult.Start) } @@ -385,7 +385,7 @@ func TestResult_Print_withAttachment(t *testing.T) { require.Len(t, emptyResult.Labels, 1) require.Equal(t, result.Labels[0].Name, emptyResult.Labels[0].Name) - require.Equal(t, result.Labels[0].Value, emptyResult.Labels[0].Value) + require.Equal(t, result.Labels[0].GetValue(), emptyResult.Labels[0].GetValue()) require.Equal(t, result.Start, emptyResult.Start) attachFile, _ := os.Open(fmt.Sprintf("%s/%s", allureDir, attachByte.Name())) @@ -441,7 +441,7 @@ func TestResult_Done(t *testing.T) { require.Len(t, emptyResult.Labels, 1) require.Equal(t, result.Labels[0].Name, emptyResult.Labels[0].Name) - require.Equal(t, result.Labels[0].Value, emptyResult.Labels[0].Value) + require.Equal(t, result.Labels[0].GetValue(), emptyResult.Labels[0].GetValue()) require.Equal(t, result.Start, emptyResult.Start) require.Equal(t, now, emptyResult.Stop) diff --git a/pkg/framework/core/allure_manager/adapter/test_adapter_test.go b/pkg/framework/core/allure_manager/adapter/test_adapter_test.go index e576cae..a9bc991 100644 --- a/pkg/framework/core/allure_manager/adapter/test_adapter_test.go +++ b/pkg/framework/core/allure_manager/adapter/test_adapter_test.go @@ -18,23 +18,23 @@ func TestNewTestMeta(t *testing.T) { require.Equal(t, "fullName/testName", adapter.GetResult().FullName) require.Len(t, adapter.GetResult().GetLabels(allure.Host), 1) - require.Equal(t, adapter.GetResult().GetLabels(allure.Host)[0].Value, host) + require.Equal(t, adapter.GetResult().GetLabels(allure.Host)[0].GetValue(), host) require.Len(t, adapter.GetResult().GetLabels(allure.Framework), 1) - require.Equal(t, adapter.GetResult().GetLabels(allure.Framework)[0].Value, allure.DefaultVersion) + require.Equal(t, adapter.GetResult().GetLabels(allure.Framework)[0].GetValue(), allure.DefaultVersion) require.Len(t, adapter.GetResult().GetLabels(allure.Thread), 1) - require.Equal(t, "fullName/testName", adapter.GetResult().GetLabels(allure.Thread)[0].Value) + require.Equal(t, "fullName/testName", adapter.GetResult().GetLabels(allure.Thread)[0].GetValue()) require.Len(t, adapter.GetResult().GetLabels(allure.Suite), 1) - require.Equal(t, "suiteName", adapter.GetResult().GetLabels(allure.Suite)[0].Value) + require.Equal(t, "suiteName", adapter.GetResult().GetLabels(allure.Suite)[0].GetValue()) require.Len(t, adapter.GetResult().GetLabels(allure.Package), 1) - require.Equal(t, "packageName", adapter.GetResult().GetLabels(allure.Package)[0].Value) + require.Equal(t, "packageName", adapter.GetResult().GetLabels(allure.Package)[0].GetValue()) require.Len(t, adapter.GetResult().GetLabels(allure.Tag), 2) - require.Equal(t, "tag1", adapter.GetResult().GetLabels(allure.Tag)[0].Value) - require.Equal(t, "tag2", adapter.GetResult().GetLabels(allure.Tag)[1].Value) + require.Equal(t, "tag1", adapter.GetResult().GetLabels(allure.Tag)[0].GetValue()) + require.Equal(t, "tag2", adapter.GetResult().GetLabels(allure.Tag)[1].GetValue()) } diff --git a/pkg/framework/core/allure_manager/manager/labels_test.go b/pkg/framework/core/allure_manager/manager/labels_test.go index 8631204..752b3bf 100644 --- a/pkg/framework/core/allure_manager/manager/labels_test.go +++ b/pkg/framework/core/allure_manager/manager/labels_test.go @@ -50,139 +50,139 @@ func TestAllureManager_Labels(t *testing.T) { manager.ID("id") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.ID)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.ID), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.ID)[0].Value, "id") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.ID)[0].GetValue(), "id") }) t.Run("AllureID", func(t *testing.T) { manager.AllureID("allureID") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.AllureID)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.AllureID), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.AllureID)[0].Value, "allureID") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.AllureID)[0].GetValue(), "allureID") }) t.Run("Epic", func(t *testing.T) { manager.Epic("epic") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Epic)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Epic), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Epic)[0].Value, "epic") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Epic)[0].GetValue(), "epic") }) t.Run("Feature", func(t *testing.T) { manager.Feature("feature") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Feature)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Feature), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Feature)[0].Value, "feature") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Feature)[0].GetValue(), "feature") }) t.Run("Story", func(t *testing.T) { manager.Story("story") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Story)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Story), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Story)[0].Value, "story") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Story)[0].GetValue(), "story") }) t.Run("Severity", func(t *testing.T) { manager.Severity(allure.TRIVIAL) require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Severity)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Severity), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Severity)[0].Value, allure.TRIVIAL.ToString()) + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Severity)[0].GetValue(), allure.TRIVIAL.ToString()) }) t.Run("Tag", func(t *testing.T) { manager.Tag("tag1") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Tag)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Tag), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[0].Value, "tag1") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[0].GetValue(), "tag1") }) t.Run("Tags", func(t *testing.T) { manager.Tags("tag2", "tag3") require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Tag), 3) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[1].Value, "tag2") - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[2].Value, "tag3") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[1].GetValue(), "tag2") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[2].GetValue(), "tag3") }) t.Run("Owner", func(t *testing.T) { manager.Owner("owner") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Owner)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Owner), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Owner)[0].Value, "owner") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Owner)[0].GetValue(), "owner") }) t.Run("Lead", func(t *testing.T) { manager.Lead("lead") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Lead)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Lead), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Lead)[0].Value, "lead") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Lead)[0].GetValue(), "lead") }) t.Run("Label", func(t *testing.T) { manager.Label(allure.NewLabel(allure.Framework, "Framework")) require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Framework)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Framework), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Framework)[0].Value, "Framework") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Framework)[0].GetValue(), "Framework") }) t.Run("Labels", func(t *testing.T) { manager.Labels(allure.NewLabel(allure.Tag, "tag4"), allure.NewLabel(allure.Tag, "tag5")) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Tag), 5) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[3].Value, "tag4") - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[4].Value, "tag5") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[3].GetValue(), "tag4") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Tag)[4].GetValue(), "tag5") }) t.Run("AddSuiteLabel", func(t *testing.T) { manager.AddSuiteLabel("Suite") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Suite)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Suite), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Suite)[0].Value, "Suite") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Suite)[0].GetValue(), "Suite") }) t.Run("AddSubSuite", func(t *testing.T) { manager.AddSubSuite("SubSuite") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.SubSuite)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.SubSuite), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.SubSuite)[0].Value, "SubSuite") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.SubSuite)[0].GetValue(), "SubSuite") }) t.Run("AddParentSuite", func(t *testing.T) { manager.AddParentSuite("ParentSuite") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.ParentSuite)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.ParentSuite), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.ParentSuite)[0].Value, "ParentSuite") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.ParentSuite)[0].GetValue(), "ParentSuite") }) t.Run("ID", func(t *testing.T) { manager.Host("Host") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Host)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Host), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Host)[0].Value, "Host") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Host)[0].GetValue(), "Host") }) t.Run("Thread", func(t *testing.T) { manager.Thread("Thread") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Thread)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Thread), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Thread)[0].Value, "Thread") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Thread)[0].GetValue(), "Thread") }) t.Run("Language", func(t *testing.T) { manager.Language("Language") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Language)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Language), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Language)[0].Value, "Language") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Language)[0].GetValue(), "Language") }) t.Run("Package", func(t *testing.T) { manager.Package("Package") require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Package)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Package), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Package)[0].Value, "Package") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Package)[0].GetValue(), "Package") }) t.Run("ReplaceLabel", func(t *testing.T) { manager.ReplaceLabel(allure.NewLabel(allure.Framework, "NewFramework")) require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Framework)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Framework), 1) - require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Framework)[0].Value, "NewFramework") + require.Equal(t, manager.testMeta.GetResult().GetLabels(allure.Framework)[0].GetValue(), "NewFramework") }) } diff --git a/pkg/framework/core/allure_manager/manager/provider_test.go b/pkg/framework/core/allure_manager/manager/provider_test.go index f72fbc2..224e9e2 100644 --- a/pkg/framework/core/allure_manager/manager/provider_test.go +++ b/pkg/framework/core/allure_manager/manager/provider_test.go @@ -215,7 +215,7 @@ func TestAllureManager_FinishTest(t *testing.T) { require.Len(t, emptyResult.Labels, 1) require.Equal(t, result.Labels[0].Name, emptyResult.Labels[0].Name) - require.Equal(t, result.Labels[0].Value, emptyResult.Labels[0].Value) + require.Equal(t, result.Labels[0].GetValue(), emptyResult.Labels[0].GetValue()) require.Equal(t, result.Start, emptyResult.Start) require.Equal(t, now, emptyResult.Stop) @@ -237,11 +237,11 @@ func TestAllureManager_NewTest(t *testing.T) { require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Suite)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Suite), 1) - require.Equal(t, "name", manager.testMeta.GetResult().GetLabels(allure.Suite)[0].Value) + require.Equal(t, "name", manager.testMeta.GetResult().GetLabels(allure.Suite)[0].GetValue()) require.NotEmpty(t, manager.testMeta.GetResult().GetLabels(allure.Package)) require.Len(t, manager.testMeta.GetResult().GetLabels(allure.Package), 1) - require.Equal(t, "PackageName", manager.testMeta.GetResult().GetLabels(allure.Package)[0].Value) + require.Equal(t, "PackageName", manager.testMeta.GetResult().GetLabels(allure.Package)[0].GetValue()) require.NotNil(t, manager.testMeta.GetContainer()) require.NotEmpty(t, manager.testMeta.GetContainer().Children) diff --git a/pkg/framework/go.mod b/pkg/framework/go.mod index 90b0df6..363ad7a 100644 --- a/pkg/framework/go.mod +++ b/pkg/framework/go.mod @@ -5,7 +5,7 @@ go 1.17 replace github.com/ozontech/allure-go/pkg/allure => ../allure require ( - github.com/ozontech/allure-go/pkg/allure v0.6.11 + github.com/ozontech/allure-go/pkg/allure v0.6.12 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.7.1 ) diff --git a/pkg/framework/runner/suite_runner.go b/pkg/framework/runner/suite_runner.go index 32fd9d6..114e379 100644 --- a/pkg/framework/runner/suite_runner.go +++ b/pkg/framework/runner/suite_runner.go @@ -150,14 +150,14 @@ func getParamTests(parentTest Test, params map[string]interface{}) map[string]Te suiteFullName = result.FullName ) if suite, ok := result.GetFirstLabel(allure.Suite); ok { - suiteName = suite.Value + suiteName = suite.GetValue() } if _package, ok := result.GetFirstLabel(allure.Package); ok { - packageName = _package.Value + packageName = _package.GetValue() } for _, tag := range result.GetLabels(allure.Tag) { - tags = append(tags, tag.Value) + tags = append(tags, tag.GetValue()) } for pName, param := range params {