remove gotest deps
Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
		
							parent
							
								
									9e9567ed7d
								
							
						
					
					
						commit
						a0d4047cc7
					
				
							
								
								
									
										42
									
								
								go.mod
								
								
								
								
							
							
						
						
									
										42
									
								
								go.mod
								
								
								
								
							|  | @ -31,8 +31,6 @@ require ( | |||
| 	go.uber.org/zap v1.19.0 | ||||
| 	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c | ||||
| 	gopkg.in/yaml.v2 v2.4.0 | ||||
| 	gotest.tools v2.2.0+incompatible | ||||
| 	gotest.tools/v3 v3.0.3 | ||||
| 	k8s.io/apimachinery v0.23.4 | ||||
| ) | ||||
| 
 | ||||
|  | @ -40,15 +38,14 @@ require ( | |||
| 	cloud.google.com/go v0.100.2 // indirect | ||||
| 	cloud.google.com/go/compute v1.3.0 // indirect | ||||
| 	cloud.google.com/go/iam v0.1.0 // indirect | ||||
| 	cloud.google.com/go/secretmanager v1.3.0 // indirect | ||||
| 	cloud.google.com/go/storage v1.15.0 // indirect | ||||
| 	filippo.io/age v1.0.0-beta7 // indirect | ||||
| 	github.com/Azure/azure-pipeline-go v0.2.3 // indirect | ||||
| 	github.com/Azure/azure-sdk-for-go v56.2.0+incompatible // indirect | ||||
| 	github.com/Azure/azure-sdk-for-go v56.3.0+incompatible // indirect | ||||
| 	github.com/Azure/azure-storage-blob-go v0.14.0 // indirect | ||||
| 	github.com/Azure/go-autorest v14.2.0+incompatible // indirect | ||||
| 	github.com/Azure/go-autorest/autorest v0.11.19 // indirect | ||||
| 	github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect | ||||
| 	github.com/Azure/go-autorest/autorest v0.11.20 // indirect | ||||
| 	github.com/Azure/go-autorest/autorest/adal v0.9.15 // indirect | ||||
| 	github.com/Azure/go-autorest/autorest/azure/auth v0.5.8 // indirect | ||||
| 	github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 // indirect | ||||
| 	github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect | ||||
|  | @ -57,16 +54,17 @@ require ( | |||
| 	github.com/Azure/go-autorest/logger v0.2.1 // indirect | ||||
| 	github.com/Azure/go-autorest/tracing v0.6.0 // indirect | ||||
| 	github.com/Masterminds/goutils v1.1.1 // indirect | ||||
| 	github.com/Microsoft/go-winio v0.5.1 // indirect | ||||
| 	github.com/alecthomas/participle v0.4.2-0.20191220090139-9fbceec1d131 // indirect | ||||
| 	github.com/aws/aws-sdk-go v1.40.28 // indirect | ||||
| 	github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect | ||||
| 	github.com/blang/semver v3.5.1+incompatible // indirect | ||||
| 	github.com/containerd/continuity v0.1.0 // indirect | ||||
| 	github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect | ||||
| 	github.com/dimchansky/utfbom v1.1.1 // indirect | ||||
| 	github.com/fatih/color v1.13.0 // indirect | ||||
| 	github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect | ||||
| 	github.com/frankban/quicktest v1.14.3 // indirect | ||||
| 	github.com/fujiwara/tfstate-lookup v0.4.0 // indirect | ||||
| 	github.com/golang-jwt/jwt/v4 v4.0.0 // indirect | ||||
| 	github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||||
| 	github.com/golang/protobuf v1.5.2 // indirect | ||||
| 	github.com/golang/snappy v0.0.3 // indirect | ||||
|  | @ -78,7 +76,6 @@ require ( | |||
| 	github.com/hashicorp/go-cleanhttp v0.5.2 // indirect | ||||
| 	github.com/hashicorp/go-hclog v1.0.0 // indirect | ||||
| 	github.com/hashicorp/go-multierror v1.1.0 // indirect | ||||
| 	github.com/hashicorp/go-retryablehttp v0.6.3 // indirect | ||||
| 	github.com/hashicorp/go-rootcerts v1.0.2 // indirect | ||||
| 	github.com/hashicorp/go-safetemp v1.0.0 // indirect | ||||
| 	github.com/hashicorp/go-slug v0.7.0 // indirect | ||||
|  | @ -89,26 +86,25 @@ require ( | |||
| 	github.com/hashicorp/jsonapi v0.0.0-20210518035559-1e50d74c8db3 // indirect | ||||
| 	github.com/hashicorp/vault/api v1.0.4 // indirect | ||||
| 	github.com/hashicorp/vault/sdk v0.1.14-0.20200215224050-f6547fa8e820 // indirect | ||||
| 	github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c // indirect | ||||
| 	github.com/huandu/xstrings v1.3.1 // indirect | ||||
| 	github.com/huandu/xstrings v1.3.2 // indirect | ||||
| 	github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||||
| 	github.com/itchyny/gojq v0.9.0 // indirect | ||||
| 	github.com/jmespath/go-jmespath v0.4.0 // indirect | ||||
| 	github.com/klauspost/compress v1.13.6 // indirect | ||||
| 	github.com/lestrrat-go/strftime v1.0.1 // indirect | ||||
| 	github.com/lib/pq v1.2.0 // indirect | ||||
| 	github.com/lib/pq v1.10.4 // indirect | ||||
| 	github.com/mattn/go-colorable v0.1.12 // indirect | ||||
| 	github.com/mattn/go-ieproxy v0.0.1 // indirect | ||||
| 	github.com/mattn/go-runewidth v0.0.8 // indirect | ||||
| 	github.com/mitchellh/copystructure v1.0.0 // indirect | ||||
| 	github.com/mattn/go-runewidth v0.0.9 // indirect | ||||
| 	github.com/mitchellh/copystructure v1.2.0 // indirect | ||||
| 	github.com/mitchellh/go-homedir v1.1.0 // indirect | ||||
| 	github.com/mitchellh/go-testing-interface v1.0.0 // indirect | ||||
| 	github.com/mitchellh/go-wordwrap v1.0.0 // indirect | ||||
| 	github.com/mitchellh/mapstructure v1.4.3 // indirect | ||||
| 	github.com/mitchellh/reflectwalk v1.0.0 // indirect | ||||
| 	github.com/mitchellh/reflectwalk v1.0.2 // indirect | ||||
| 	github.com/opencontainers/runc v1.0.2 // indirect | ||||
| 	github.com/otiai10/copy v1.1.1 // indirect | ||||
| 	github.com/pbnjay/strptime v0.0.0-20140226051138-5c05b0d668c9 // indirect | ||||
| 	github.com/pierrec/lz4 v2.3.0+incompatible // indirect | ||||
| 	github.com/pkg/errors v0.9.1 // indirect | ||||
| 	github.com/pmezard/go-difflib v1.0.0 // indirect | ||||
| 	github.com/russross/blackfriday/v2 v2.1.0 // indirect | ||||
|  | @ -118,18 +114,19 @@ require ( | |||
| 	github.com/sirupsen/logrus v1.8.1 // indirect | ||||
| 	github.com/spf13/cast v1.4.1 // indirect | ||||
| 	github.com/spf13/pflag v1.0.5 // indirect | ||||
| 	github.com/stretchr/objx v0.2.0 // indirect | ||||
| 	github.com/ulikunitz/xz v0.5.8 // indirect | ||||
| 	go.mozilla.org/gopgagent v0.0.0-20170926210634-4d7ea76ff71a // indirect | ||||
| 	go.mozilla.org/sops/v3 v3.7.1 // indirect | ||||
| 	go.opencensus.io v0.23.0 // indirect | ||||
| 	go.uber.org/atomic v1.7.0 // indirect | ||||
| 	golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect | ||||
| 	golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect | ||||
| 	golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect | ||||
| 	golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect | ||||
| 	golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect | ||||
| 	golang.org/x/text v0.3.7 // indirect | ||||
| 	golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect | ||||
| 	golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff // indirect | ||||
| 	golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect | ||||
| 	google.golang.org/api v0.70.0 // indirect | ||||
| 	google.golang.org/appengine v1.6.7 // indirect | ||||
|  | @ -137,9 +134,18 @@ require ( | |||
| 	google.golang.org/grpc v1.44.0 // indirect | ||||
| 	google.golang.org/protobuf v1.27.1 // indirect | ||||
| 	gopkg.in/ini.v1 v1.66.2 // indirect | ||||
| 	gopkg.in/square/go-jose.v2 v2.3.1 // indirect | ||||
| 	gopkg.in/square/go-jose.v2 v2.5.1 // indirect | ||||
| 	gopkg.in/urfave/cli.v1 v1.20.0 // indirect | ||||
| 	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect | ||||
| 	sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect | ||||
| 	sigs.k8s.io/yaml v1.3.0 // indirect | ||||
| ) | ||||
| 
 | ||||
| require ( | ||||
| 	cloud.google.com/go/secretmanager v1.3.0 // indirect | ||||
| 	github.com/frankban/quicktest v1.14.3 // indirect | ||||
| 	github.com/hashicorp/go-retryablehttp v0.6.3 // indirect | ||||
| 	github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c // indirect | ||||
| 	github.com/pierrec/lz4 v2.3.0+incompatible // indirect | ||||
| 	golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 | ||||
| ) | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ import ( | |||
| 	"github.com/roboll/helmfile/pkg/remote" | ||||
| 	"github.com/roboll/helmfile/pkg/testutil" | ||||
| 
 | ||||
| 	"gotest.tools/v3/assert" | ||||
| 	"github.com/stretchr/testify/assert" | ||||
| 
 | ||||
| 	"github.com/roboll/helmfile/pkg/exectest" | ||||
| 
 | ||||
|  | @ -30,7 +30,6 @@ import ( | |||
| 	"github.com/roboll/helmfile/pkg/testhelper" | ||||
| 
 | ||||
| 	"go.uber.org/zap" | ||||
| 	"gotest.tools/v3/env" | ||||
| ) | ||||
| 
 | ||||
| func appWithFs(app *App, files map[string]string) *App { | ||||
|  | @ -637,7 +636,8 @@ releases: | |||
| 		{label: "name=doesnotexists", expectedReleases: []string{"zipkin", "prometheus", "grafana", "bar", "bar", "grafana", "postgresql"}, expectErr: false}, | ||||
| 	} | ||||
| 
 | ||||
| 	defer env.Patch(t, ExperimentalEnvVar, ExperimentalSelectorExplicit)() | ||||
| 	os.Setenv(ExperimentalEnvVar, ExperimentalSelectorExplicit) | ||||
| 	defer os.Unsetenv(ExperimentalEnvVar) | ||||
| 
 | ||||
| 	runFilterSubHelmFilesTests(desiredTestcases, files, t, "2nd EmbeddedSelectors") | ||||
| 
 | ||||
|  | @ -686,7 +686,8 @@ releases: | |||
| 		{label: "name!=grafana", expectedReleases: []string{"grafana", "zipkin", "mongodb"}, expectErr: false}, | ||||
| 	} | ||||
| 
 | ||||
| 	defer env.Patch(t, ExperimentalEnvVar, ExperimentalSelectorExplicit)() | ||||
| 	os.Setenv(ExperimentalEnvVar, ExperimentalSelectorExplicit) | ||||
| 	defer os.Unsetenv(ExperimentalEnvVar) | ||||
| 
 | ||||
| 	runFilterSubHelmFilesTests(desiredTestcases, files, t, "2nd 3leveldeep") | ||||
| 
 | ||||
|  | @ -747,7 +748,8 @@ releases: | |||
| 		{label: "select!=foo", expectedReleases: []string{"grafana", "prometheus", "zipkin", "prometheus", "zipkin", "mongodb"}, expectErr: false}, | ||||
| 	} | ||||
| 
 | ||||
| 	defer env.Patch(t, ExperimentalEnvVar, ExperimentalSelectorExplicit)() | ||||
| 	os.Setenv(ExperimentalEnvVar, ExperimentalSelectorExplicit) | ||||
| 	defer os.Unsetenv(ExperimentalEnvVar) | ||||
| 
 | ||||
| 	runFilterSubHelmFilesTests(desiredTestcases, files, t, "2nd inherits") | ||||
| 
 | ||||
|  | @ -4702,13 +4704,13 @@ releases: | |||
| 
 | ||||
| 	out := testutil.CaptureStdout(func() { | ||||
| 		err := app.PrintState(configImpl{}) | ||||
| 		assert.NilError(t, err) | ||||
| 		assert.Nil(t, err) | ||||
| 	}) | ||||
| 	assert.Assert(t, strings.Count(out, "---") == 1, | ||||
| 	assert.True(t, strings.Count(out, "---") == 1, | ||||
| 		"state should contain '---' yaml doc separator:\n%s\n", out) | ||||
| 	assert.Assert(t, strings.Contains(out, "helmfile.yaml"), | ||||
| 	assert.True(t, strings.Contains(out, "helmfile.yaml"), | ||||
| 		"state should contain source helmfile name:\n%s\n", out) | ||||
| 	assert.Assert(t, strings.Contains(out, "name: myrelease1"), | ||||
| 	assert.True(t, strings.Contains(out, "name: myrelease1"), | ||||
| 		"state should contain releases:\n%s\n", out) | ||||
| } | ||||
| 
 | ||||
|  | @ -4749,13 +4751,13 @@ releases: | |||
| 
 | ||||
| 	out := testutil.CaptureStdout(func() { | ||||
| 		err := app.PrintState(configImpl{}) | ||||
| 		assert.NilError(t, err) | ||||
| 		assert.Nil(t, err) | ||||
| 	}) | ||||
| 	assert.Assert(t, strings.Count(out, "---") == 2, | ||||
| 	assert.True(t, strings.Count(out, "---") == 2, | ||||
| 		"state should contain '---' yaml doc separators:\n%s\n", out) | ||||
| 	assert.Assert(t, strings.Contains(out, "second.yaml"), | ||||
| 	assert.True(t, strings.Contains(out, "second.yaml"), | ||||
| 		"state should contain source helmfile name:\n%s\n", out) | ||||
| 	assert.Assert(t, strings.Contains(out, "second.yaml"), | ||||
| 	assert.True(t, strings.Contains(out, "second.yaml"), | ||||
| 		"state should contain source helmfile name:\n%s\n", out) | ||||
| } | ||||
| 
 | ||||
|  | @ -4810,7 +4812,7 @@ releases: | |||
| 
 | ||||
| 	out := testutil.CaptureStdout(func() { | ||||
| 		err := app.ListReleases(configImpl{}) | ||||
| 		assert.NilError(t, err) | ||||
| 		assert.Nil(t, err) | ||||
| 	}) | ||||
| 
 | ||||
| 	expected := `NAME      	NAMESPACE	ENABLED	INSTALLED	LABELS                    	CHART   	VERSION | ||||
|  | @ -4874,7 +4876,7 @@ releases: | |||
| 		err := app.ListReleases(configImpl{ | ||||
| 			output: "json", | ||||
| 		}) | ||||
| 		assert.NilError(t, err) | ||||
| 		assert.Nil(t, err) | ||||
| 	}) | ||||
| 
 | ||||
| 	expected := `[{"name":"myrelease1","namespace":"","enabled":true,"installed":false,"labels":"id:myrelease1","chart":"mychart1","version":""},{"name":"myrelease2","namespace":"","enabled":false,"installed":true,"labels":"","chart":"mychart1","version":""},{"name":"myrelease3","namespace":"","enabled":true,"installed":true,"labels":"","chart":"mychart1","version":""},{"name":"myrelease4","namespace":"","enabled":true,"installed":true,"labels":"id:myrelease1","chart":"mychart1","version":""}] | ||||
|  |  | |||
|  | @ -12,8 +12,7 @@ import ( | |||
| 	"github.com/roboll/helmfile/pkg/testhelper" | ||||
| 	"go.uber.org/zap" | ||||
| 
 | ||||
| 	. "gotest.tools/v3/assert" | ||||
| 	"gotest.tools/v3/assert/cmp" | ||||
| 	"github.com/stretchr/testify/require" | ||||
| ) | ||||
| 
 | ||||
| func createFromYaml(content []byte, file string, env string, logger *zap.SugaredLogger) (*HelmState, error) { | ||||
|  | @ -486,6 +485,6 @@ func TestReadFromYaml_Helmfiles_Selectors(t *testing.T) { | |||
| 				t.Error("unexpected error:", err) | ||||
| 			} | ||||
| 		} | ||||
| 		Assert(t, cmp.DeepEqual(st.Helmfiles, test.helmfiles), "for path %v", test.path) | ||||
| 		require.Equalf(t, test.helmfiles, st.Helmfiles, "for path %s", test.path) | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue