From 924a75cb2d12f04c0ca9e7f959334d74b8abc172 Mon Sep 17 00:00:00 2001 From: Richard Dawe Date: Mon, 8 Jul 2024 17:41:12 +0100 Subject: [PATCH 1/4] Rename the module for the Customer.io fork --- approvals.go | 4 ++-- approvals_test.go | 2 +- examples_helper_test.go | 2 +- examples_test.go | 2 +- go.mod | 2 +- reporter_test.go | 4 ++-- reporters/diff_reporter.go | 2 +- reporters/quiet.go | 2 +- reporters/real_diff_reporter.go | 2 +- reporters/reporter_test.go | 2 +- scrubber_test.go | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/approvals.go b/approvals.go index edcdf70..1beb48b 100644 --- a/approvals.go +++ b/approvals.go @@ -11,8 +11,8 @@ import ( "regexp" "strings" - "github.com/approvals/go-approval-tests/reporters" - "github.com/approvals/go-approval-tests/utils" + "github.com/customerio/go-approval-tests/reporters" + "github.com/customerio/go-approval-tests/utils" ) var ( diff --git a/approvals_test.go b/approvals_test.go index 0ebba0d..4e0d048 100644 --- a/approvals_test.go +++ b/approvals_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/approvals/go-approval-tests/reporters" + "github.com/customerio/go-approval-tests/reporters" ) func TestMain(m *testing.M) { diff --git a/examples_helper_test.go b/examples_helper_test.go index 4e92fd1..c378489 100644 --- a/examples_helper_test.go +++ b/examples_helper_test.go @@ -7,7 +7,7 @@ import ( "log" "strings" - approvals "github.com/approvals/go-approval-tests" + approvals "github.com/customerio/go-approval-tests" ) var ( diff --git a/examples_test.go b/examples_test.go index f02492a..7a207a3 100644 --- a/examples_test.go +++ b/examples_test.go @@ -1,7 +1,7 @@ package approvals_test import ( - approvals "github.com/approvals/go-approval-tests" + approvals "github.com/customerio/go-approval-tests" ) func ExampleVerifyString() { diff --git a/go.mod b/go.mod index c568e78..19b37f9 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/approvals/go-approval-tests +module github.com/customerio/go-approval-tests go 1.12 diff --git a/reporter_test.go b/reporter_test.go index 9d00492..9bad9e4 100644 --- a/reporter_test.go +++ b/reporter_test.go @@ -4,8 +4,8 @@ import ( "os" "testing" - "github.com/approvals/go-approval-tests/reporters" - "github.com/approvals/go-approval-tests/utils" + "github.com/customerio/go-approval-tests/reporters" + "github.com/customerio/go-approval-tests/utils" ) // TestFailable is a fake replacing testing.T diff --git a/reporters/diff_reporter.go b/reporters/diff_reporter.go index f2fb693..1c7387e 100644 --- a/reporters/diff_reporter.go +++ b/reporters/diff_reporter.go @@ -3,7 +3,7 @@ package reporters import ( "os/exec" - "github.com/approvals/go-approval-tests/utils" + "github.com/customerio/go-approval-tests/utils" ) // NewFrontLoadedReporter creates the default front loaded reporter. diff --git a/reporters/quiet.go b/reporters/quiet.go index 8d38bbf..cd9f359 100644 --- a/reporters/quiet.go +++ b/reporters/quiet.go @@ -4,7 +4,7 @@ import ( "fmt" "path/filepath" - "github.com/approvals/go-approval-tests/utils" + "github.com/customerio/go-approval-tests/utils" ) type quiet struct{} diff --git a/reporters/real_diff_reporter.go b/reporters/real_diff_reporter.go index 20e17cf..46abe10 100644 --- a/reporters/real_diff_reporter.go +++ b/reporters/real_diff_reporter.go @@ -4,7 +4,7 @@ import ( "os" "os/exec" - "github.com/approvals/go-approval-tests/utils" + "github.com/customerio/go-approval-tests/utils" ) type realDiff struct{} diff --git a/reporters/reporter_test.go b/reporters/reporter_test.go index ccaaaf6..fc6aa56 100644 --- a/reporters/reporter_test.go +++ b/reporters/reporter_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/approvals/go-approval-tests/utils" + "github.com/customerio/go-approval-tests/utils" ) type testReporter struct { diff --git a/scrubber_test.go b/scrubber_test.go index b94beb4..b579c0a 100644 --- a/scrubber_test.go +++ b/scrubber_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - approvals "github.com/approvals/go-approval-tests" + approvals "github.com/customerio/go-approval-tests" ) func TestVerifyDoesNotAcceptSeveralVerifyOptions(t *testing.T) { From 441580b2a2e8ad097b7b6846e6405f7bbfc081e1 Mon Sep 17 00:00:00 2001 From: Richard Dawe Date: Tue, 9 Jul 2024 10:39:50 +0100 Subject: [PATCH 2/4] Document the reasons for this fork --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 31110c3..785970b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +# Fork of go-approval-tests + +This fork incorporates https://github.com/approvals/go-approval-tests/pull/41 , which has not been accepted yet by upstream. Once/if that PR is accepted, and merged, users of this fork can go back to using the original go-approval-tests. + +This fork renames the module to `customerio/go-approval-tests`. This avoids the use of `replace` directives in `go.mod`, which for modules that depend on other modules using `replace`. + +--- + # ApprovalTests.go ApprovalTests for [go](https://golang.org/) From 391928250c2e9fd3058edf166a21045b064d4a03 Mon Sep 17 00:00:00 2001 From: Richard Dawe Date: Tue, 9 Jul 2024 10:43:45 +0100 Subject: [PATCH 3/4] Update build-and-test workflow --- .github/workflows/test.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a78a1ab..da00f84 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,23 +3,31 @@ name: Build and Test on: push: + branches: + - main pull_request: - repository_dispatch: - schedule: - - cron: '05 5 1 * *' # - "At 05:05 on day-of-month 1" +# repository_dispatch: +# schedule: +# - cron: '05 5 1 * *' # - "At 05:05 on day-of-month 1" jobs: build-and-test: - runs-on: windows-latest + runs-on: +# - windows-latest + - self-hosted + - ephemeral steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Go environment - uses: actions/setup-go@v2.2.0 + uses: actions/setup-go@v5 + with: + go-version: 1.22.3 + cache: false - name: Build run: go build -v ./... From 2d09f3e5b35a9d68d17c031ce4ffb92e5281b1eb Mon Sep 17 00:00:00 2001 From: Richard Dawe Date: Tue, 9 Jul 2024 13:15:27 +0100 Subject: [PATCH 4/4] Use a public Ubuntu runner --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da00f84..19485b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,9 +16,8 @@ jobs: build-and-test: runs-on: # - windows-latest - - self-hosted - - ephemeral - + - ubuntu-latest + steps: - name: Checkout uses: actions/checkout@v4