Repository: goreleaser/goreleaser
Pull request #3222 (2022-07-04 18:22:30)

test: reducing test ouput
there is too much going on in our test logs, and we have a lot of tests.. so... its too much output to scroll over/read/etc.

Trying to reduce it to the necessary only.

codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/3222?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) Report
> Merging [#3222](https://codecov.io/gh/goreleaser/goreleaser/pull/3222?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (514e94f) into [main](https://codecov.io/gh/goreleaser/goreleaser/commit/c431afb985620ea8502072718988324b3ea5eea2?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (c431afb) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##             main    #3222   +/-   ##
=======================================
  Coverage   84.30%   84.30%           
=======================================
  Files         115      115           
  Lines        9326     9326           
=======================================
  Hits         7862     7862           
  Misses       1183     1183           
  Partials      281      281           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/3222?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/3222?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Last update [c431afb...514e94f](https://codecov.io/gh/goreleaser/goreleaser/pull/3222?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).


Patch:
diff --git a/cmd/root.go b/cmd/root.go
index 4b1f897e..0764405e 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -3,23 +3,17 @@ package cmd
 import (
 	"errors"
 	"fmt"
-	"os"
 	"time"
 
 	"github.com/caarlos0/log"
 	"github.com/charmbracelet/lipgloss"
 	"github.com/goreleaser/goreleaser/pkg/context"
-	"github.com/muesli/termenv"
 	"github.com/spf13/cobra"
 )
 
 var boldStyle = lipgloss.NewStyle().Bold(true)
 
 func Execute(version string, exit func(int), args []string) {
-	// enable colored output on travis
-	if os.Getenv("CI") != "" {
-		lipgloss.SetColorProfile(termenv.ANSI256)
-	}
 	newRootCmd(version, exit).Execute(args)
 }
 
diff --git a/go.mod b/go.mod
index cadfcb11..41aa39fd 100644
--- a/go.mod
+++ b/go.mod
@@ -11,9 +11,9 @@ require (
 	github.com/caarlos0/env/v6 v6.9.3
 	github.com/caarlos0/go-reddit/v3 v3.0.1
 	github.com/caarlos0/go-shellwords v1.0.12
-	github.com/caarlos0/log v0.1.0
+	github.com/caarlos0/log v0.1.1
 	github.com/charmbracelet/keygen v0.3.0
-	github.com/charmbracelet/lipgloss v0.5.1-0.20220604171933-77aae4ab0bf5
+	github.com/charmbracelet/lipgloss v0.5.1-0.20220615005615-2e17a8a06096
 	github.com/dghubble/go-twitter v0.0.0-20211115160449-93a8679adecb
 	github.com/dghubble/oauth1 v0.7.1
 	github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
@@ -28,7 +28,7 @@ require (
 	github.com/mitchellh/go-homedir v1.1.0
 	github.com/muesli/mango-cobra v1.2.0
 	github.com/muesli/roff v0.1.0
-	github.com/muesli/termenv v0.12.1-0.20220606102431-9500d1649068
+	github.com/muesli/termenv v0.12.1-0.20220615005108-4e9068de9898
 	github.com/slack-go/slack v0.11.0
 	github.com/spf13/cobra v1.5.0
 	github.com/stretchr/testify v1.8.0
diff --git a/go.sum b/go.sum
index 0537b996..42752b39 100644
--- a/go.sum
+++ b/go.sum
@@ -204,8 +204,8 @@ github.com/caarlos0/go-reddit/v3 v3.0.1/go.mod h1:QlwgmG5SAqxMeQvg/A2dD1x9cIZCO5
 github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11 h1:IRrDwVlWQr6kS1U8/EtyA1+EHcc4yl8pndcqXWrEamg=
 github.com/caarlos0/go-shellwords v1.0.12 h1:HWrUnu6lGbWfrDcFiHcZiwOLzHWjjrPVehULaTFgPp8=
 github.com/caarlos0/go-shellwords v1.0.12/go.mod h1:bYeeX1GrTLPl5cAMYEzdm272qdsQAZiaHgeF0KTk1Gw=
-github.com/caarlos0/log v0.1.0 h1:Y0QiCN6KiJ1N9Aa6OnWJI9A4Xa7Fv88Wd1J04G74wfE=
-github.com/caarlos0/log v0.1.0/go.mod h1:tnVRnjHtFPOMNYk6qiJA6tRC47MTXI+BEly06yVgcP4=
+github.com/caarlos0/log v0.1.1 h1:eVk0VPVXKB3nk18Gpj+LUZq81ojOamVQebt9wlf2VY4=
+github.com/caarlos0/log v0.1.1/go.mod h1:lYxaBNu0NYLm5tdxBysIb2LNhNUUFqNAzSHNu737Loo=
 github.com/caarlos0/sshmarshal v0.0.0-20220308164159-9ddb9f83c6b3 h1:w2ANoiT4ubmh4Nssa3/QW1M7lj3FZkma8f8V5aBDxXM=
 github.com/caarlos0/sshmarshal v0.0.0-20220308164159-9ddb9f83c6b3/go.mod h1:7Pd/0mmq9x/JCzKauogNjSQEhivBclCQHfr9dlpDIyA=
 github.com/caarlos0/testfs v0.4.4 h1:3PHvzHi5Lt+g332CiShwS8ogTgS3HjrmzZxCm6JCDr8=
@@ -219,8 +219,8 @@ github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA
 github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
 github.com/charmbracelet/keygen v0.3.0 h1:mXpsQcH7DDlST5TddmXNXjS0L7ECk4/kLQYyBcsan2Y=
 github.com/charmbracelet/keygen v0.3.0/go.mod h1:1ukgO8806O25lUZ5s0IrNur+RlwTBERlezdgW71F5rM=
-github.com/charmbracelet/lipgloss v0.5.1-0.20220604171933-77aae4ab0bf5 h1:FHeFmaVqTDMJSzaIYT8Dk4MjY8idNhO/+RWq5eITRFU=
-github.com/charmbracelet/lipgloss v0.5.1-0.20220604171933-77aae4ab0bf5/go.mod h1:zVjS7jlggirpJYwsdaMKFhT+0Y1pFdQGS9x7GIz9ov4=
+github.com/charmbracelet/lipgloss v0.5.1-0.20220615005615-2e17a8a06096 h1:ai19sA3Zyg3DARevWCbdLOWt+MfWiE3e8voBqzFOgP8=
+github.com/charmbracelet/lipgloss v0.5.1-0.20220615005615-2e17a8a06096/go.mod h1:D7uPgcyfB9T1Ug2mfJOnES17o47nz5oqIzSSVrpcviU=
 github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
 github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
@@ -569,9 +569,8 @@ github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 h1:y1p/ycavWjGT9Fn
 github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ=
 github.com/muesli/roff v0.1.0 h1:YD0lalCotmYuF5HhZliKWlIx7IEhiXeSfq7hNjFqGF8=
 github.com/muesli/roff v0.1.0/go.mod h1:pjAHQM9hdUUwm/krAfrLGgJkXJ+YuhtsfZ42kieB2Ig=
-github.com/muesli/termenv v0.12.1-0.20220604163637-eddc39a244f4/go.mod h1:bN6sPNtkiahdhHv2Xm6RGU16LSCxfbIZvMfqjOCfrR4=
-github.com/muesli/termenv v0.12.1-0.20220606102431-9500d1649068 h1:Tg+qMMarOW1WJTM6xh8GweXRIvByM4Mtj6QTO6SB7EI=
-github.com/muesli/termenv v0.12.1-0.20220606102431-9500d1649068/go.mod h1:bN6sPNtkiahdhHv2Xm6RGU16LSCxfbIZvMfqjOCfrR4=
+github.com/muesli/termenv v0.12.1-0.20220615005108-4e9068de9898 h1:0j+cbZdhLgpNxjg0nWCasHUA82fgWOXxxGgWNVOLS1I=
+github.com/muesli/termenv v0.12.1-0.20220615005108-4e9068de9898/go.mod h1:bN6sPNtkiahdhHv2Xm6RGU16LSCxfbIZvMfqjOCfrR4=
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
 github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
diff --git a/internal/middleware/errhandler/error.go b/internal/middleware/errhandler/error.go
index f1a4e388..54d6ad9a 100644
--- a/internal/middleware/errhandler/error.go
+++ b/internal/middleware/errhandler/error.go
@@ -16,7 +16,7 @@ func Handle(action middleware.Action) middleware.Action {
 			return nil
 		}
 		if pipe.IsSkip(err) {
-			log.WithError(err).Warn("pipe skipped")
+			log.WithField("reason", err.Error()).Warn("pipe skipped")
 			return nil
 		}
 		return err


Test patch:
diff --git a/internal/logext/testdata/TestWriter/debug/0.txt.golden b/internal/logext/testdata/TestWriter/debug/0.txt.golden
index b4fc328c..3647ff9e 100644
--- a/internal/logext/testdata/TestWriter/debug/0.txt.golden
+++ b/internal/logext/testdata/TestWriter/debug/0.txt.golden
@@ -1,2 +1,2 @@
-    • foo                           foo=bar
-    • bar                           foo=bar
+    • foo                                            foo=bar
+    • bar                                            foo=bar
diff --git a/internal/logext/testdata/TestWriter/debug/1.txt.golden b/internal/logext/testdata/TestWriter/debug/1.txt.golden
index b4fc328c..3647ff9e 100644
--- a/internal/logext/testdata/TestWriter/debug/1.txt.golden
+++ b/internal/logext/testdata/TestWriter/debug/1.txt.golden
@@ -1,2 +1,2 @@
-    • foo                           foo=bar
-    • bar                           foo=bar
+    • foo                                            foo=bar
+    • bar                                            foo=bar
diff --git a/internal/logext/writer_test.go b/internal/logext/writer_test.go
index ca810ce8..b8f31d1f 100644
--- a/internal/logext/writer_test.go
+++ b/internal/logext/writer_test.go
@@ -7,11 +7,15 @@ import (
 	"testing"
 
 	"github.com/caarlos0/log"
+	"github.com/charmbracelet/lipgloss"
 	"github.com/goreleaser/goreleaser/internal/golden"
+	"github.com/muesli/termenv"
 	"github.com/stretchr/testify/require"
 )
 
 func TestWriter(t *testing.T) {
+	lipgloss.SetColorProfile(termenv.Ascii)
+
 	t.Run("info", func(t *testing.T) {
 		for _, out := range []Output{Info, Error} {
 			t.Run(strconv.Itoa(int(out)), func(t *testing.T) {
diff --git a/internal/pipe/git/git_test.go b/internal/pipe/git/git_test.go
index 49e4789c..aae13aef 100644
--- a/internal/pipe/git/git_test.go
+++ b/internal/pipe/git/git_test.go
@@ -37,7 +37,7 @@ func TestSingleCommit(t *testing.T) {
 }
 
 func TestAnnotatedTags(t *testing.T) {
-	t.Log(testlib.Mktmp(t))
+	testlib.Mktmp(t)
 	testlib.GitInit(t)
 	testlib.GitRemoteAdd(t, "git@github.com:foo/bar.git")
 	testlib.GitCommit(t, "commit1")
diff --git a/internal/pipe/universalbinary/universalbinary_test.go b/internal/pipe/universalbinary/universalbinary_test.go
index 7961a207..b5dd59f2 100644
--- a/internal/pipe/universalbinary/universalbinary_test.go
+++ b/internal/pipe/universalbinary/universalbinary_test.go
@@ -206,8 +206,7 @@ func TestRun(t *testing.T) {
 	for arch, path := range paths {
 		cmd := exec.Command("go", "build", "-o", path, src)
 		cmd.Env = append(os.Environ(), "GOOS=darwin", "GOARCH="+arch)
-		out, err := cmd.CombinedOutput()
-		t.Log(string(out))
+		_, err := cmd.CombinedOutput()
 		require.NoError(t, err)
 
 		modTime := time.Unix(0, 0)
diff --git a/pkg/archive/tar/tar_test.go b/pkg/archive/tar/tar_test.go
index b635d5c5..7b602dae 100644
--- a/pkg/archive/tar/tar_test.go
+++ b/pkg/archive/tar/tar_test.go
@@ -82,7 +82,6 @@ func TestTarFile(t *testing.T) {
 		}
 		require.NoError(t, err)
 		paths = append(paths, next.Name)
-		t.Logf("%s: %v", next.Name, next.FileInfo().Mode())
 		if next.Name == "sub1/executable" {
 			ex := next.FileInfo().Mode() | 0o111
 			require.Equal(t, next.FileInfo().Mode().String(), ex.String())
diff --git a/pkg/archive/tarxz/tarxz_test.go b/pkg/archive/tarxz/tarxz_test.go
index 59125bea..00293753 100644
--- a/pkg/archive/tarxz/tarxz_test.go
+++ b/pkg/archive/tarxz/tarxz_test.go
@@ -86,7 +86,6 @@ func TestTarXzFile(t *testing.T) {
 		}
 		require.NoError(t, err)
 		paths = append(paths, next.Name)
-		t.Logf("%s: %v", next.Name, next.FileInfo().Mode())
 		if next.Name == "sub1/executable" {
 			ex := next.FileInfo().Mode() | 0o111
 			require.Equal(t, next.FileInfo().Mode().String(), ex.String())
diff --git a/pkg/archive/zip/zip_test.go b/pkg/archive/zip/zip_test.go
index 464e6058..1d5d3840 100644
--- a/pkg/archive/zip/zip_test.go
+++ b/pkg/archive/zip/zip_test.go
@@ -79,7 +79,6 @@ func TestZipFile(t *testing.T) {
 	paths := make([]string, len(r.File))
 	for i, zf := range r.File {
 		paths[i] = zf.Name
-		t.Logf("%s: %v", zf.Name, zf.Mode())
 		if zf.Name == "sub1/executable" {
 			ex := zf.Mode() | 0o111
 			require.Equal(t, zf.Mode().String(), ex.String())