Skip to content

Commit

Permalink
internal/civisibility: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo committed Oct 10, 2024
1 parent e23a490 commit 5391b19
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/civisibility/utils/ci_providers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ func TestTags(t *testing.T) {
}

func TestGitHubEventFile(t *testing.T) {
originalEventPath := os.Getenv("GITHUB_EVENT_PATH")
originalBaseRef := os.Getenv("GITHUB_BASE_REF")
defer func() {
os.Setenv("GITHUB_EVENT_PATH", originalEventPath)
os.Setenv("GITHUB_BASE_REF", originalBaseRef)
}()

os.Unsetenv("GITHUB_EVENT_PATH")
os.Unsetenv("GITHUB_BASE_REF")

checkValue := func(tags map[string]string, key, expectedValue string) {
if tags[key] != expectedValue {
t.Fatalf("Key: %s, the actual value (%s) is different to the expected value (%s)", key, tags[key], expectedValue)
Expand Down

0 comments on commit 5391b19

Please sign in to comment.