Skip to content

Commit

Permalink
test(pkg/ci): fixup tests by ignoring WorkflowSha field
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Donato <[email protected]>
  • Loading branch information
leodido committed May 13, 2024
1 parent 2210ed7 commit 3a7bcc7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/ci/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 3a7bcc7

Please sign in to comment.