diff --git a/tools/go.mod b/tools/go.mod
index 2db9792f..34caae0a 100644
--- a/tools/go.mod
+++ b/tools/go.mod
@@ -10,7 +10,7 @@ require (
github.com/mattn/goveralls v0.0.11
github.com/obalunenko/coverbadger v1.2.0
golang.org/x/tools v0.1.12
- gotest.tools/gotestsum v1.8.1
+ gotest.tools/gotestsum v1.8.2
)
require (
@@ -176,7 +176,6 @@ require (
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
- github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/julz/importas v0.1.0 // indirect
github.com/kevinburke/ssh_config v1.1.0 // indirect
github.com/kisielk/errcheck v1.6.2 // indirect
@@ -293,7 +292,7 @@ require (
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
+ golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
diff --git a/tools/go.sum b/tools/go.sum
index b4108c0c..568410d3 100644
--- a/tools/go.sum
+++ b/tools/go.sum
@@ -358,7 +358,6 @@ github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStB
github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0=
github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw=
github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY=
-github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
@@ -369,7 +368,6 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
-github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
@@ -701,8 +699,6 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
-github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
-github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
@@ -778,8 +774,8 @@ github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE=
github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
+github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-ieproxy v0.0.1 h1:qiyop7gCflfhwCzGyeT0gro3sF9AIg9HU98JORTkqfI=
@@ -1267,7 +1263,6 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -1319,6 +1314,7 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -1345,8 +1341,9 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM=
+golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -1383,7 +1380,6 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
-golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
@@ -1697,10 +1693,10 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gotest.tools/gotestsum v1.8.1 h1:C6dYd5K39WAv52jikEUuWgyMqJDhY90eauUjsFzwluc=
-gotest.tools/gotestsum v1.8.1/go.mod h1:ctqdxBSCPv80kAFjYvFNpPntBrE5HAQnLiOKBGLmOBs=
-gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
-gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
+gotest.tools/gotestsum v1.8.2 h1:szU3TaSz8wMx/uG+w/A2+4JUPwH903YYaMI9yOOYAyI=
+gotest.tools/gotestsum v1.8.2/go.mod h1:6JHCiN6TEjA7Kaz23q1bH0e2Dc3YJjDUZ0DmctFZf+w=
+gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo=
+gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/tools/vendor/github.com/jonboulle/clockwork/.editorconfig b/tools/vendor/github.com/jonboulle/clockwork/.editorconfig
deleted file mode 100644
index 4492e9f9..00000000
--- a/tools/vendor/github.com/jonboulle/clockwork/.editorconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-root = true
-
-[*]
-charset = utf-8
-end_of_line = lf
-indent_size = 4
-indent_style = space
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-[*.go]
-indent_style = tab
diff --git a/tools/vendor/github.com/jonboulle/clockwork/.gitignore b/tools/vendor/github.com/jonboulle/clockwork/.gitignore
deleted file mode 100644
index 00852bd9..00000000
--- a/tools/vendor/github.com/jonboulle/clockwork/.gitignore
+++ /dev/null
@@ -1,27 +0,0 @@
-/.idea/
-
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-*.test
-
-*.swp
diff --git a/tools/vendor/github.com/jonboulle/clockwork/LICENSE b/tools/vendor/github.com/jonboulle/clockwork/LICENSE
deleted file mode 100644
index 5c304d1a..00000000
--- a/tools/vendor/github.com/jonboulle/clockwork/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/tools/vendor/github.com/jonboulle/clockwork/README.md b/tools/vendor/github.com/jonboulle/clockwork/README.md
deleted file mode 100644
index cad60835..00000000
--- a/tools/vendor/github.com/jonboulle/clockwork/README.md
+++ /dev/null
@@ -1,80 +0,0 @@
-# clockwork
-
-[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go#utilities)
-
-[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jonboulle/clockwork/CI?style=flat-square)](https://github.com/jonboulle/clockwork/actions?query=workflow%3ACI)
-[![Go Report Card](https://goreportcard.com/badge/github.com/jonboulle/clockwork?style=flat-square)](https://goreportcard.com/report/github.com/jonboulle/clockwork)
-![Go Version](https://img.shields.io/badge/go%20version-%3E=1.11-61CFDD.svg?style=flat-square)
-[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/mod/github.com/jonboulle/clockwork)
-
-**A simple fake clock for Go.**
-
-
-## Usage
-
-Replace uses of the `time` package with the `clockwork.Clock` interface instead.
-
-For example, instead of using `time.Sleep` directly:
-
-```go
-func myFunc() {
- time.Sleep(3 * time.Second)
- doSomething()
-}
-```
-
-Inject a clock and use its `Sleep` method instead:
-
-```go
-func myFunc(clock clockwork.Clock) {
- clock.Sleep(3 * time.Second)
- doSomething()
-}
-```
-
-Now you can easily test `myFunc` with a `FakeClock`:
-
-```go
-func TestMyFunc(t *testing.T) {
- c := clockwork.NewFakeClock()
-
- // Start our sleepy function
- var wg sync.WaitGroup
- wg.Add(1)
- go func() {
- myFunc(c)
- wg.Done()
- }()
-
- // Ensure we wait until myFunc is sleeping
- c.BlockUntil(1)
-
- assertState()
-
- // Advance the FakeClock forward in time
- c.Advance(3 * time.Second)
-
- // Wait until the function completes
- wg.Wait()
-
- assertState()
-}
-```
-
-and in production builds, simply inject the real clock instead:
-
-```go
-myFunc(clockwork.NewRealClock())
-```
-
-See [example_test.go](example_test.go) for a full example.
-
-
-# Credits
-
-clockwork is inspired by @wickman's [threaded fake clock](https://gist.github.com/wickman/3840816), and the [Golang playground](https://blog.golang.org/playground#TOC_3.1.)
-
-
-## License
-
-Apache License, Version 2.0. Please see [License File](LICENSE) for more information.
diff --git a/tools/vendor/github.com/jonboulle/clockwork/clockwork.go b/tools/vendor/github.com/jonboulle/clockwork/clockwork.go
deleted file mode 100644
index 1018051f..00000000
--- a/tools/vendor/github.com/jonboulle/clockwork/clockwork.go
+++ /dev/null
@@ -1,195 +0,0 @@
-package clockwork
-
-import (
- "sync"
- "time"
-)
-
-// Clock provides an interface that packages can use instead of directly
-// using the time module, so that chronology-related behavior can be tested
-type Clock interface {
- After(d time.Duration) <-chan time.Time
- Sleep(d time.Duration)
- Now() time.Time
- Since(t time.Time) time.Duration
- NewTicker(d time.Duration) Ticker
-}
-
-// FakeClock provides an interface for a clock which can be
-// manually advanced through time
-type FakeClock interface {
- Clock
- // Advance advances the FakeClock to a new point in time, ensuring any existing
- // sleepers are notified appropriately before returning
- Advance(d time.Duration)
- // BlockUntil will block until the FakeClock has the given number of
- // sleepers (callers of Sleep or After)
- BlockUntil(n int)
-}
-
-// NewRealClock returns a Clock which simply delegates calls to the actual time
-// package; it should be used by packages in production.
-func NewRealClock() Clock {
- return &realClock{}
-}
-
-// NewFakeClock returns a FakeClock implementation which can be
-// manually advanced through time for testing. The initial time of the
-// FakeClock will be an arbitrary non-zero time.
-func NewFakeClock() FakeClock {
- // use a fixture that does not fulfill Time.IsZero()
- return NewFakeClockAt(time.Date(1984, time.April, 4, 0, 0, 0, 0, time.UTC))
-}
-
-// NewFakeClockAt returns a FakeClock initialised at the given time.Time.
-func NewFakeClockAt(t time.Time) FakeClock {
- return &fakeClock{
- time: t,
- }
-}
-
-type realClock struct{}
-
-func (rc *realClock) After(d time.Duration) <-chan time.Time {
- return time.After(d)
-}
-
-func (rc *realClock) Sleep(d time.Duration) {
- time.Sleep(d)
-}
-
-func (rc *realClock) Now() time.Time {
- return time.Now()
-}
-
-func (rc *realClock) Since(t time.Time) time.Duration {
- return rc.Now().Sub(t)
-}
-
-func (rc *realClock) NewTicker(d time.Duration) Ticker {
- return &realTicker{time.NewTicker(d)}
-}
-
-type fakeClock struct {
- sleepers []*sleeper
- blockers []*blocker
- time time.Time
-
- l sync.RWMutex
-}
-
-// sleeper represents a caller of After or Sleep
-type sleeper struct {
- until time.Time
- done chan time.Time
-}
-
-// blocker represents a caller of BlockUntil
-type blocker struct {
- count int
- ch chan struct{}
-}
-
-// After mimics time.After; it waits for the given duration to elapse on the
-// fakeClock, then sends the current time on the returned channel.
-func (fc *fakeClock) After(d time.Duration) <-chan time.Time {
- fc.l.Lock()
- defer fc.l.Unlock()
- now := fc.time
- done := make(chan time.Time, 1)
- if d.Nanoseconds() <= 0 {
- // special case - trigger immediately
- done <- now
- } else {
- // otherwise, add to the set of sleepers
- s := &sleeper{
- until: now.Add(d),
- done: done,
- }
- fc.sleepers = append(fc.sleepers, s)
- // and notify any blockers
- fc.blockers = notifyBlockers(fc.blockers, len(fc.sleepers))
- }
- return done
-}
-
-// notifyBlockers notifies all the blockers waiting until the
-// given number of sleepers are waiting on the fakeClock. It
-// returns an updated slice of blockers (i.e. those still waiting)
-func notifyBlockers(blockers []*blocker, count int) (newBlockers []*blocker) {
- for _, b := range blockers {
- if b.count == count {
- close(b.ch)
- } else {
- newBlockers = append(newBlockers, b)
- }
- }
- return
-}
-
-// Sleep blocks until the given duration has passed on the fakeClock
-func (fc *fakeClock) Sleep(d time.Duration) {
- <-fc.After(d)
-}
-
-// Time returns the current time of the fakeClock
-func (fc *fakeClock) Now() time.Time {
- fc.l.RLock()
- t := fc.time
- fc.l.RUnlock()
- return t
-}
-
-// Since returns the duration that has passed since the given time on the fakeClock
-func (fc *fakeClock) Since(t time.Time) time.Duration {
- return fc.Now().Sub(t)
-}
-
-func (fc *fakeClock) NewTicker(d time.Duration) Ticker {
- ft := &fakeTicker{
- c: make(chan time.Time, 1),
- stop: make(chan bool, 1),
- clock: fc,
- period: d,
- }
- ft.runTickThread()
- return ft
-}
-
-// Advance advances fakeClock to a new point in time, ensuring channels from any
-// previous invocations of After are notified appropriately before returning
-func (fc *fakeClock) Advance(d time.Duration) {
- fc.l.Lock()
- defer fc.l.Unlock()
- end := fc.time.Add(d)
- var newSleepers []*sleeper
- for _, s := range fc.sleepers {
- if end.Sub(s.until) >= 0 {
- s.done <- end
- } else {
- newSleepers = append(newSleepers, s)
- }
- }
- fc.sleepers = newSleepers
- fc.blockers = notifyBlockers(fc.blockers, len(fc.sleepers))
- fc.time = end
-}
-
-// BlockUntil will block until the fakeClock has the given number of sleepers
-// (callers of Sleep or After)
-func (fc *fakeClock) BlockUntil(n int) {
- fc.l.Lock()
- // Fast path: current number of sleepers is what we're looking for
- if len(fc.sleepers) == n {
- fc.l.Unlock()
- return
- }
- // Otherwise, set up a new blocker
- b := &blocker{
- count: n,
- ch: make(chan struct{}),
- }
- fc.blockers = append(fc.blockers, b)
- fc.l.Unlock()
- <-b.ch
-}
diff --git a/tools/vendor/github.com/jonboulle/clockwork/ticker.go b/tools/vendor/github.com/jonboulle/clockwork/ticker.go
deleted file mode 100644
index 32b5d01e..00000000
--- a/tools/vendor/github.com/jonboulle/clockwork/ticker.go
+++ /dev/null
@@ -1,72 +0,0 @@
-package clockwork
-
-import (
- "time"
-)
-
-// Ticker provides an interface which can be used instead of directly
-// using the ticker within the time module. The real-time ticker t
-// provides ticks through t.C which becomes now t.Chan() to make
-// this channel requirement definable in this interface.
-type Ticker interface {
- Chan() <-chan time.Time
- Stop()
-}
-
-type realTicker struct{ *time.Ticker }
-
-func (rt *realTicker) Chan() <-chan time.Time {
- return rt.C
-}
-
-type fakeTicker struct {
- c chan time.Time
- stop chan bool
- clock FakeClock
- period time.Duration
-}
-
-func (ft *fakeTicker) Chan() <-chan time.Time {
- return ft.c
-}
-
-func (ft *fakeTicker) Stop() {
- ft.stop <- true
-}
-
-// runTickThread initializes a background goroutine to send the tick time to the ticker channel
-// after every period. Tick events are discarded if the underlying ticker channel does not have
-// enough capacity.
-func (ft *fakeTicker) runTickThread() {
- nextTick := ft.clock.Now().Add(ft.period)
- next := ft.clock.After(ft.period)
- go func() {
- for {
- select {
- case <-ft.stop:
- return
- case <-next:
- // We send the time that the tick was supposed to occur at.
- tick := nextTick
- // Before sending the tick, we'll compute the next tick time and star the clock.After call.
- now := ft.clock.Now()
- // First, figure out how many periods there have been between "now" and the time we were
- // supposed to have trigged, then advance over all of those.
- skipTicks := (now.Sub(tick) + ft.period - 1) / ft.period
- nextTick = nextTick.Add(skipTicks * ft.period)
- // Now, keep advancing until we are past now. This should happen at most once.
- for !nextTick.After(now) {
- nextTick = nextTick.Add(ft.period)
- }
- // Figure out how long between now and the next scheduled tick, then wait that long.
- remaining := nextTick.Sub(now)
- next = ft.clock.After(remaining)
- // Finally, we can actually send the tick.
- select {
- case ft.c <- tick:
- default:
- }
- }
- }
- }()
-}
diff --git a/tools/vendor/golang.org/x/term/term.go b/tools/vendor/golang.org/x/term/term.go
index d5927088..1a40d101 100644
--- a/tools/vendor/golang.org/x/term/term.go
+++ b/tools/vendor/golang.org/x/term/term.go
@@ -7,11 +7,11 @@
//
// Putting a terminal into raw mode is the most common requirement:
//
-// oldState, err := term.MakeRaw(int(os.Stdin.Fd()))
-// if err != nil {
-// panic(err)
-// }
-// defer term.Restore(int(os.Stdin.Fd()), oldState)
+// oldState, err := term.MakeRaw(int(os.Stdin.Fd()))
+// if err != nil {
+// panic(err)
+// }
+// defer term.Restore(int(os.Stdin.Fd()), oldState)
//
// Note that on non-Unix systems os.Stdin.Fd() may not be 0.
package term
diff --git a/tools/vendor/golang.org/x/term/terminal.go b/tools/vendor/golang.org/x/term/terminal.go
index 535ab825..4b48a589 100644
--- a/tools/vendor/golang.org/x/term/terminal.go
+++ b/tools/vendor/golang.org/x/term/terminal.go
@@ -935,7 +935,7 @@ func (s *stRingBuffer) Add(a string) {
// next most recent, and so on. If such an element doesn't exist then ok is
// false.
func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) {
- if n >= s.size {
+ if n < 0 || n >= s.size {
return "", false
}
index := s.head - n
diff --git a/tools/vendor/gotest.tools/gotestsum/.gitignore b/tools/vendor/gotest.tools/gotestsum/.gitignore
index ce77fdac..a96bf81d 100644
--- a/tools/vendor/gotest.tools/gotestsum/.gitignore
+++ b/tools/vendor/gotest.tools/gotestsum/.gitignore
@@ -1,5 +1,4 @@
vendor/
-.dobi/
dist/
junit.xml
.plsdo/
diff --git a/tools/vendor/gotest.tools/gotestsum/.golangci.yml b/tools/vendor/gotest.tools/gotestsum/.golangci.yml
deleted file mode 100644
index 8279d6d2..00000000
--- a/tools/vendor/gotest.tools/gotestsum/.golangci.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-linters-settings:
- gocyclo:
- min-complexity: 12
- goconst:
- min-len: 2
- min-occurrences: 4
- lll:
- line-length: 120
-
-issues:
- exclude-use-default: false
- exclude-rules:
- - linters: [revive]
- text: 'should have comment .*or be unexported'
- - linters: [stylecheck]
- text: 'ST1000: at least one file in a package should have a package comment'
- - linters: [errcheck]
- text: 'Error return value of `.*\.WriteString` is not checked'
- - linters: [unparam]
- text: 'result .* is always'
- - linters: [unparam]
- text: 'always receives'
-
-linters:
- disable-all: true
- enable:
- - bodyclose
- - deadcode
- - depguard
- - errcheck
- - gocognit
- - goconst
- - gocyclo
- - gofmt
- - goimports
- - gosimple
- - govet
- - ineffassign
- - interfacer
- - lll
- - misspell
- - nakedret
- - prealloc
- - revive
- - staticcheck
- - structcheck
- - stylecheck
- - typecheck
- - unconvert
- - unparam
- - unused
- - varcheck
- - whitespace
diff --git a/tools/vendor/gotest.tools/gotestsum/.goreleaser.yml b/tools/vendor/gotest.tools/gotestsum/.goreleaser.yml
deleted file mode 100644
index 3c3d8131..00000000
--- a/tools/vendor/gotest.tools/gotestsum/.goreleaser.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-project_name: gotestsum
-
-release:
- github:
- owner: gotestyourself
- name: gotestsum
-
-builds:
- - binary: gotestsum
- goos:
- - darwin
- - windows
- - linux
- goarch:
- - amd64
- - arm64
- - arm
- env: [CGO_ENABLED=0]
- ldflags: ["-s -w -X gotest.tools/gotestsum/cmd.version={{.Version}}"]
-
-checksum:
- name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'
diff --git a/tools/vendor/gotest.tools/gotestsum/.plsdo.sh b/tools/vendor/gotest.tools/gotestsum/.plsdo.sh
deleted file mode 100644
index 94c08567..00000000
--- a/tools/vendor/gotest.tools/gotestsum/.plsdo.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env bash
-# plsdo.sh, version 0.1.1
-set -o errexit -o nounset -o pipefail
-
-_plsdo_run() {
- case "${1-}" in
- ""|help)
- _plsdo_help "${2-}" ;;
- *)
- "$@" ;;
- esac
-}
-
-declare -A help
-
-help[list]="Print the list of tasks"
-list() {
- declare -F | awk '{print $3}' | grep -v '^_'
-}
-
-_plsdo_help_task_name_width="${_plsdo_help_task_name_width:-12}"
-
-_plsdo_help() {
- local topic="${1-}"
- # print help for the topic
- if [ -n "$topic" ]; then
- if ! command -v "$topic" > /dev/null ; then
- _plsdo_error "No such task: $topic"
- return 1
- fi
-
- printf "\nUsage:\n %s %s\n\n%s\n" "$0" "$topic" "${help[$topic]-}"
- return 0
- fi
-
- # print list of tasks and their help line.
- [ -n "${banner-}" ] && echo "$banner" && echo
- for i in $(list); do
- printf "%-${_plsdo_help_task_name_width}s\t%s\n" "$i" "${help[$i]-}" | head -1
- done
-}
-
-_plsdo_error() {
- >&2 echo "$@"
-}
-
-# shellcheck disable=SC2016
-help[_plsdo_completion]='Print tab completion for $SHELL.
-
-Redirect the output to a file that will be run when the shell starts,
-such as ~/.bashrc.
-
- $ ./do _pldsdo_completion >> ~/.bash_complete/do
-'
-_plsdo_completion() {
- local shell; shell="$(basename "$SHELL" 2> /dev/null)"
- case "$shell" in
- bash)
- cat <<+++
-_dotslashdo_completions() {
- if ! command -v $0 > /dev/null; then return; fi
- if [ "\${#COMP_WORDS[@]}" != "2" ]; then return; fi
- COMPREPLY=(\$(compgen -W "\$($0 list)" "\${COMP_WORDS[1]}"))
-}
-complete -F _dotslashdo_completions $0
-+++
- ;;
- "")
- _plsdo_error "Set \$SHELL to select tab completion."
- return 1 ;;
- *)
- _plsdo_error "No completetion for shell: $shell"
- return 1 ;;
- esac
-}
diff --git a/tools/vendor/gotest.tools/gotestsum/.pre-commit-hooks.yaml b/tools/vendor/gotest.tools/gotestsum/.pre-commit-hooks.yaml
deleted file mode 100644
index 0cf49d19..00000000
--- a/tools/vendor/gotest.tools/gotestsum/.pre-commit-hooks.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-- id: gotestsum
- name: gotestsum
- description: |
- `go test` runner with output optimized for humans, JUnit XML for CI
- integration, and a summary of the test results.
- entry: gotestsum
- types: [go]
- language: golang
- pass_filenames: false
diff --git a/tools/vendor/gotest.tools/gotestsum/Dockerfile b/tools/vendor/gotest.tools/gotestsum/Dockerfile
deleted file mode 100644
index 592d86c4..00000000
--- a/tools/vendor/gotest.tools/gotestsum/Dockerfile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-ARG GOLANG_VERSION
-FROM golang:${GOLANG_VERSION:-1.14-alpine} as golang
-RUN apk add -U curl git bash
-ENV CGO_ENABLED=0 \
- PS1="# " \
- GO111MODULE=on
-ARG UID=1000
-RUN adduser --uid=${UID} --disabled-password devuser
-USER ${UID}:${UID}
-
-
-FROM golang as tools
-RUN go get github.com/dnephin/filewatcher@v0.3.2
-RUN wget -O- -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s && \
- mv bin/golangci-lint /go/bin
-
-
-FROM golang as dev
-COPY --from=tools /go/bin/filewatcher /usr/bin/filewatcher
-COPY --from=tools /go/bin/golangci-lint /usr/bin/golangci-lint
-
-
-FROM dev as dev-with-source
-COPY . .
diff --git a/tools/vendor/gotest.tools/gotestsum/README.md b/tools/vendor/gotest.tools/gotestsum/README.md
index d5e88251..04763a61 100644
--- a/tools/vendor/gotest.tools/gotestsum/README.md
+++ b/tools/vendor/gotest.tools/gotestsum/README.md
@@ -2,34 +2,30 @@
`gotestsum` runs tests using `go test -json`, prints formatted test output, and a summary of the test run.
It is designed to work well for both local development, and for automation like CI.
-`gotest.tools/gotestsum/testjson` ([godoc](https://pkg.go.dev/gotest.tools/gotestsum/testjson)) is a library
-that can be used to read [`test2json`](https://golang.org/cmd/test2json/) output.
-
-See [documentation](#documentation).
## Install
Download a binary from [releases](https://github.com/gotestyourself/gotestsum/releases), or build from
source with `go install gotest.tools/gotestsum@latest`. With `go` version before 1.17, use `go get gotest.tools/gotestsum`.
-## Demo
-A demonstration of three `--format` options.
-
-![Demo](https://i.ibb.co/XZfhmXq/demo.gif)
-
[Source](https://github.com/gotestyourself/gotestsum/tree/readme-demo/scripts)
-
-## Documentation
+## Documentation
+**Core features**
- [Output Format](#output-format) from compact to verbose, with color highlighting.
- [Summary](#summary) of the test run.
-- [JUnit XML file](#junit-xml-output) for integration with CI systems.
-- [JSON file](#json-file-output) to capture the `test2json` output in a file.
-- [Post run commands](#post-run-command) may be used for desktop notification.
-- [Re-run failed tests](#re-running-failed-tests) to save time when dealing with flaky test suites.
- [Add `go test` flags](#custom-go-test-command), or
[run a compiled test binary](#executing-a-compiled-test-binary).
-- [Find or skip slow tests](#finding-and-skipping-slow-tests) using `gotestsum tool slowest`.
-- [Run tests when a file is saved](#run-tests-when-a-file-is-saved).
+
+**CI and Automation**
+- [`--junitfile`](#junit-xml-output) - write a JUnit XML file for integration with CI systems.
+- [`--jsonfile`](#json-file-output) - write the `test2json` output in a file.
+- [`--rerun-fails`](#re-running-failed-tests) - run failed tests again to save time when dealing with flaky test suites.
+
+**Local Development**
+- [`--watch`](#run-tests-when-a-file-is-saved) - when a file is saved, run the tests for the package that includes the file.
+- [`--post-run-command`](#post-run-command) - run a command after the tests, can be used for desktop notification.
+- [`gotestsum tool slowest`](#finding-and-skipping-slow-tests) - find the slowest tests, also update slow tests to be skipepd with `-short`.
+
### Output Format
@@ -48,6 +44,13 @@ Commonly used formats (see `--help` for a full list):
Have an idea for a new format?
Please [share it on github](https://github.com/gotestyourself/gotestsum/issues/new)!
+#### Demo
+
+A demonstration of three `--format` options.
+
+![Demo](https://user-images.githubusercontent.com/442180/182284939-e08a0aa5-4504-4e30-9e88-207ef47f4537.gif)
+
[Source](https://github.com/gotestyourself/gotestsum/tree/readme-demo/scripts)
+
### Summary
Following the formatted output is a summary of the test run. The summary includes:
@@ -290,7 +293,7 @@ output. `./binary.test` is the path to the compiled test binary. The `-test.v`
must be included so that `go tool test2json` receives all the output.
To execute a test binary without installing Go, see
-[running without go](./docs/running-without-go.md).
+[running without go](./.project/docs/running-without-go.md).
### Finding and skipping slow tests
diff --git a/tools/vendor/gotest.tools/gotestsum/cmd/flags.go b/tools/vendor/gotest.tools/gotestsum/cmd/flags.go
index 6277f8aa..a5d811bc 100644
--- a/tools/vendor/gotest.tools/gotestsum/cmd/flags.go
+++ b/tools/vendor/gotest.tools/gotestsum/cmd/flags.go
@@ -2,12 +2,12 @@ package cmd
import (
"encoding/csv"
+ "fmt"
"path"
"strings"
"github.com/dnephin/pflag"
"github.com/google/shlex"
- "github.com/pkg/errors"
"gotest.tools/gotestsum/internal/junitxml"
"gotest.tools/gotestsum/testjson"
)
@@ -35,7 +35,7 @@ func (s *hideSummaryValue) Set(val string) error {
for _, item := range v {
summary, ok := testjson.NewSummary(item)
if !ok {
- return errors.Errorf("value must be one or more of: %s",
+ return fmt.Errorf("value must be one or more of: %s",
testjson.SummarizeAll.String())
}
s.value -= summary
@@ -69,7 +69,7 @@ func (f *junitFieldFormatValue) Set(val string) error {
f.value = path.Base
return nil
}
- return errors.Errorf("invalid value: %v, must be one of: "+junitFieldFormatValues, val)
+ return fmt.Errorf("invalid value: %v, must be one of: "+junitFieldFormatValues, val)
}
func (f *junitFieldFormatValue) Type() string {
diff --git a/tools/vendor/gotest.tools/gotestsum/cmd/handler.go b/tools/vendor/gotest.tools/gotestsum/cmd/handler.go
index c0863382..d67284f2 100644
--- a/tools/vendor/gotest.tools/gotestsum/cmd/handler.go
+++ b/tools/vendor/gotest.tools/gotestsum/cmd/handler.go
@@ -7,9 +7,8 @@ import (
"os/exec"
"path/filepath"
- "github.com/pkg/errors"
"gotest.tools/gotestsum/internal/junitxml"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
"gotest.tools/gotestsum/testjson"
)
@@ -31,13 +30,13 @@ func (h *eventHandler) Event(event testjson.TestEvent, execution *testjson.Execu
if h.jsonFile != nil && len(event.Bytes()) > 0 {
_, err := h.jsonFile.Write(append(event.Bytes(), '\n'))
if err != nil {
- return errors.Wrap(err, "failed to write JSON file")
+ return fmt.Errorf("failed to write JSON file: %w", err)
}
}
err := h.formatter.Format(event, execution)
if err != nil {
- return errors.Wrap(err, "failed to format event")
+ return fmt.Errorf("failed to format event: %w", err)
}
if h.maxFails > 0 && len(execution.Failed()) >= h.maxFails {
@@ -60,7 +59,7 @@ var _ testjson.EventHandler = &eventHandler{}
func newEventHandler(opts *options) (*eventHandler, error) {
formatter := testjson.NewEventFormatter(opts.stdout, opts.format)
if formatter == nil {
- return nil, errors.Errorf("unknown format %s", opts.format)
+ return nil, fmt.Errorf("unknown format %s", opts.format)
}
handler := &eventHandler{
formatter: formatter,
@@ -72,7 +71,7 @@ func newEventHandler(opts *options) (*eventHandler, error) {
_ = os.MkdirAll(filepath.Dir(opts.jsonFile), 0o755)
handler.jsonFile, err = os.Create(opts.jsonFile)
if err != nil {
- return handler, errors.Wrap(err, "failed to open JSON file")
+ return handler, fmt.Errorf("failed to open JSON file: %w", err)
}
}
return handler, nil
@@ -94,6 +93,7 @@ func writeJUnitFile(opts *options, execution *testjson.Execution) error {
}()
return junitxml.Write(junitFile, execution, junitxml.Config{
+ ProjectName: opts.junitProjectName,
FormatTestSuiteName: opts.junitTestSuiteNameFormat.Value(),
FormatTestCaseClassname: opts.junitTestCaseClassnameFormat.Value(),
})
diff --git a/tools/vendor/gotest.tools/gotestsum/cmd/main.go b/tools/vendor/gotest.tools/gotestsum/cmd/main.go
index fd81619d..553cad5c 100644
--- a/tools/vendor/gotest.tools/gotestsum/cmd/main.go
+++ b/tools/vendor/gotest.tools/gotestsum/cmd/main.go
@@ -2,6 +2,7 @@ package cmd
import (
"context"
+ "errors"
"fmt"
"io"
"os"
@@ -13,8 +14,7 @@ import (
"github.com/dnephin/pflag"
"github.com/fatih/color"
- "github.com/pkg/errors"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
"gotest.tools/gotestsum/testjson"
)
@@ -88,6 +88,9 @@ func setupFlags(name string) (*pflag.FlagSet, *options) {
"format the testsuite name field as: "+junitFieldFormatValues)
flags.Var(opts.junitTestCaseClassnameFormat, "junitfile-testcase-classname",
"format the testcase classname field as: "+junitFieldFormatValues)
+ flags.StringVar(&opts.junitProjectName, "junitfile-project-name",
+ lookEnvWithDefault("GOTESTSUM_JUNITFILE_PROJECT_NAME", ""),
+ "name of the project used in the junit.xml file")
flags.IntVar(&opts.rerunFailsMaxAttempts, "rerun-fails", 0,
"rerun failed tests until they all pass, or attempts exceeds maximum. Defaults to max 2 reruns when enabled.")
@@ -152,6 +155,7 @@ type options struct {
hideSummary *hideSummaryValue
junitTestSuiteNameFormat *junitFieldFormatValue
junitTestCaseClassnameFormat *junitFieldFormatValue
+ junitProjectName string
rerunFailsMaxAttempts int
rerunFailsMaxInitialFailures int
rerunFailsReportFile string
@@ -376,7 +380,7 @@ func startGoTest(ctx context.Context, args []string) (*proc, error) {
return nil, err
}
if err := cmd.Start(); err != nil {
- return nil, errors.Wrapf(err, "failed to run %s", strings.Join(cmd.Args, " "))
+ return nil, fmt.Errorf("failed to run %s: %w", strings.Join(cmd.Args, " "), err)
}
log.Debugf("go test pid: %d", cmd.Process.Pid)
diff --git a/tools/vendor/gotest.tools/gotestsum/cmd/tool/slowest/ast.go b/tools/vendor/gotest.tools/gotestsum/cmd/tool/slowest/ast.go
index 3fbc8a57..d232434e 100644
--- a/tools/vendor/gotest.tools/gotestsum/cmd/tool/slowest/ast.go
+++ b/tools/vendor/gotest.tools/gotestsum/cmd/tool/slowest/ast.go
@@ -10,7 +10,7 @@ import (
"strings"
"golang.org/x/tools/go/packages"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
"gotest.tools/gotestsum/testjson"
)
diff --git a/tools/vendor/gotest.tools/gotestsum/cmd/tool/slowest/slowest.go b/tools/vendor/gotest.tools/gotestsum/cmd/tool/slowest/slowest.go
index 0221b1cf..a2c13275 100644
--- a/tools/vendor/gotest.tools/gotestsum/cmd/tool/slowest/slowest.go
+++ b/tools/vendor/gotest.tools/gotestsum/cmd/tool/slowest/slowest.go
@@ -9,7 +9,7 @@ import (
"github.com/dnephin/pflag"
"gotest.tools/gotestsum/internal/aggregate"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
"gotest.tools/gotestsum/testjson"
)
diff --git a/tools/vendor/gotest.tools/gotestsum/do b/tools/vendor/gotest.tools/gotestsum/do
index aed4df15..21920f8c 100644
--- a/tools/vendor/gotest.tools/gotestsum/do
+++ b/tools/vendor/gotest.tools/gotestsum/do
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
+set -o errexit -o nounset -o pipefail
-source .plsdo.sh
+declare -A help
binary() {
mkdir -p dist
@@ -13,22 +14,11 @@ binary-static() {
}
update-golden() {
- #_update-golden
- if ldd ./dist/gotestsum > /dev/null 2>&1; then
- binary-static
- fi
- GOLANG_VERSION=1.13-alpine ./do shell ./do _update-golden
- GOLANG_VERSION=1.14.6-alpine ./do shell ./do _update-golden
-}
-
-_update-golden() {
- PATH="$PWD/dist:$PATH" gotestsum -- \
- ./cmd ./testjson ./internal/junitxml ./cmd/tool/slowest \
- -test.update-golden
+ gotestsum -- ./... -update
}
lint() {
- golangci-lint run -v
+ golangci-lint run -v --config .project/golangci-lint.yml
}
go-mod-tidy() {
@@ -57,7 +47,7 @@ shell() {
_docker-build-dev() {
set -e
local idfile=".plsdo/docker-build-dev-image-id-${GOLANG_VERSION-default}"
- local dockerfile=Dockerfile
+ local dockerfile=.project/Dockerfile
local tag=gotest.tools/gotestsum/builder
if [ -f "$idfile" ] && [ "$dockerfile" -ot "$idfile" ]; then
cat "$idfile"
@@ -83,4 +73,38 @@ godoc() {
command godoc -http=:6060
}
+help[list]="Print the list of tasks"
+list() {
+ declare -F | awk '{print $3}' | grep -v '^_'
+}
+
+_plsdo_help() {
+ local topic="${1-}"
+ # print help for the topic
+ if [ -n "$topic" ]; then
+ if ! command -v "$topic" > /dev/null ; then
+ >&2 echo "No such task: $topic"
+ return 1
+ fi
+
+ printf "\nUsage:\n %s %s\n\n%s\n" "$0" "$topic" "${help[$topic]-}"
+ return 0
+ fi
+
+ # print list of tasks and their help line.
+ [ -n "${banner-}" ] && echo "$banner" && echo
+ for i in $(list); do
+ printf "%-12s\t%s\n" "$i" "${help[$i]-}" | head -1
+ done
+}
+
+_plsdo_run() {
+ case "${1-}" in
+ ""|help)
+ _plsdo_help "${2-}" ;;
+ *)
+ "$@" ;;
+ esac
+}
+
_plsdo_run "$@"
diff --git a/tools/vendor/gotest.tools/gotestsum/internal/dotwriter/writer.go b/tools/vendor/gotest.tools/gotestsum/internal/dotwriter/writer.go
index 0eb4c7e4..2bc3a26b 100644
--- a/tools/vendor/gotest.tools/gotestsum/internal/dotwriter/writer.go
+++ b/tools/vendor/gotest.tools/gotestsum/internal/dotwriter/writer.go
@@ -1,4 +1,5 @@
-/*Package dotwriter implements a buffered Writer for updating progress on the
+/*
+Package dotwriter implements a buffered Writer for updating progress on the
terminal.
*/
package dotwriter
diff --git a/tools/vendor/gotest.tools/gotestsum/internal/filewatcher/term_unix.go b/tools/vendor/gotest.tools/gotestsum/internal/filewatcher/term_unix.go
index 58109a0a..cf9b7d0f 100644
--- a/tools/vendor/gotest.tools/gotestsum/internal/filewatcher/term_unix.go
+++ b/tools/vendor/gotest.tools/gotestsum/internal/filewatcher/term_unix.go
@@ -11,7 +11,7 @@ import (
"os"
"golang.org/x/sys/unix"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
)
type terminal struct {
diff --git a/tools/vendor/gotest.tools/gotestsum/internal/filewatcher/watch.go b/tools/vendor/gotest.tools/gotestsum/internal/filewatcher/watch.go
index 230183ea..e639f279 100644
--- a/tools/vendor/gotest.tools/gotestsum/internal/filewatcher/watch.go
+++ b/tools/vendor/gotest.tools/gotestsum/internal/filewatcher/watch.go
@@ -13,7 +13,7 @@ import (
"time"
"github.com/fsnotify/fsnotify"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
)
const maxDepth = 7
diff --git a/tools/vendor/gotest.tools/gotestsum/internal/junitxml/report.go b/tools/vendor/gotest.tools/gotestsum/internal/junitxml/report.go
index 703ed619..cd23b1f4 100644
--- a/tools/vendor/gotest.tools/gotestsum/internal/junitxml/report.go
+++ b/tools/vendor/gotest.tools/gotestsum/internal/junitxml/report.go
@@ -11,14 +11,19 @@ import (
"strings"
"time"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
"gotest.tools/gotestsum/testjson"
)
// JUnitTestSuites is a collection of JUnit test suites.
type JUnitTestSuites struct {
- XMLName xml.Name `xml:"testsuites"`
- Suites []JUnitTestSuite
+ XMLName xml.Name `xml:"testsuites"`
+ Name string `xml:"name,attr,omitempty"`
+ Tests int `xml:"tests,attr"`
+ Failures int `xml:"failures,attr"`
+ Errors int `xml:"errors,attr"`
+ Time string `xml:"time,attr"`
+ Suites []JUnitTestSuite
}
// JUnitTestSuite is a single JUnit test suite which may contain many
@@ -64,10 +69,12 @@ type JUnitFailure struct {
// Config used to write a junit XML document.
type Config struct {
+ ProjectName string
FormatTestSuiteName FormatFunc
FormatTestCaseClassname FormatFunc
// This is used for tests to have a consistent timestamp
customTimestamp string
+ customElapsed string
}
// FormatFunc converts a string from one format into another.
@@ -84,8 +91,17 @@ func Write(out io.Writer, exec *testjson.Execution, cfg Config) error {
func generate(exec *testjson.Execution, cfg Config) JUnitTestSuites {
cfg = configWithDefaults(cfg)
version := goVersion()
- suites := JUnitTestSuites{}
+ suites := JUnitTestSuites{
+ Name: cfg.ProjectName,
+ Tests: exec.Total(),
+ Failures: len(exec.Failed()),
+ Errors: len(exec.Errors()),
+ Time: formatDurationAsSeconds(time.Since(exec.Started())),
+ }
+ if cfg.customElapsed != "" {
+ suites.Time = cfg.customElapsed
+ }
for _, pkgname := range exec.Packages() {
pkg := exec.Package(pkgname)
junitpkg := JUnitTestSuite{
diff --git a/tools/vendor/gotest.tools/gotestsum/log/log.go b/tools/vendor/gotest.tools/gotestsum/internal/log/log.go
similarity index 100%
rename from tools/vendor/gotest.tools/gotestsum/log/log.go
rename to tools/vendor/gotest.tools/gotestsum/internal/log/log.go
diff --git a/tools/vendor/gotest.tools/gotestsum/main.go b/tools/vendor/gotest.tools/gotestsum/main.go
index dcd4fb24..df3e7903 100644
--- a/tools/vendor/gotest.tools/gotestsum/main.go
+++ b/tools/vendor/gotest.tools/gotestsum/main.go
@@ -5,7 +5,7 @@ import (
"gotest.tools/gotestsum/cmd"
"gotest.tools/gotestsum/cmd/tool"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
)
func main() {
diff --git a/tools/vendor/gotest.tools/gotestsum/testjson/doc.go b/tools/vendor/gotest.tools/gotestsum/testjson/doc.go
index f59610c6..7448eb01 100644
--- a/tools/vendor/gotest.tools/gotestsum/testjson/doc.go
+++ b/tools/vendor/gotest.tools/gotestsum/testjson/doc.go
@@ -1,22 +1,22 @@
-/*Package testjson scans test2json output and builds up a summary of the events.
+/*
+Package testjson scans test2json output and builds up a summary of the events.
Events are passed to a formatter for output.
-Example
+# Example
This example reads the test2json output from os.Stdin. It sends every
event to the handler, builds an Execution from the output, then it
prints the number of tests run.
- exec, err := testjson.ScanTestOutput(testjson.ScanConfig{
- // Stdout is a reader that provides the test2json output stream.
- Stdout: os.Stdin,
- // Handler receives TestEvents and error lines.
- Handler: eventHandler,
- })
- if err != nil {
- return fmt.Errorf("failed to scan testjson: %w", err)
- }
- fmt.Println("Ran %d tests", exec.Total())
-
+ exec, err := testjson.ScanTestOutput(testjson.ScanConfig{
+ // Stdout is a reader that provides the test2json output stream.
+ Stdout: os.Stdin,
+ // Handler receives TestEvents and error lines.
+ Handler: eventHandler,
+ })
+ if err != nil {
+ return fmt.Errorf("failed to scan testjson: %w", err)
+ }
+ fmt.Println("Ran %d tests", exec.Total())
*/
package testjson // import "gotest.tools/gotestsum/testjson"
diff --git a/tools/vendor/gotest.tools/gotestsum/testjson/dotformat.go b/tools/vendor/gotest.tools/gotestsum/testjson/dotformat.go
index 9d285fcc..fa00d364 100644
--- a/tools/vendor/gotest.tools/gotestsum/testjson/dotformat.go
+++ b/tools/vendor/gotest.tools/gotestsum/testjson/dotformat.go
@@ -10,18 +10,18 @@ import (
"golang.org/x/term"
"gotest.tools/gotestsum/internal/dotwriter"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
)
-func dotsFormatV1(event TestEvent, exec *Execution) (string, error) {
+func dotsFormatV1(event TestEvent, exec *Execution) string {
pkg := exec.Package(event.Package)
switch {
case event.PackageEvent():
- return "", nil
+ return ""
case event.Action == ActionRun && pkg.Total == 1:
- return "[" + RelativePackagePath(event.Package) + "]", nil
+ return "[" + RelativePackagePath(event.Package) + "]"
}
- return fmtDot(event), nil
+ return fmtDot(event)
}
func fmtDot(event TestEvent) string {
diff --git a/tools/vendor/gotest.tools/gotestsum/testjson/execution.go b/tools/vendor/gotest.tools/gotestsum/testjson/execution.go
index d9103d43..dd6e5070 100644
--- a/tools/vendor/gotest.tools/gotestsum/testjson/execution.go
+++ b/tools/vendor/gotest.tools/gotestsum/testjson/execution.go
@@ -4,6 +4,7 @@ import (
"bufio"
"bytes"
"encoding/json"
+ "errors"
"fmt"
"io"
"sort"
@@ -11,10 +12,8 @@ import (
"sync"
"time"
- "github.com/jonboulle/clockwork"
- "github.com/pkg/errors"
"golang.org/x/sync/errgroup"
- "gotest.tools/gotestsum/log"
+ "gotest.tools/gotestsum/internal/log"
)
// Action of TestEvent
@@ -107,6 +106,9 @@ type Package struct {
// github.com/golang/go/issues/45508. This field may be removed in the future
// if the issue is fixed in Go.
panicked bool
+ // shuffleSeed is the seed used to shuffle the tests. The value is set when
+ // tests are run with -shuffle
+ shuffleSeed string
}
// Result returns if the package passed, failed, or was skipped because there
@@ -156,6 +158,7 @@ func (p *Package) Output(id int) string {
// As a workaround for test output being attributed to the wrong subtest, if:
// - the TestCase is a root TestCase (not a subtest), and
// - the TestCase has no subtest failures;
+//
// then all output for every subtest under the root test is returned.
// See https://github.com/golang/go/issues/29755.
func (p *Package) OutputLines(tc TestCase) []string {
@@ -344,9 +347,12 @@ func (p *Package) addEvent(event TestEvent) {
if isCoverageOutput(event.Output) {
p.coverage = strings.TrimRight(event.Output, "\n")
}
- if isCachedOutput(event.Output) {
+ if strings.Contains(event.Output, "\t(cached)") {
p.cached = true
}
+ if isShuffleSeedOutput(event.Output) {
+ p.shuffleSeed = strings.TrimRight(event.Output, "\n")
+ }
p.addOutput(0, event.Output)
}
}
@@ -437,8 +443,8 @@ func isCoverageOutput(output string) bool {
strings.Contains(output, "% of statements"))
}
-func isCachedOutput(output string) bool {
- return strings.Contains(output, "\t(cached)")
+func isShuffleSeedOutput(output string) bool {
+ return strings.HasPrefix(output, "-test.shuffle ")
}
func isWarningNoTestsToRunOutput(output string) bool {
@@ -464,11 +470,11 @@ func (e *Execution) Packages() []string {
return sortedKeys(e.packages)
}
-var clock = clockwork.NewRealClock()
+var timeNow = time.Now
// Elapsed returns the time elapsed since the execution started.
func (e *Execution) Elapsed() time.Duration {
- return clock.Now().Sub(e.started)
+ return timeNow().Sub(e.started)
}
// Failed returns a list of all the failed test cases.
@@ -573,7 +579,7 @@ func (e *Execution) Started() time.Time {
// time the test execution started.
func newExecution() *Execution {
return &Execution{
- started: clock.Now(),
+ started: timeNow(),
packages: make(map[string]*Package),
}
}
@@ -675,7 +681,7 @@ func readStdout(config ScanConfig, execution *Execution) error {
config.Handler.Err(string(raw))
continue
}
- return errors.Wrapf(err, "failed to parse test output: %s", string(raw))
+ return fmt.Errorf("failed to parse test output: %s: %w", string(raw), err)
}
event.RunID = config.RunID
@@ -684,7 +690,10 @@ func readStdout(config ScanConfig, execution *Execution) error {
return err
}
}
- return errors.Wrap(scanner.Err(), "failed to scan test output")
+ if err := scanner.Err(); err != nil {
+ return fmt.Errorf("failed to scan test output: %w", err)
+ }
+ return nil
}
func readStderr(config ScanConfig, execution *Execution) error {
diff --git a/tools/vendor/gotest.tools/gotestsum/testjson/format.go b/tools/vendor/gotest.tools/gotestsum/testjson/format.go
index 29f6d421..8d4faf76 100644
--- a/tools/vendor/gotest.tools/gotestsum/testjson/format.go
+++ b/tools/vendor/gotest.tools/gotestsum/testjson/format.go
@@ -8,40 +8,40 @@ import (
"github.com/fatih/color"
)
-func debugFormat(event TestEvent, _ *Execution) (string, error) {
+func debugFormat(event TestEvent, _ *Execution) string {
return fmt.Sprintf("%s %s %s (%.3f) [%d] %s\n",
event.Package,
event.Test,
event.Action,
event.Elapsed,
event.Time.Unix(),
- event.Output), nil
+ event.Output)
}
// go test -v
-func standardVerboseFormat(event TestEvent, _ *Execution) (string, error) {
+func standardVerboseFormat(event TestEvent, _ *Execution) string {
if event.Action == ActionOutput {
- return event.Output, nil
+ return event.Output
}
- return "", nil
+ return ""
}
// go test
-func standardQuietFormat(event TestEvent, _ *Execution) (string, error) {
+func standardQuietFormat(event TestEvent, _ *Execution) string {
if !event.PackageEvent() {
- return "", nil
+ return ""
}
if event.Output == "PASS\n" || isCoverageOutput(event.Output) {
- return "", nil
+ return ""
}
if isWarningNoTestsToRunOutput(event.Output) {
- return "", nil
+ return ""
}
- return event.Output, nil
+ return event.Output
}
-func testNameFormat(event TestEvent, exec *Execution) (string, error) {
+func testNameFormat(event TestEvent, exec *Execution) string {
result := colorEvent(event)(strings.ToUpper(string(event.Action)))
formatTest := func() string {
pkgPath := RelativePackagePath(event.Package)
@@ -55,35 +55,29 @@ func testNameFormat(event TestEvent, exec *Execution) (string, error) {
switch {
case isPkgFailureOutput(event):
- return event.Output, nil
+ return event.Output
case event.PackageEvent():
if !event.Action.IsTerminal() {
- return "", nil
+ return ""
}
pkg := exec.Package(event.Package)
if event.Action == ActionSkip || (event.Action == ActionPass && pkg.Total == 0) {
result = colorEvent(event)("EMPTY")
}
- var cached string
- if pkg.cached {
- cached = cachedMessage
- }
- return fmt.Sprintf("%s %s%s\n",
- result,
- RelativePackagePath(event.Package),
- cached), nil
+ event.Elapsed = 0 // hide elapsed for now, for backwards compat
+ return result + " " + packageLine(event, exec)
case event.Action == ActionFail:
pkg := exec.Package(event.Package)
tc := pkg.LastFailedByName(event.Test)
- return pkg.Output(tc.ID) + formatTest(), nil
+ return pkg.Output(tc.ID) + formatTest()
case event.Action == ActionPass:
- return formatTest(), nil
+ return formatTest()
}
- return "", nil
+ return ""
}
// joinPkgToTestName for formatting.
@@ -121,6 +115,7 @@ func isPkgFailureOutput(event TestEvent) bool {
!strings.HasPrefix(out, "FAIL\t"+event.Package),
!strings.HasPrefix(out, "ok \t"+event.Package),
!strings.HasPrefix(out, "? \t"+event.Package),
+ !isShuffleSeedOutput(out),
)
}
@@ -133,41 +128,18 @@ func all(cond ...bool) bool {
return true
}
-const cachedMessage = " (cached)"
-
-func pkgNameFormat(event TestEvent, exec *Execution) (string, error) {
+func pkgNameFormat(event TestEvent, exec *Execution) string {
if !event.PackageEvent() {
- return "", nil
+ return ""
}
return shortFormatPackageEvent(event, exec)
}
-func shortFormatPackageEvent(event TestEvent, exec *Execution) (string, error) {
+func shortFormatPackageEvent(event TestEvent, exec *Execution) string {
pkg := exec.Package(event.Package)
- fmtElapsed := func() string {
- if pkg.cached {
- return cachedMessage
- }
- d := elapsedDuration(event.Elapsed)
- if d == 0 {
- return ""
- }
- return fmt.Sprintf(" (%s)", d)
- }
- fmtCoverage := func() string {
- if pkg.coverage == "" {
- return ""
- }
- return " (" + pkg.coverage + ")"
- }
- fmtEvent := func(action string) (string, error) {
- return fmt.Sprintf("%s %s%s%s\n",
- action,
- RelativePackagePath(event.Package),
- fmtElapsed(),
- fmtCoverage(),
- ), nil
+ fmtEvent := func(action string) string {
+ return action + " " + packageLine(event, exec)
}
withColor := colorEvent(event)
switch event.Action {
@@ -181,17 +153,42 @@ func shortFormatPackageEvent(event TestEvent, exec *Execution) (string, error) {
case ActionFail:
return fmtEvent(withColor("✖"))
}
- return "", nil
+ return ""
}
-func pkgNameWithFailuresFormat(event TestEvent, exec *Execution) (string, error) {
+func packageLine(event TestEvent, exec *Execution) string {
+ pkg := exec.Package(event.Package)
+
+ var buf strings.Builder
+ buf.WriteString(RelativePackagePath(event.Package))
+
+ switch {
+ case pkg.cached:
+ buf.WriteString(" (cached)")
+ case event.Elapsed != 0:
+ d := elapsedDuration(event.Elapsed)
+ buf.WriteString(fmt.Sprintf(" (%s)", d))
+ }
+
+ if pkg.coverage != "" {
+ buf.WriteString(" (" + pkg.coverage + ")")
+ }
+
+ if event.Action == ActionFail && pkg.shuffleSeed != "" {
+ buf.WriteString(" (" + pkg.shuffleSeed + ")")
+ }
+ buf.WriteString("\n")
+ return buf.String()
+}
+
+func pkgNameWithFailuresFormat(event TestEvent, exec *Execution) string {
if !event.PackageEvent() {
if event.Action == ActionFail {
pkg := exec.Package(event.Package)
tc := pkg.LastFailedByName(event.Test)
- return pkg.Output(tc.ID), nil
+ return pkg.Output(tc.ID)
}
- return "", nil
+ return ""
}
return shortFormatPackageEvent(event, exec)
}
@@ -240,14 +237,11 @@ func NewEventFormatter(out io.Writer, format string) EventFormatter {
type formatAdapter struct {
out io.Writer
- format func(TestEvent, *Execution) (string, error)
+ format func(TestEvent, *Execution) string
}
func (f *formatAdapter) Format(event TestEvent, exec *Execution) error {
- o, err := f.format(event, exec)
- if err != nil {
- return err
- }
- _, err = f.out.Write([]byte(o))
+ o := f.format(event, exec)
+ _, err := f.out.Write([]byte(o))
return err
}
diff --git a/tools/vendor/gotest.tools/gotestsum/testjson/generate.sh b/tools/vendor/gotest.tools/gotestsum/testjson/generate.sh
deleted file mode 100644
index b85f4bde..00000000
--- a/tools/vendor/gotest.tools/gotestsum/testjson/generate.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-set -eu
-
-go test -p 1 -tags stubpkg ./internal/... \
- > testdata/go-test-quiet.out \
- 2> testdata/go-test-quiet.err \
- | true
-
-
-go test -p 1 -v -tags stubpkg ./internal/... \
- > testdata/go-test-verbose.out \
- 2> testdata/go-test-verbose.err \
- | true
-
-go test -p 1 -json -tags stubpkg ./internal/... \
- > testdata/go-test-json.out \
- 2> testdata/go-test-json.err \
- | true
-
-go test -p 1 -json -timeout 10ms -tags 'stubpkg timeout' ./internal/... \
- > testdata/go-test-json-with-timeout.out \
- 2> testdata/go-test-json-with-timeout.err \
- | true
-
-go test -p 1 -json -tags 'stubpkg panic' ./internal/... \
- > testdata/go-test-json-with-panic.out \
- 2> testdata/go-test-json-with-panic.err \
- | true
-
-
-go test -p 1 -json -tags stubpkg -cover ./internal/... \
- > testdata/go-test-json-with-cover.out \
- 2> testdata/go-test-json-with-cover.err \
- | true
\ No newline at end of file
diff --git a/tools/vendor/modules.txt b/tools/vendor/modules.txt
index fa68c55d..de4d5513 100644
--- a/tools/vendor/modules.txt
+++ b/tools/vendor/modules.txt
@@ -857,9 +857,6 @@ github.com/jirfag/go-printf-func-name/pkg/analyzer
# github.com/jmespath/go-jmespath v0.4.0
## explicit; go 1.14
github.com/jmespath/go-jmespath
-# github.com/jonboulle/clockwork v0.2.2
-## explicit; go 1.13
-github.com/jonboulle/clockwork
# github.com/julz/importas v0.1.0
## explicit; go 1.15
github.com/julz/importas
@@ -1386,7 +1383,7 @@ golang.org/x/sys/plan9
golang.org/x/sys/unix
golang.org/x/sys/windows
golang.org/x/sys/windows/registry
-# golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
+# golang.org/x/term v0.0.0-20220526004731-065cf7ba2467
## explicit; go 1.17
golang.org/x/term
# golang.org/x/text v0.3.7
@@ -1646,7 +1643,7 @@ gopkg.in/yaml.v2
# gopkg.in/yaml.v3 v3.0.1
## explicit
gopkg.in/yaml.v3
-# gotest.tools/gotestsum v1.8.1
+# gotest.tools/gotestsum v1.8.2
## explicit; go 1.13
gotest.tools/gotestsum
gotest.tools/gotestsum/cmd
@@ -1656,7 +1653,7 @@ gotest.tools/gotestsum/internal/aggregate
gotest.tools/gotestsum/internal/dotwriter
gotest.tools/gotestsum/internal/filewatcher
gotest.tools/gotestsum/internal/junitxml
-gotest.tools/gotestsum/log
+gotest.tools/gotestsum/internal/log
gotest.tools/gotestsum/testjson
# honnef.co/go/tools v0.3.3
## explicit; go 1.17