From cf15c6a206793b04ec9fe38b5d3cbb7238d45900 Mon Sep 17 00:00:00 2001 From: Martin Gencur Date: Wed, 11 Oct 2023 07:52:09 +0200 Subject: [PATCH] Update knative.dev/pkg --- go.mod | 4 ++-- go.sum | 4 ++-- vendor/knative.dev/pkg/test/shell/executor.go | 21 ++++++++----------- .../pkg/test/shell/fail-example.sh | 2 +- vendor/knative.dev/pkg/test/shell/prefixer.go | 2 +- vendor/knative.dev/pkg/test/shell/project.go | 2 +- vendor/knative.dev/pkg/test/shell/types.go | 14 ++++++------- vendor/modules.txt | 4 ++-- 8 files changed, 25 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index d5e77c60f3f0..905636eb2486 100644 --- a/go.mod +++ b/go.mod @@ -35,7 +35,7 @@ require ( knative.dev/caching v0.0.0-20231003123851-6c2d45f61892 knative.dev/hack v0.0.0-20230926181829-f2f9b6f91263 knative.dev/networking v0.0.0-20231004065302-53ba1f44ef7a - knative.dev/pkg v0.0.0-20231009134048-bae23eb35759 + knative.dev/pkg v0.0.0-20231010144348-ca8c009405dd sigs.k8s.io/yaml v1.3.0 ) @@ -154,4 +154,4 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) -replace knative.dev/pkg => github.com/mgencur/pkg v0.0.0-20231010091720-974d18ba37f9 +replace knative.dev/pkg => github.com/mgencur/pkg v0.0.0-20231011054611-64dda1efdfa8 diff --git a/go.sum b/go.sum index 43cf53bfefc6..fdd48b26d9a4 100644 --- a/go.sum +++ b/go.sum @@ -382,8 +382,8 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mgencur/pkg v0.0.0-20231010091720-974d18ba37f9 h1:u81aWjeVcnmXB5YJ8Z6/c24lvC9ozXJdsh/Og87jm/o= -github.com/mgencur/pkg v0.0.0-20231010091720-974d18ba37f9/go.mod h1:PxnS8ZnVtC0S+An+NEhrpzWt6k9hedDNt659Gu5EtJk= +github.com/mgencur/pkg v0.0.0-20231011054611-64dda1efdfa8 h1:uEpGV3JOo6uQqtKdRvfJbzKhBdry2bANQBjWctri1QE= +github.com/mgencur/pkg v0.0.0-20231011054611-64dda1efdfa8/go.mod h1:PxnS8ZnVtC0S+An+NEhrpzWt6k9hedDNt659Gu5EtJk= github.com/miekg/dns v1.1.55 h1:GoQ4hpsj0nFLYe+bWiCToyrBEJXkQfOOIvFGFy0lEgo= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= diff --git a/vendor/knative.dev/pkg/test/shell/executor.go b/vendor/knative.dev/pkg/test/shell/executor.go index 04c76401c4d0..f347321ad715 100644 --- a/vendor/knative.dev/pkg/test/shell/executor.go +++ b/vendor/knative.dev/pkg/test/shell/executor.go @@ -5,7 +5,7 @@ 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 - https://www.apache.org/licenses/LICENSE-2.0 + 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, @@ -23,7 +23,6 @@ import ( "os" "os/exec" "strings" - "testing" "time" ) @@ -46,10 +45,11 @@ func NewExecutor(config ExecutorConfig) Executor { // TestingTStreams returns Streams which writes to t.Log and marks // the test as failed if anything is written to Streams.Err. -func TestingTStreams(t testing.TB) Streams { +func TestingTStreams(t TestingT) Streams { + tWriter := testingWriter{t: t} return Streams{ - Out: testingWriter{t: t}, - Err: testingWriter{t: t, markFailed: true}, + Out: tWriter, + Err: tWriter, } } @@ -160,10 +160,10 @@ func withTempScript(contents string, fn func(bin string) error) error { if err != nil { return err } - //defer func() { - // // clean up - // _ = os.Remove(tmpfile.Name()) - //}() + defer func() { + // clean up + _ = os.Remove(tmpfile.Name()) + }() return fn(tmpfile.Name()) } @@ -205,9 +205,6 @@ func (w testingWriter) Write(p []byte) (n int, err error) { p = bytes.TrimRight(p, "\n") w.t.Logf("%s", p) - if w.markFailed { - w.t.Fail() - } return n, nil } diff --git a/vendor/knative.dev/pkg/test/shell/fail-example.sh b/vendor/knative.dev/pkg/test/shell/fail-example.sh index 551ce662a340..4815aef9de1a 100644 --- a/vendor/knative.dev/pkg/test/shell/fail-example.sh +++ b/vendor/knative.dev/pkg/test/shell/fail-example.sh @@ -6,7 +6,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# https://www.apache.org/licenses/LICENSE-2.0 +# 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, diff --git a/vendor/knative.dev/pkg/test/shell/prefixer.go b/vendor/knative.dev/pkg/test/shell/prefixer.go index 273ee1cc4fff..f267c1e3b42f 100644 --- a/vendor/knative.dev/pkg/test/shell/prefixer.go +++ b/vendor/knative.dev/pkg/test/shell/prefixer.go @@ -5,7 +5,7 @@ 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 - https://www.apache.org/licenses/LICENSE-2.0 + 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, diff --git a/vendor/knative.dev/pkg/test/shell/project.go b/vendor/knative.dev/pkg/test/shell/project.go index 498cc3490373..2d5ded547c70 100644 --- a/vendor/knative.dev/pkg/test/shell/project.go +++ b/vendor/knative.dev/pkg/test/shell/project.go @@ -5,7 +5,7 @@ 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 - https://www.apache.org/licenses/LICENSE-2.0 + 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, diff --git a/vendor/knative.dev/pkg/test/shell/types.go b/vendor/knative.dev/pkg/test/shell/types.go index 58aa745e23e3..36e9af3af977 100644 --- a/vendor/knative.dev/pkg/test/shell/types.go +++ b/vendor/knative.dev/pkg/test/shell/types.go @@ -5,7 +5,7 @@ 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 - https://www.apache.org/licenses/LICENSE-2.0 + 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, @@ -18,7 +18,6 @@ package shell import ( "io" - "testing" ) // ProjectLocation represents a project location on a file system. @@ -47,13 +46,14 @@ type ExecutorConfig struct { Environ []string } +// TestingT is used by testingWriter and allows passing testing.T. +type TestingT interface { + Logf(args ...any) +} + // testingWriter writes to the given testing.TB. type testingWriter struct { - t testing.TB - - // If true, the test will be marked as failed if this testingWriter is - // ever used. - markFailed bool + t TestingT } // StreamType represets either output or error stream. diff --git a/vendor/modules.txt b/vendor/modules.txt index 3960017a0d2e..325f2f7cbff4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1339,7 +1339,7 @@ knative.dev/networking/pkg/http/stats knative.dev/networking/pkg/ingress knative.dev/networking/pkg/k8s knative.dev/networking/pkg/prober -# knative.dev/pkg v0.0.0-20231009134048-bae23eb35759 => github.com/mgencur/pkg v0.0.0-20231010091720-974d18ba37f9 +# knative.dev/pkg v0.0.0-20231010144348-ca8c009405dd => github.com/mgencur/pkg v0.0.0-20231011054611-64dda1efdfa8 ## explicit; go 1.18 knative.dev/pkg/apiextensions/storageversion knative.dev/pkg/apiextensions/storageversion/cmd/migrate @@ -1469,4 +1469,4 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# knative.dev/pkg => github.com/mgencur/pkg v0.0.0-20231010091720-974d18ba37f9 +# knative.dev/pkg => github.com/mgencur/pkg v0.0.0-20231011054611-64dda1efdfa8