From 34b9d5c997038d93c9fc441db5c3228142320792 Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Thu, 25 Mar 2021 23:48:53 -0400 Subject: [PATCH] ci: deprecate AppVoyer integration (#128) With the migration to GitHub Action, there's no need to continue to use AppVoyer to only test on Windows, as it's covered by corresponding new jobs. Signed-off-by: Khosrow Moossavi --- .appveyor.yml | 21 --------------------- .github/workflows/test.yml | 2 -- chglog_test.go | 31 +++++++++++++++++++------------ 3 files changed, 19 insertions(+), 35 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index d7176220..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: "{build}" - -clone_depth: 1 -clone_folder: c:\gopath\src\github.com\git-chglog\git-chglog - -environment: - GOPATH: c:\gopath - -install: - - echo %PATH% - - echo %GOPATH% - - go version - - go env - - set PATH=%PATH%;%GOPATH%\bin - -test_script: - - go build github.com/git-chglog/git-chglog/cmd/git-chglog - - for /f "" %%G in ('go list github.com/git-chglog/git-chglog/...') do ( go test -v %%G & IF ERRORLEVEL == 1 EXIT 1) - -build: off -deploy: off diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7f9c396..3327c1ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,6 @@ on: jobs: unit: runs-on: ubuntu-20.04 - strategy: - fail-fast: true steps: - name: Checkout uses: actions/checkout@v2 diff --git a/chglog_test.go b/chglog_test.go index 864a7434..969ee3b7 100644 --- a/chglog_test.go +++ b/chglog_test.go @@ -89,9 +89,11 @@ func TestGeneratorNotFoundTags(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "") + expected := strings.TrimSpace(buf.String()) + assert.Error(err) assert.Contains(err.Error(), "git-tag does not exist") - assert.Equal("", buf.String()) + assert.Equal("", expected) } func TestGeneratorNotFoundCommits(t *testing.T) { @@ -116,8 +118,10 @@ func TestGeneratorNotFoundCommits(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "foo") + expected := strings.TrimSpace(buf.String()) + assert.Error(err) - assert.Equal("", buf.String()) + assert.Equal("", expected) } func TestGeneratorNotFoundCommitsOne(t *testing.T) { @@ -171,9 +175,11 @@ func TestGeneratorNotFoundCommitsOne(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "foo") + expected := strings.TrimSpace(buf.String()) + assert.Error(err) assert.Contains(err.Error(), "\"foo\" was not found") - assert.Equal("", buf.String()) + assert.Equal("", expected) } func TestGeneratorWithTypeScopeSubject(t *testing.T) { @@ -257,7 +263,7 @@ change message.`) buf := &bytes.Buffer{} err := gen.Generate(buf, "") - output := strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") + expected := strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -303,7 +309,7 @@ Online breaking change message. [Unreleased]: https://github.com/git-chglog/git-chglog/compare/2.0.0-beta.0...HEAD [2.0.0-beta.0]: https://github.com/git-chglog/git-chglog/compare/1.1.0...2.0.0-beta.0 -[1.1.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...1.1.0`, output) +[1.1.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...1.1.0`, expected) } func TestGeneratorWithNextTag(t *testing.T) { @@ -354,7 +360,7 @@ func TestGeneratorWithNextTag(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "") - output := strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") + expected := strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -381,11 +387,11 @@ func TestGeneratorWithNextTag(t *testing.T) { [Unreleased]: https://github.com/git-chglog/git-chglog/compare/3.0.0...HEAD [3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0 -[2.0.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...2.0.0`, output) +[2.0.0]: https://github.com/git-chglog/git-chglog/compare/1.0.0...2.0.0`, expected) buf = &bytes.Buffer{} err = gen.Generate(buf, "3.0.0") - output = strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") + expected = strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -399,7 +405,7 @@ func TestGeneratorWithNextTag(t *testing.T) { [Unreleased]: https://github.com/git-chglog/git-chglog/compare/3.0.0...HEAD -[3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0`, output) +[3.0.0]: https://github.com/git-chglog/git-chglog/compare/2.0.0...3.0.0`, expected) } func TestGeneratorWithTagFiler(t *testing.T) { @@ -447,6 +453,7 @@ func TestGeneratorWithTagFiler(t *testing.T) { buf := &bytes.Buffer{} err := gen.Generate(buf, "") + expected := strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -460,7 +467,7 @@ func TestGeneratorWithTagFiler(t *testing.T) { - **core:** version dev-1.0.0 -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v1.0.0...HEAD`, strings.TrimSpace(buf.String())) +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/v1.0.0...HEAD`, expected) } @@ -520,7 +527,7 @@ Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users. buf := &bytes.Buffer{} err := gen.Generate(buf, "") - output := strings.ReplaceAll(strings.TrimSpace(buf.String()), "\r\n", "\n") + expected := strings.TrimSpace(buf.String()) assert.Nil(err) assert.Equal(` @@ -540,5 +547,5 @@ Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users. When using .TrimmedBody Notes are not included and can only appear in the Notes section. -[Unreleased]: https://github.com/git-chglog/git-chglog/compare/1.0.0...HEAD`, output) +[Unreleased]: https://github.com/git-chglog/git-chglog/compare/1.0.0...HEAD`, expected) }