Skip to content

Commit

Permalink
Shell executor logs through testing.T in upgrade tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgencur committed Oct 16, 2023
1 parent 9905456 commit b7ccc90
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 271 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/manifestival/manifestival v0.7.2
go.uber.org/zap v1.26.0
gocloud.dev v0.22.0
golang.org/x/mod v0.12.0
golang.org/x/mod v0.13.0
golang.org/x/oauth2 v0.13.0
google.golang.org/api v0.145.0
istio.io/api v0.0.0-20220420164308-b6a03a9e477e
Expand All @@ -24,7 +24,7 @@ require (
knative.dev/caching v0.0.0-20231011063744-ceca0ce6cd18
knative.dev/eventing v0.38.1-0.20231011142145-da0fba3c161a
knative.dev/hack v0.0.0-20231010131532-fc76874b28c6
knative.dev/pkg v0.0.0-20231011202506-948f5f57818a
knative.dev/pkg v0.0.0-20231016085036-3262b2bd73ed
knative.dev/serving v0.38.1-0.20231011210335-6703812f1314
sigs.k8s.io/yaml v1.3.0
)
Expand Down Expand Up @@ -122,7 +122,7 @@ require (
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -1128,8 +1128,8 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down Expand Up @@ -1397,8 +1397,8 @@ knative.dev/hack v0.0.0-20231010131532-fc76874b28c6 h1:K9saPnpWTK1xH/Dpx1aE4CA+4
knative.dev/hack v0.0.0-20231010131532-fc76874b28c6/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20231010132642-13dbe2012208 h1:kmaGnpE58Fu+M9sxF+qxifEG+lzBeM/9cBvuXLWGtOY=
knative.dev/networking v0.0.0-20231010132642-13dbe2012208/go.mod h1:LAT8cu/PGOtik5ABZhhl6h45QrNRXj0uqlpIP0dmLnU=
knative.dev/pkg v0.0.0-20231011202506-948f5f57818a h1:/Ia2DN9jWwz0CSLXFq0iwvMK4Tx4Iy9WoMvoPn1ri98=
knative.dev/pkg v0.0.0-20231011202506-948f5f57818a/go.mod h1:0HqD8pZppFF34znDJnN6fGzuFq9ulJnelX64ciHD+PE=
knative.dev/pkg v0.0.0-20231016085036-3262b2bd73ed h1:r9Dq3WejOMRhWnNzMpz8QCw8sl+9HiCFDsyQ1oCWQ+U=
knative.dev/pkg v0.0.0-20231016085036-3262b2bd73ed/go.mod h1:zmZN3DKn7ns0lKMPPAhoApZqZatWvfcKcr0yptdLSPw=
knative.dev/serving v0.38.1-0.20231011210335-6703812f1314 h1:w1F7bA1+DEJBxaJrOhmKCasqYJ/uEcVOJpmHHEGuiug=
knative.dev/serving v0.38.1-0.20231011210335-6703812f1314/go.mod h1:wnuCaMuLfBdOHgs1OfYPvEFN4xqH3GL6aTBv+xqdgKQ=
nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
Expand Down
12 changes: 6 additions & 6 deletions test/upgrade/installation/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ limitations under the License.
package installation

import (
"knative.dev/hack/shell"
"testing"

pkgupgrade "knative.dev/pkg/test/upgrade"
"knative.dev/pkg/test/upgrade/shell"
)

// Base installs Operator with Knative Serving and Eventing from the previous stable release.
Expand All @@ -39,20 +41,18 @@ func PreviousRelease() pkgupgrade.Operation {
func install(installName, shellFunc string) pkgupgrade.Operation {
return pkgupgrade.NewOperation(installName, func(c pkgupgrade.Context) {
c.Log.Info("Running shell function: ", shellFunc)
if err := callShellFunction(shellFunc); err != nil {
if err := callShellFunction(shellFunc, c.T); err != nil {
c.T.Error(err)
}
})
}

func callShellFunction(funcName string) error {
func callShellFunction(funcName string, t *testing.T) error {
loc, err := shell.NewProjectLocation("../../..")
if err != nil {
return err
}
exec := shell.NewExecutor(shell.ExecutorConfig{
ProjectLocation: loc,
})
exec := shell.NewExecutor(t, loc)
fn := shell.Function{
Script: shell.Script{
Label: funcName,
Expand Down
201 changes: 0 additions & 201 deletions third_party/VENDOR-LICENSE/knative.dev/hack/shell/LICENSE

This file was deleted.

4 changes: 2 additions & 2 deletions vendor/golang.org/x/tools/imports/forward.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions vendor/golang.org/x/tools/internal/imports/fix.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b7ccc90

Please sign in to comment.