From 9c693145b273643c86af13b893c43ca78a0d6ec2 Mon Sep 17 00:00:00 2001 From: Bryce Lampe Date: Thu, 19 Dec 2024 14:01:17 -0800 Subject: [PATCH] Break circular dependency between provider/tests --- provider/go.mod | 8 +++----- {tests => provider/pkg}/gomega/kube.go | 0 {tests => provider/pkg}/gomega/matchers.go | 0 provider/pkg/provider/helm/v4/chart_test.go | 2 +- provider/pkg/provider/kustomize/v2/directory_test.go | 2 +- provider/pkg/provider/yaml/v2/configfile_test.go | 2 +- provider/pkg/provider/yaml/v2/configgroup_test.go | 2 +- provider/pkg/provider/yaml/v2/yaml_test.go | 2 +- tests/sdk/dotnet/dotnet_test.go | 2 +- tests/sdk/go/go_test.go | 2 +- tests/sdk/nodejs/helm_test.go | 2 +- tests/sdk/nodejs/nodejs_test.go | 2 +- tests/sdk/python/python_test.go | 8 ++++---- 13 files changed, 16 insertions(+), 18 deletions(-) rename {tests => provider/pkg}/gomega/kube.go (100%) rename {tests => provider/pkg}/gomega/matchers.go (100%) diff --git a/provider/go.mod b/provider/go.mod index 066af89f51..18ad1810b3 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -4,10 +4,7 @@ go 1.23.0 toolchain go1.23.3 -replace ( - github.com/pulumi/pulumi-kubernetes/sdk/v4 => ../sdk - github.com/pulumi/pulumi-kubernetes/tests/v4 => ../tests -) +replace github.com/pulumi/pulumi-kubernetes/sdk/v4 => ../sdk require ( github.com/evanphx/json-patch v5.7.0+incompatible @@ -22,7 +19,6 @@ require ( github.com/pkg/errors v0.9.1 github.com/pulumi/cloud-ready-checks v1.2.0 github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.19.0 - github.com/pulumi/pulumi-kubernetes/tests/v4 v4.0.0-20241219025154-c17b3653a081 github.com/pulumi/pulumi/pkg/v3 v3.143.0 github.com/pulumi/pulumi/sdk/v3 v3.143.0 github.com/stretchr/testify v1.10.0 @@ -101,6 +97,7 @@ require ( github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect @@ -217,6 +214,7 @@ require ( github.com/zclconf/go-cty v1.13.2 // indirect go.etcd.io/etcd/api/v3 v3.5.17 // indirect go.etcd.io/etcd/client/v3 v3.5.17 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.57.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.32.0 // indirect diff --git a/tests/gomega/kube.go b/provider/pkg/gomega/kube.go similarity index 100% rename from tests/gomega/kube.go rename to provider/pkg/gomega/kube.go diff --git a/tests/gomega/matchers.go b/provider/pkg/gomega/matchers.go similarity index 100% rename from tests/gomega/matchers.go rename to provider/pkg/gomega/matchers.go diff --git a/provider/pkg/provider/helm/v4/chart_test.go b/provider/pkg/provider/helm/v4/chart_test.go index 67892b756c..2acf1107dd 100644 --- a/provider/pkg/provider/helm/v4/chart_test.go +++ b/provider/pkg/provider/helm/v4/chart_test.go @@ -23,9 +23,9 @@ import ( . "github.com/onsi/gomega" //nolint:golint // dot-imports . "github.com/onsi/gomega/gstruct" //nolint:golint // dot-imports "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/clients/fake" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" kubehelm "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/helm" providerresource "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/provider/resource" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" "github.com/pulumi/pulumi/sdk/v3/go/common/resource" "github.com/pulumi/pulumi/sdk/v3/go/common/resource/plugin" pulumiprovider "github.com/pulumi/pulumi/sdk/v3/go/pulumi/provider" diff --git a/provider/pkg/provider/kustomize/v2/directory_test.go b/provider/pkg/provider/kustomize/v2/directory_test.go index 79fd47847f..9deb1b8c86 100644 --- a/provider/pkg/provider/kustomize/v2/directory_test.go +++ b/provider/pkg/provider/kustomize/v2/directory_test.go @@ -21,8 +21,8 @@ import ( . "github.com/onsi/gomega" //nolint:golint // dot-imports . "github.com/onsi/gomega/gstruct" //nolint:golint // dot-imports "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/clients/fake" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" providerresource "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/provider/resource" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" "github.com/pulumi/pulumi/sdk/v3/go/common/resource" "github.com/pulumi/pulumi/sdk/v3/go/common/resource/plugin" pulumiprovider "github.com/pulumi/pulumi/sdk/v3/go/pulumi/provider" diff --git a/provider/pkg/provider/yaml/v2/configfile_test.go b/provider/pkg/provider/yaml/v2/configfile_test.go index 27b1072687..8ca7e030dc 100644 --- a/provider/pkg/provider/yaml/v2/configfile_test.go +++ b/provider/pkg/provider/yaml/v2/configfile_test.go @@ -22,8 +22,8 @@ import ( . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/clients/fake" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" providerresource "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/provider/resource" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" "github.com/pulumi/pulumi/sdk/v3/go/common/resource" "github.com/pulumi/pulumi/sdk/v3/go/common/resource/plugin" pulumiprovider "github.com/pulumi/pulumi/sdk/v3/go/pulumi/provider" diff --git a/provider/pkg/provider/yaml/v2/configgroup_test.go b/provider/pkg/provider/yaml/v2/configgroup_test.go index d26ddfbdeb..7920b1f189 100644 --- a/provider/pkg/provider/yaml/v2/configgroup_test.go +++ b/provider/pkg/provider/yaml/v2/configgroup_test.go @@ -22,8 +22,8 @@ import ( . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/clients/fake" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" providerresource "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/provider/resource" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" "github.com/pulumi/pulumi/sdk/v3/go/common/resource" "github.com/pulumi/pulumi/sdk/v3/go/common/resource/plugin" pulumiprovider "github.com/pulumi/pulumi/sdk/v3/go/pulumi/provider" diff --git a/provider/pkg/provider/yaml/v2/yaml_test.go b/provider/pkg/provider/yaml/v2/yaml_test.go index 362352a1c4..c098490275 100644 --- a/provider/pkg/provider/yaml/v2/yaml_test.go +++ b/provider/pkg/provider/yaml/v2/yaml_test.go @@ -28,7 +28,7 @@ import ( gomegatypes "github.com/onsi/gomega/types" "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/clients" "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/clients/fake" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/pulumi/pulumi/sdk/v3/go/pulumi/internals" "github.com/stretchr/testify/assert" diff --git a/tests/sdk/dotnet/dotnet_test.go b/tests/sdk/dotnet/dotnet_test.go index 0e06853b99..6d7f0c83c0 100644 --- a/tests/sdk/dotnet/dotnet_test.go +++ b/tests/sdk/dotnet/dotnet_test.go @@ -27,9 +27,9 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/format" . "github.com/onsi/gomega/gstruct" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/openapi" "github.com/pulumi/pulumi-kubernetes/tests/v4" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" pulumirpctesting "github.com/pulumi/pulumi-kubernetes/tests/v4/pulumirpc" "github.com/pulumi/pulumi/pkg/v3/engine" "github.com/pulumi/pulumi/pkg/v3/testing/integration" diff --git a/tests/sdk/go/go_test.go b/tests/sdk/go/go_test.go index 7395b3d2b8..f1689a72c7 100644 --- a/tests/sdk/go/go_test.go +++ b/tests/sdk/go/go_test.go @@ -28,9 +28,9 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/format" . "github.com/onsi/gomega/gstruct" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/openapi" "github.com/pulumi/pulumi-kubernetes/tests/v4" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" pulumirpctesting "github.com/pulumi/pulumi-kubernetes/tests/v4/pulumirpc" "github.com/pulumi/pulumi/pkg/v3/engine" "github.com/pulumi/pulumi/pkg/v3/testing/integration" diff --git a/tests/sdk/nodejs/helm_test.go b/tests/sdk/nodejs/helm_test.go index f2de17ad4d..e03b91fae5 100644 --- a/tests/sdk/nodejs/helm_test.go +++ b/tests/sdk/nodejs/helm_test.go @@ -24,7 +24,7 @@ import ( . "github.com/onsi/gomega/gstruct" "github.com/pulumi/providertest/grpclog" "github.com/pulumi/providertest/pulumitest" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" "github.com/pulumi/pulumi/sdk/v3/go/auto" "github.com/pulumi/pulumi/sdk/v3/go/auto/optpreview" "github.com/pulumi/pulumi/sdk/v3/go/common/resource" diff --git a/tests/sdk/nodejs/nodejs_test.go b/tests/sdk/nodejs/nodejs_test.go index 578bb28d1e..23a6a8cfae 100644 --- a/tests/sdk/nodejs/nodejs_test.go +++ b/tests/sdk/nodejs/nodejs_test.go @@ -33,9 +33,9 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/format" . "github.com/onsi/gomega/gstruct" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/openapi" "github.com/pulumi/pulumi-kubernetes/tests/v4" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" pulumirpctesting "github.com/pulumi/pulumi-kubernetes/tests/v4/pulumirpc" "github.com/pulumi/pulumi/pkg/v3/engine" "github.com/pulumi/pulumi/pkg/v3/resource/deploy/providers" diff --git a/tests/sdk/python/python_test.go b/tests/sdk/python/python_test.go index 323f997ebc..8169a998be 100644 --- a/tests/sdk/python/python_test.go +++ b/tests/sdk/python/python_test.go @@ -28,9 +28,9 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/format" . "github.com/onsi/gomega/gstruct" + . "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/gomega" "github.com/pulumi/pulumi-kubernetes/provider/v4/pkg/openapi" "github.com/pulumi/pulumi-kubernetes/tests/v4" - . "github.com/pulumi/pulumi-kubernetes/tests/v4/gomega" pulumirpctesting "github.com/pulumi/pulumi-kubernetes/tests/v4/pulumirpc" "github.com/pulumi/pulumi/pkg/v3/engine" "github.com/pulumi/pulumi/pkg/v3/resource/deploy/providers" @@ -970,9 +970,9 @@ func TestOptionPropagation(t *testing.T) { // quirk: Python SDK applies resource_prefix ("chart-options") to the component itself. MatchFields(IgnoreExtras, Fields{ "Request": MatchFields(IgnoreExtras, Fields{ - "Aliases": ConsistOf( - Alias("chart-options-old"), - Alias("chart-options-chart-options-aliased"), + "Aliases": ConsistOf( + Alias("chart-options-old"), + Alias("chart-options-chart-options-aliased"), Alias(tokens.Type("kubernetes:helm.sh/v2:Chart"))), "Protect": BeTrue(), "Dependencies": ConsistOf(string(sleep.URN)),