From 3a7bcc785b931a8c5a3f2adc93a75e96878e45ca Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Mon, 13 May 2024 11:19:53 +0200 Subject: [PATCH] test(pkg/ci): fixup tests by ignoring WorkflowSha field Signed-off-by: Leonardo Di Donato --- pkg/ci/env_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/ci/env_test.go b/pkg/ci/env_test.go index 01ecf890..70cb9001 100644 --- a/pkg/ci/env_test.go +++ b/pkg/ci/env_test.go @@ -57,7 +57,7 @@ func TestNewInfo_GitHubActionsPushEvent(t *testing.T) { Repo: "reviewdog", SHA: "febdd4bf26c6e8856c792303cfc66fa5e7bc975b", } - if diff := cmp.Diff(exp, got, cmpopts.IgnoreFields(Info{}, "EventName", "Action", "ActionPath", "ActionRepository", "Actor", "ActorID", "Job", "Ref", "RefName", "RefProtected", "RefType", "RepoFullName", "RepoID", "RepoOwner", "RepoOwnerID", "RunAttempt", "RunID", "RunNumber", "RunnerArch", "RunnerOs", "SeverURL", "TriggeringActor", "Workflow", "WorkflowRef", "Workspace")); diff != "" { + if diff := cmp.Diff(exp, got, cmpopts.IgnoreFields(Info{}, "EventName", "Action", "ActionPath", "ActionRepository", "Actor", "ActorID", "Job", "Ref", "RefName", "RefProtected", "RefType", "RepoFullName", "RepoID", "RepoOwner", "RepoOwnerID", "RunAttempt", "RunID", "RunNumber", "RunnerArch", "RunnerOs", "SeverURL", "TriggeringActor", "Workflow", "WorkflowRef", "WorkflowSha", "Workspace")); diff != "" { t.Errorf("info mismatch (-want +got):\n%s", diff) } @@ -88,7 +88,7 @@ func TestNewInfo_GitHubActionsPullRequestEvent(t *testing.T) { Num: 285, Branch: "go1.13", } - if diff := cmp.Diff(exp, got, cmpopts.IgnoreFields(Info{}, "EventName", "Action", "ActionPath", "ActionRepository", "Actor", "ActorID", "Job", "Ref", "RefName", "RefProtected", "RefType", "RepoFullName", "RepoID", "RepoOwner", "RepoOwnerID", "RunAttempt", "RunID", "RunNumber", "RunnerArch", "RunnerOs", "SeverURL", "TriggeringActor", "Workflow", "WorkflowRef", "Workspace")); diff != "" { + if diff := cmp.Diff(exp, got, cmpopts.IgnoreFields(Info{}, "EventName", "Action", "ActionPath", "ActionRepository", "Actor", "ActorID", "Job", "Ref", "RefName", "RefProtected", "RefType", "RepoFullName", "RepoID", "RepoOwner", "RepoOwnerID", "RunAttempt", "RunID", "RunNumber", "RunnerArch", "RunnerOs", "SeverURL", "TriggeringActor", "Workflow", "WorkflowRef", "WorkflowSha", "Workspace")); diff != "" { t.Errorf("info mismatch (-want +got):\n%s", diff) } @@ -122,7 +122,7 @@ func TestNewInfo_GitHubActionsPullRequestForkEvent(t *testing.T) { Branch: "build/pkg", Fork: true, } - if diff := cmp.Diff(exp, got, cmpopts.IgnoreFields(Info{}, "EventName", "Action", "ActionPath", "ActionRepository", "Actor", "ActorID", "Job", "Ref", "RefName", "RefProtected", "RefType", "RepoFullName", "RepoID", "RepoOwner", "RepoOwnerID", "RunAttempt", "RunID", "RunNumber", "RunnerArch", "RunnerOs", "SeverURL", "TriggeringActor", "Workflow", "WorkflowRef", "Workspace")); diff != "" { + if diff := cmp.Diff(exp, got, cmpopts.IgnoreFields(Info{}, "EventName", "Action", "ActionPath", "ActionRepository", "Actor", "ActorID", "Job", "Ref", "RefName", "RefProtected", "RefType", "RepoFullName", "RepoID", "RepoOwner", "RepoOwnerID", "RunAttempt", "RunID", "RunNumber", "RunnerArch", "RunnerOs", "SeverURL", "TriggeringActor", "Workflow", "WorkflowRef", "WorkflowSha", "Workspace")); diff != "" { t.Errorf("info mismatch (-want +got):\n%s", diff) } @@ -156,7 +156,7 @@ func TestNewInfo_GitHubActionsReRunEvent(t *testing.T) { Num: 286, Branch: "github-actions-env", } - if diff := cmp.Diff(exp, got, cmpopts.IgnoreFields(Info{}, "EventName", "Action", "ActionPath", "ActionRepository", "Actor", "ActorID", "Job", "Ref", "RefName", "RefProtected", "RefType", "RepoFullName", "RepoID", "RepoOwner", "RepoOwnerID", "RunAttempt", "RunID", "RunNumber", "RunnerArch", "RunnerOs", "SeverURL", "TriggeringActor", "Workflow", "WorkflowRef", "Workspace")); diff != "" { + if diff := cmp.Diff(exp, got, cmpopts.IgnoreFields(Info{}, "EventName", "Action", "ActionPath", "ActionRepository", "Actor", "ActorID", "Job", "Ref", "RefName", "RefProtected", "RefType", "RepoFullName", "RepoID", "RepoOwner", "RepoOwnerID", "RunAttempt", "RunID", "RunNumber", "RunnerArch", "RunnerOs", "SeverURL", "TriggeringActor", "Workflow", "WorkflowRef", "WorkflowSha", "Workspace")); diff != "" { t.Errorf("info mismatch (-want +got):\n%s", diff) }