Skip to content

Commit

Permalink
Use new test
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe committed Oct 14, 2022
1 parent 11101d0 commit fde08cc
Show file tree
Hide file tree
Showing 8 changed files with 595 additions and 71 deletions.
2 changes: 0 additions & 2 deletions tests/integration/construct_component/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ go 1.18

require github.com/pulumi/pulumi/sdk/v3 v3.40.1

replace github.com/pulumi/pulumi/sdk/v3 => ../../../../sdk

require (
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/construct_component/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/pulumi/pulumi/sdk/v3 v3.40.1 h1:PLKYHyRffrO9nNfidDGGr2xkf8G0wjtSZx1Zj7OwyyA=
github.com/pulumi/pulumi/sdk/v3 v3.40.1/go.mod h1:tSNA8Z+GnEjMxH+qtrfcwpmOQj7mTPTAmJUhwvuox5I=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
Expand Down
59 changes: 0 additions & 59 deletions tests/integration/construct_component/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,6 @@ func NewComponent(
return &resource, nil
}

func NewSecondComponent(
ctx *pulumi.Context, name string, args *ComponentArgs, opts ...pulumi.ResourceOption) (*Component, error) {

var resource Component
err := ctx.RegisterRemoteComponentResource("secondtestcomponent:index:Component", name, args, &resource, opts...)
if err != nil {
return nil, err
}

return &resource, nil
}

func NewComponentComponent(
ctx *pulumi.Context, name string, opts ...pulumi.ResourceOption) (*Component, error) {

var resource Component
err := ctx.RegisterRemoteComponentResource("secondtestcomponent:index:ComponentComponent", name, pulumi.Map{}, &resource, opts...)
if err != nil {
return nil, err
}

return &resource, nil
}

type provider struct {
pulumi.ProviderResourceState
expectResourceArg pulumi.Bool
}

type LocalComponent struct{ pulumi.ResourceState }

func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
componentA, err := NewComponent(ctx, "a", &ComponentArgs{Echo: pulumi.Int(42)})
Expand All @@ -87,34 +56,6 @@ func main() {
if err != nil {
return err
}

provider := &provider{}
err = ctx.RegisterResource("pulumi:providers:testcomponent", "provider", pulumi.Map{
"expectResourceArg": pulumi.Bool(true),
}, provider)
if err != nil {
return err
}
localComponent := &LocalComponent{}
err = ctx.RegisterComponentResource("pkg:index:LocalComponent", "localComponent", localComponent, pulumi.Providers(provider))
if err != nil {
return err
}
parentProvider := pulumi.Parent(localComponent)
_, err = NewComponent(ctx, "checkProvider1",
&ComponentArgs{Echo: pulumi.String("checkExpected")}, parentProvider)
if err != nil {
return err
}
_, err = NewSecondComponent(ctx, "checkProvider2",
&ComponentArgs{Echo: pulumi.String("checkExpected")}, parentProvider)
if err != nil {
return err
}
_, err = NewComponentComponent(ctx, "checkProvider12", parentProvider)
if err != nil {
return err
}
return nil
})
}
3 changes: 3 additions & 0 deletions tests/integration/construct_nested_component/go/Pulumi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: construct_component_go
description: A program that constructs remote component resources.
runtime: go
68 changes: 68 additions & 0 deletions tests/integration/construct_nested_component/go/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
module github.com/pulumi/pulumi/tests/construct_component

go 1.18

require github.com/pulumi/pulumi/sdk/v3 v3.40.1

replace github.com/pulumi/pulumi/sdk/v3 => ../../../../sdk

require (
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/cheggaaa/pb v1.0.29 // indirect
github.com/djherbis/times v1.5.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/go-git/go-git/v5 v5.4.2 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/opentracing/basictracer-go v1.1.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/spf13/cobra v1.5.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.0 // indirect
github.com/texttheater/golang-levenshtein v1.0.1 // indirect
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
github.com/xanzy/ssh-agent v0.3.2 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.0.0-20220824171710-5757bc0c5503 // indirect
golang.org/x/net v0.0.0-20220325170049-de3da57026de // indirect
golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20220405205423-9d709892a2bf // indirect
google.golang.org/grpc v1.49.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
lukechampine.com/frand v1.4.2 // indirect
sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600 // indirect
)

0 comments on commit fde08cc

Please sign in to comment.