diff --git a/.gotestfmt/downloads.gotpl b/.gotestfmt/downloads.gotpl index 14c7499..806978b 100644 --- a/.gotestfmt/downloads.gotpl +++ b/.gotestfmt/downloads.gotpl @@ -3,7 +3,7 @@ This template contains the format for a package download. */ -}} {{- $settings := .Settings -}} -{{- if .Packages -}} +{{- if or .Packages .Reason -}} {{- if or (not $settings.HideSuccessfulDownloads) .Failed -}} {{- if .Failed -}} {{ "\033" }}[0;31m❌ @@ -31,4 +31,7 @@ This template contains the format for a package download. {{- end -}} {{- end -}} {{- end -}} + {{- with .Reason -}} + {{- " " -}}{{- "\033" }}[0;31m🛑 {{ . }}{{- "\033" }}[0m{{ "\n" -}} + {{- end -}} {{- end -}} \ No newline at end of file diff --git a/.gotestfmt/github/downloads.gotpl b/.gotestfmt/github/downloads.gotpl index db60fc6..8ac3628 100644 --- a/.gotestfmt/github/downloads.gotpl +++ b/.gotestfmt/github/downloads.gotpl @@ -3,7 +3,7 @@ This template contains the format for a package download. */ -}} {{- $settings := .Settings -}} -{{- if .Packages -}} +{{- if or .Packages .Reason -}} {{- if or (not .Settings.HideSuccessfulDownloads) .Failed -}} ::group:: {{- if .Failed -}} @@ -31,6 +31,9 @@ This template contains the format for a package download. {{- end -}} {{- end -}} {{- end -}} + {{- with .Reason -}} + {{- " " -}}{{- "\033" }}[0;31m🛑 {{ . }}{{- "\033" }}[0m{{ "\n" -}} + {{- end -}} ::endgroup:: {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/.gotestfmt/gitlab/downloads.gotpl b/.gotestfmt/gitlab/downloads.gotpl index bd695b6..d043ddb 100644 --- a/.gotestfmt/gitlab/downloads.gotpl +++ b/.gotestfmt/gitlab/downloads.gotpl @@ -3,7 +3,7 @@ This template contains the format for a package download. */ -}} {{- $settings := .Settings -}} -{{- if .Packages -}} +{{- if or .Packages .Reason -}} {{- if or (not .Settings.HideSuccessfulDownloads) .Failed -}} {{- "\033" }}[0Ksection_start:{{ with .StartTime }}{{ .Unix }}{{ else }}0{{ end }}:dependency_downloads{{ "\r\033" }}[0K{{- "\n" -}} {{- if .Failed -}} @@ -31,6 +31,9 @@ This template contains the format for a package download. {{- end -}} {{- end -}} {{- end -}} - {{- "\033" }}[0Ksection_start:{{ with .EndTime }}{{ .Unix }}{{ else }}0{{ end }}:dependency_downloads{{ "\r\033" }}[0K{{- "\n" -}} + {{- with .Reason -}} + {{- " " -}}{{- "\033" }}[0;31m🛑 {{ . }}{{- "\033" }}[0m{{ "\n" -}} + {{- end -}} + {{- "\033" }}[0Ksection_end:{{ with .EndTime }}{{ .Unix }}{{ else }}0{{ end }}:dependency_downloads{{ "\r\033" }}[0K{{- "\n" -}} {{- end -}} {{- end -}} \ No newline at end of file diff --git a/.gotestfmt/teamcity/downloads.gotpl b/.gotestfmt/teamcity/downloads.gotpl index 898646d..b71c364 100644 --- a/.gotestfmt/teamcity/downloads.gotpl +++ b/.gotestfmt/teamcity/downloads.gotpl @@ -3,7 +3,7 @@ This template contains the format for a package download. */ -}} {{- $settings := .Settings -}} -{{- if .Packages -}} +{{- if or .Packages .Reason -}} {{- if or (not $settings.HideSuccessfulDownloads) .Failed -}} {{- $title := "Dependency downloads" -}} {{- if .Failed -}} @@ -11,8 +11,7 @@ This template contains the format for a package download. {{- else -}} {{- $title = print "📥 " $title -}} {{- end -}} - ##teamcity[blockOpened name='{{ $title }}'] - + ##teamcity[blockOpened name='{{ $title }}']{{ "\n" -}} {{- range .Packages -}} {{- if or (not $settings.HideSuccessfulDownloads) .Failed -}} {{- " " -}} @@ -29,6 +28,9 @@ This template contains the format for a package download. {{- end -}} {{- end -}} {{- end -}} + {{- with .Reason -}} + {{- " " -}}🛑 {{ . }}{{ "\n" -}} + {{- end -}} ##teamcity[blockClosed name='{{ $title }}'] {{- end -}} {{- end -}} \ No newline at end of file diff --git a/README.md b/README.md index 04c38ce..bc3e58a 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,7 @@ This file contains the output fragment showing the package downloads in the Go t | `.Packages` | `[]Package` | A list of packages that have been processed. | | `.StartTime` | `*time.Time` | The time the first download line was seen. May be empty. | | `.EndTime` | `*time.Time` | The time the last download line was seen. May be empty. | +| `.Reason` | `string` | If an extra reason is given for the failure, the text is included here. | | `.Settings` | [`RenderSettings`](#render-settings) | The render settings (what to hide, etc, [see below](#render-settings)). | The `Package` items have the following format: diff --git a/parser/model.go b/parser/model.go index 0fd9be7..f9110cf 100644 --- a/parser/model.go +++ b/parser/model.go @@ -90,6 +90,7 @@ func (p *Package) ID() string { ) } +// Download is the download information about a single package. type Download struct { // Package is the name of the package being downloaded. Package string `json:"package"` @@ -111,6 +112,8 @@ type Downloads struct { StartTime *time.Time `json:"-"` // EndTime indicates when the downloads finished. EndTime *time.Time `json:"-"` + // Reason describes the failure reason if a separate one is present. + Reason string `json:"reason"` } // ParseResult is an overall structure for parser results, containing the prefix text, downloads and packagesByName. diff --git a/parser/parse.go b/parser/parse.go index db63bb3..f047b3d 100644 --- a/parser/parse.go +++ b/parser/parse.go @@ -21,28 +21,32 @@ func Parse( ) (<-chan string, <-chan *Downloads, <-chan *Package) { prefixChannel := make(chan string) downloadsChannel := make(chan *Downloads) + downloadsFailureReason := make(chan string) packagesChannel := make(chan *Package) - go parse(evts, prefixChannel, downloadsChannel, packagesChannel) + go parse(evts, prefixChannel, downloadsChannel, downloadsFailureReason, packagesChannel) return prefixChannel, downloadsChannel, packagesChannel } var downloadErrors = []*regexp.Regexp{ regexp.MustCompile(`no required module provides package (?P[^\s]+);`), + regexp.MustCompile(`updates to go.mod needed; to update it:`), } func parse( evts <-chan tokenizer.Event, prefixChannel chan string, downloadsChannel chan *Downloads, + downloadsFailureReason chan string, packagesChannel chan *Package, ) { outputStarted := false downloadTracker := &downloadsTracker{ - prefixChannel: prefixChannel, - downloadResultsList: nil, - downloadsByPackage: map[string]*Download{}, - downloadsFinished: false, - target: downloadsChannel, + prefixChannel: prefixChannel, + downloadResultsList: nil, + downloadsByPackage: map[string]*Download{}, + downloadsFinished: false, + downloadsFailureReason: downloadsFailureReason, + target: downloadsChannel, } pkgTracker := &packageTracker{ packagesByName: map[string]*Package{}, @@ -131,17 +135,26 @@ func parse( foundDLError := false for _, dlError := range downloadErrors { if submatch := dlError.FindSubmatch(evt.Output); len(submatch) > 0 { - pkgName := string(submatch[1]) - downloadTracker.SetDownloadFailed(pkgName, "") - downloadTracker.AddReason(pkgName, evt.Output) - prevErroredDownload = pkgName + if len(submatch) > 1 { + pkgName := string(submatch[1]) + downloadTracker.SetDownloadFailed(pkgName, "") + downloadTracker.AddReason(pkgName, evt.Output) + prevErroredDownload = pkgName + } else { + downloadTracker.SetFailureReason(submatch[0]) + prevErroredDownload = "*" + } foundDLError = true outputStarted = true } } if !foundDLError { if prevErroredDownload != "" { - downloadTracker.AddReason(prevErroredDownload, evt.Output) + if prevErroredDownload == "*" { + downloadTracker.SetFailureReason(evt.Output) + } else { + downloadTracker.AddReason(prevErroredDownload, evt.Output) + } } else if prevErroredPkg != "" { pkgTracker.AddOutput(prevErroredPkg, "", evt.Output) } else if !outputStarted { @@ -341,14 +354,16 @@ func compareTestCaseNames(name1 string, name2 string) bool { } type downloadsTracker struct { - downloadResultsList []*Download - downloadsByPackage map[string]*Download - downloadsFinished bool - lastDownload *Download - target chan *Downloads - prefixChannel chan string - startTime *time.Time - endTime *time.Time + downloadResultsList []*Download + downloadsByPackage map[string]*Download + downloadsFinished bool + lastDownload *Download + target chan *Downloads + prefixChannel chan string + startTime *time.Time + endTime *time.Time + downloadsFailureReason chan string + failureReason []byte } func (d *downloadsTracker) Add(name string, version string) { @@ -379,11 +394,15 @@ func (d *downloadsTracker) Write() { } dl.Reason = strings.TrimRight(dl.Reason, "\n") } + if len(d.failureReason) > 0 { + failed = true + } d.target <- &Downloads{ Packages: d.downloadResultsList, Failed: failed, StartTime: d.startTime, EndTime: d.endTime, + Reason: strings.TrimSpace(string(d.failureReason)), } d.downloadsFinished = true d.downloadResultsList = nil @@ -424,3 +443,10 @@ func (d *downloadsTracker) AddReason(name string, output []byte) { pkg := d.ensurePackage(name) pkg.Reason = pkg.Reason + string(output) + "\n" } + +func (d *downloadsTracker) SetFailureReason(output []byte) { + if d.downloadsFinished { + panic(fmt.Errorf("tried to add download failure reason after downloads are already finished")) + } + d.failureReason = append(append(d.failureReason, output...), '\n') +} diff --git a/testdata/issue-21.parser.json b/testdata/issue-21.parser.json new file mode 100644 index 0000000..29eb33c --- /dev/null +++ b/testdata/issue-21.parser.json @@ -0,0 +1,424 @@ +{ + "prefix": null, + "downloads": { + "packages": [ + { + "package": "golang.org/x/crypto", + "version": "v0.0.0-20210817164053-32db794688a5", + "failed": false, + "reason": "" + }, + { + "package": "gopkg.in/yaml.v3", + "version": "v3.0.0-20210107192922-496545a6307b", + "failed": false, + "reason": "" + }, + { + "package": "github.com/docker/docker", + "version": "v20.10.11+incompatible", + "failed": false, + "reason": "" + }, + { + "package": "github.com/opencontainers/image-spec", + "version": "v1.0.2", + "failed": false, + "reason": "" + }, + { + "package": "k8s.io/api", + "version": "v0.23.0", + "failed": false, + "reason": "" + }, + { + "package": "k8s.io/apimachinery", + "version": "v0.23.0", + "failed": false, + "reason": "" + }, + { + "package": "sigs.k8s.io/yaml", + "version": "v1.3.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/stretchr/testify", + "version": "v1.7.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/gorilla/schema", + "version": "v1.2.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/fxamacker/cbor", + "version": "v1.5.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/mitchellh/mapstructure", + "version": "v1.4.3", + "failed": false, + "reason": "" + }, + { + "package": "github.com/aws/aws-sdk-go", + "version": "v1.42.21", + "failed": false, + "reason": "" + }, + { + "package": "github.com/docker/go-connections", + "version": "v0.4.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/docker/distribution", + "version": "v2.7.1+incompatible", + "failed": false, + "reason": "" + }, + { + "package": "github.com/google/go-cmp", + "version": "v0.5.6", + "failed": false, + "reason": "" + }, + { + "package": "github.com/oschwald/geoip2-golang", + "version": "v1.5.0", + "failed": false, + "reason": "" + }, + { + "package": "k8s.io/client-go", + "version": "v0.23.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/creasty/defaults", + "version": "v1.5.2", + "failed": false, + "reason": "" + }, + { + "package": "github.com/imdario/mergo", + "version": "v0.3.12", + "failed": false, + "reason": "" + }, + { + "package": "github.com/qdm12/reprint", + "version": "v0.0.0-20200326205758-722754a53494", + "failed": false, + "reason": "" + }, + { + "package": "golang.org/x/sys", + "version": "v0.0.0-20210831042530-f4d43177bf5e", + "failed": false, + "reason": "" + }, + { + "package": "sigs.k8s.io/kind", + "version": "v0.11.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/jcmturner/gokrb5/v8", + "version": "v8.4.2", + "failed": false, + "reason": "" + }, + { + "package": "github.com/mattn/go-shellwords", + "version": "v1.0.12", + "failed": false, + "reason": "" + }, + { + "package": "github.com/google/uuid", + "version": "v1.3.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/docker/go-units", + "version": "v0.4.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/opencontainers/go-digest", + "version": "v1.0.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/gogo/protobuf", + "version": "v1.3.2", + "failed": false, + "reason": "" + }, + { + "package": "github.com/google/gofuzz", + "version": "v1.1.0", + "failed": false, + "reason": "" + }, + { + "package": "gopkg.in/yaml.v2", + "version": "v2.4.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/davecgh/go-spew", + "version": "v1.1.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/pmezard/go-difflib", + "version": "v1.0.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/x448/float16", + "version": "v0.8.4", + "failed": false, + "reason": "" + }, + { + "package": "github.com/containerd/containerd", + "version": "v1.5.8", + "failed": false, + "reason": "" + }, + { + "package": "github.com/pkg/errors", + "version": "v0.9.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/oschwald/maxminddb-golang", + "version": "v1.8.0", + "failed": false, + "reason": "" + }, + { + "package": "k8s.io/klog/v2", + "version": "v2.30.0", + "failed": false, + "reason": "" + }, + { + "package": "sigs.k8s.io/structured-merge-diff/v4", + "version": "v4.1.2", + "failed": false, + "reason": "" + }, + { + "package": "golang.org/x/net", + "version": "v0.0.0-20210825183410-e898025ed96a", + "failed": false, + "reason": "" + }, + { + "package": "k8s.io/utils", + "version": "v0.0.0-20210930125809-cb0fa318a74b", + "failed": false, + "reason": "" + }, + { + "package": "github.com/jcmturner/dnsutils/v2", + "version": "v2.0.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/jcmturner/gofork", + "version": "v1.0.0", + "failed": false, + "reason": "" + }, + { + "package": "gopkg.in/inf.v0", + "version": "v0.9.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/jmespath/go-jmespath", + "version": "v0.4.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/sirupsen/logrus", + "version": "v1.8.1", + "failed": false, + "reason": "" + }, + { + "package": "google.golang.org/grpc", + "version": "v1.36.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/go-logr/logr", + "version": "v1.2.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/json-iterator/go", + "version": "v1.1.12", + "failed": false, + "reason": "" + }, + { + "package": "github.com/golang/protobuf", + "version": "v1.5.2", + "failed": false, + "reason": "" + }, + { + "package": "github.com/googleapis/gnostic", + "version": "v0.5.5", + "failed": false, + "reason": "" + }, + { + "package": "golang.org/x/time", + "version": "v0.0.0-20210723032227-1f47c861a9ac", + "failed": false, + "reason": "" + }, + { + "package": "golang.org/x/term", + "version": "v0.0.0-20210615171337-6886f2dfbf5b", + "failed": false, + "reason": "" + }, + { + "package": "golang.org/x/oauth2", + "version": "v0.0.0-20210819190943-2bc19b11175f", + "failed": false, + "reason": "" + }, + { + "package": "github.com/alessio/shellescape", + "version": "v1.4.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/spf13/cobra", + "version": "v1.1.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/hashicorp/go-uuid", + "version": "v1.0.2", + "failed": false, + "reason": "" + }, + { + "package": "google.golang.org/genproto", + "version": "v0.0.0-20210524171403-669157292da3", + "failed": false, + "reason": "" + }, + { + "package": "github.com/modern-go/concurrent", + "version": "v0.0.0-20180306012644-bacd9c7ef1dd", + "failed": false, + "reason": "" + }, + { + "package": "github.com/modern-go/reflect2", + "version": "v1.0.2", + "failed": false, + "reason": "" + }, + { + "package": "google.golang.org/protobuf", + "version": "v1.27.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/moby/spdystream", + "version": "v0.2.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/spf13/pflag", + "version": "v1.0.5", + "failed": false, + "reason": "" + }, + { + "package": "github.com/jcmturner/rpc/v2", + "version": "v2.0.3", + "failed": false, + "reason": "" + }, + { + "package": "github.com/jcmturner/aescts/v2", + "version": "v2.0.0", + "failed": false, + "reason": "" + }, + { + "package": "k8s.io/kube-openapi", + "version": "v0.0.0-20211115234752-e816edb12b65", + "failed": false, + "reason": "" + }, + { + "package": "github.com/BurntSushi/toml", + "version": "v0.3.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/evanphx/json-patch/v5", + "version": "v5.2.0", + "failed": false, + "reason": "" + }, + { + "package": "github.com/pelletier/go-toml", + "version": "v1.8.1", + "failed": false, + "reason": "" + }, + { + "package": "github.com/mattn/go-isatty", + "version": "v0.0.12", + "failed": false, + "reason": "" + } + ], + "failed": true, + "reason": "updates to go.mod needed; to update it:\n\tgo mod tidy" + }, + "packages": null +} diff --git a/testdata/issue-21.tokenizer.json b/testdata/issue-21.tokenizer.json new file mode 100644 index 0000000..518e8ff --- /dev/null +++ b/testdata/issue-21.tokenizer.json @@ -0,0 +1,794 @@ +[ + { + "action": "download", + "package": "golang.org/x/crypto", + "version": "v0.0.0-20210817164053-32db794688a5", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "gopkg.in/yaml.v3", + "version": "v3.0.0-20210107192922-496545a6307b", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/docker/docker", + "version": "v20.10.11+incompatible", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/opencontainers/image-spec", + "version": "v1.0.2", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "k8s.io/api", + "version": "v0.23.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "k8s.io/apimachinery", + "version": "v0.23.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "sigs.k8s.io/yaml", + "version": "v1.3.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/stretchr/testify", + "version": "v1.7.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/gorilla/schema", + "version": "v1.2.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/fxamacker/cbor", + "version": "v1.5.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/mitchellh/mapstructure", + "version": "v1.4.3", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/aws/aws-sdk-go", + "version": "v1.42.21", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/docker/go-connections", + "version": "v0.4.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/docker/distribution", + "version": "v2.7.1+incompatible", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/google/go-cmp", + "version": "v0.5.6", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/oschwald/geoip2-golang", + "version": "v1.5.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "k8s.io/client-go", + "version": "v0.23.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/creasty/defaults", + "version": "v1.5.2", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/imdario/mergo", + "version": "v0.3.12", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/qdm12/reprint", + "version": "v0.0.0-20200326205758-722754a53494", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "golang.org/x/sys", + "version": "v0.0.0-20210831042530-f4d43177bf5e", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "sigs.k8s.io/kind", + "version": "v0.11.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/jcmturner/gokrb5/v8", + "version": "v8.4.2", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/mattn/go-shellwords", + "version": "v1.0.12", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/google/uuid", + "version": "v1.3.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/docker/go-units", + "version": "v0.4.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/opencontainers/go-digest", + "version": "v1.0.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/gogo/protobuf", + "version": "v1.3.2", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/google/gofuzz", + "version": "v1.1.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "gopkg.in/yaml.v2", + "version": "v2.4.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/davecgh/go-spew", + "version": "v1.1.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/pmezard/go-difflib", + "version": "v1.0.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/x448/float16", + "version": "v0.8.4", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/containerd/containerd", + "version": "v1.5.8", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/pkg/errors", + "version": "v0.9.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/oschwald/maxminddb-golang", + "version": "v1.8.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "k8s.io/klog/v2", + "version": "v2.30.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "sigs.k8s.io/structured-merge-diff/v4", + "version": "v4.1.2", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "golang.org/x/net", + "version": "v0.0.0-20210825183410-e898025ed96a", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "k8s.io/utils", + "version": "v0.0.0-20210930125809-cb0fa318a74b", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/jcmturner/dnsutils/v2", + "version": "v2.0.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/jcmturner/gofork", + "version": "v1.0.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "gopkg.in/inf.v0", + "version": "v0.9.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/jmespath/go-jmespath", + "version": "v0.4.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/sirupsen/logrus", + "version": "v1.8.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "google.golang.org/grpc", + "version": "v1.36.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/go-logr/logr", + "version": "v1.2.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/json-iterator/go", + "version": "v1.1.12", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/golang/protobuf", + "version": "v1.5.2", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/googleapis/gnostic", + "version": "v0.5.5", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "golang.org/x/time", + "version": "v0.0.0-20210723032227-1f47c861a9ac", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "golang.org/x/term", + "version": "v0.0.0-20210615171337-6886f2dfbf5b", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "golang.org/x/oauth2", + "version": "v0.0.0-20210819190943-2bc19b11175f", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/alessio/shellescape", + "version": "v1.4.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/spf13/cobra", + "version": "v1.1.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/hashicorp/go-uuid", + "version": "v1.0.2", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "google.golang.org/genproto", + "version": "v0.0.0-20210524171403-669157292da3", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/modern-go/concurrent", + "version": "v0.0.0-20180306012644-bacd9c7ef1dd", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/modern-go/reflect2", + "version": "v1.0.2", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "google.golang.org/protobuf", + "version": "v1.27.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/moby/spdystream", + "version": "v0.2.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/spf13/pflag", + "version": "v1.0.5", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/jcmturner/rpc/v2", + "version": "v2.0.3", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/jcmturner/aescts/v2", + "version": "v2.0.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "k8s.io/kube-openapi", + "version": "v0.0.0-20211115234752-e816edb12b65", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/BurntSushi/toml", + "version": "v0.3.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/evanphx/json-patch/v5", + "version": "v5.2.0", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/pelletier/go-toml", + "version": "v1.8.1", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "download", + "package": "github.com/mattn/go-isatty", + "version": "v0.0.12", + "test": "", + "elapsed": "0s", + "output": null, + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "stdout", + "package": "", + "version": "", + "test": "", + "elapsed": "0s", + "output": "Z286IHVwZGF0ZXMgdG8gZ28ubW9kIG5lZWRlZDsgdG8gdXBkYXRlIGl0Og==", + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "stdout", + "package": "", + "version": "", + "test": "", + "elapsed": "0s", + "output": "CWdvIG1vZCB0aWR5", + "cached": false, + "coverage": null, + "json": false + }, + { + "action": "stdout", + "package": "", + "version": "", + "test": "", + "elapsed": "0s", + "output": "", + "cached": false, + "coverage": null, + "json": false + } +] diff --git a/testdata/issue-21.txt b/testdata/issue-21.txt new file mode 100644 index 0000000..0d25959 --- /dev/null +++ b/testdata/issue-21.txt @@ -0,0 +1,71 @@ +go: downloading golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 +go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b +go: downloading github.com/docker/docker v20.10.11+incompatible +go: downloading github.com/opencontainers/image-spec v1.0.2 +go: downloading k8s.io/api v0.23.0 +go: downloading k8s.io/apimachinery v0.23.0 +go: downloading sigs.k8s.io/yaml v1.3.0 +go: downloading github.com/stretchr/testify v1.7.0 +go: downloading github.com/gorilla/schema v1.2.0 +go: downloading github.com/fxamacker/cbor v1.5.1 +go: downloading github.com/mitchellh/mapstructure v1.4.3 +go: downloading github.com/aws/aws-sdk-go v1.42.21 +go: downloading github.com/docker/go-connections v0.4.0 +go: downloading github.com/docker/distribution v2.7.1+incompatible +go: downloading github.com/google/go-cmp v0.5.6 +go: downloading github.com/oschwald/geoip2-golang v1.5.0 +go: downloading k8s.io/client-go v0.23.0 +go: downloading github.com/creasty/defaults v1.5.2 +go: downloading github.com/imdario/mergo v0.3.12 +go: downloading github.com/qdm12/reprint v0.0.0-20200326205758-722754a53494 +go: downloading golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e +go: downloading sigs.k8s.io/kind v0.11.1 +go: downloading github.com/jcmturner/gokrb5/v8 v8.4.2 +go: downloading github.com/mattn/go-shellwords v1.0.12 +go: downloading github.com/google/uuid v1.3.0 +go: downloading github.com/docker/go-units v0.4.0 +go: downloading github.com/opencontainers/go-digest v1.0.0 +go: downloading github.com/gogo/protobuf v1.3.2 +go: downloading github.com/google/gofuzz v1.1.0 +go: downloading gopkg.in/yaml.v2 v2.4.0 +go: downloading github.com/davecgh/go-spew v1.1.1 +go: downloading github.com/pmezard/go-difflib v1.0.0 +go: downloading github.com/x448/float16 v0.8.4 +go: downloading github.com/containerd/containerd v1.5.8 +go: downloading github.com/pkg/errors v0.9.1 +go: downloading github.com/oschwald/maxminddb-golang v1.8.0 +go: downloading k8s.io/klog/v2 v2.30.0 +go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.1.2 +go: downloading golang.org/x/net v0.0.0-20210825183410-e898025ed96a +go: downloading k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b +go: downloading github.com/jcmturner/dnsutils/v2 v2.0.0 +go: downloading github.com/jcmturner/gofork v1.0.0 +go: downloading gopkg.in/inf.v0 v0.9.1 +go: downloading github.com/jmespath/go-jmespath v0.4.0 +go: downloading github.com/sirupsen/logrus v1.8.1 +go: downloading google.golang.org/grpc v1.36.1 +go: downloading github.com/go-logr/logr v1.2.0 +go: downloading github.com/json-iterator/go v1.1.12 +go: downloading github.com/golang/protobuf v1.5.2 +go: downloading github.com/googleapis/gnostic v0.5.5 +go: downloading golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac +go: downloading golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b +go: downloading golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f +go: downloading github.com/alessio/shellescape v1.4.1 +go: downloading github.com/spf13/cobra v1.1.1 +go: downloading github.com/hashicorp/go-uuid v1.0.2 +go: downloading google.golang.org/genproto v0.0.0-20210524171403-669157292da3 +go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd +go: downloading github.com/modern-go/reflect2 v1.0.2 +go: downloading google.golang.org/protobuf v1.27.1 +go: downloading github.com/moby/spdystream v0.2.0 +go: downloading github.com/spf13/pflag v1.0.5 +go: downloading github.com/jcmturner/rpc/v2 v2.0.3 +go: downloading github.com/jcmturner/aescts/v2 v2.0.0 +go: downloading k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 +go: downloading github.com/BurntSushi/toml v0.3.1 +go: downloading github.com/evanphx/json-patch/v5 v5.2.0 +go: downloading github.com/pelletier/go-toml v1.8.1 +go: downloading github.com/mattn/go-isatty v0.0.12 +go: updates to go.mod needed; to update it: + go mod tidy