Skip to content

Support go mod tidy #141

@t0yv0

Description

@t0yv0

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Example test:

https://github.com/pulumi/pulumi-cloudflare/blob/549739ce0e1f7fd8a6ee614a6b756e3802e1edc5/provider/provider_program_test.go#L117

Sounds like we're asking for a go mod replacement, but in case where automation updates the dependencies of the Go SDK the test starts failing with this:

go: updates to go.mod needed; to update it:
go mod tidy

Go code:

func TestAccRecordGo(t *testing.T) {
	pt := testProgram(t, "test-programs/recordgo",
		opttest.GoModReplacement("github.com/pulumi/pulumi-cloudflare/sdk/v6", "..", "sdk"))
	pt.Up(t)
	pt.Refresh(t, optrefresh.ExpectNoChanges(), optrefresh.Diff())
	pt.Up(t, optup.ExpectNoChanges())
}

Perhaps an answer could be a won't fix as presumably the automation should update the example's go.mod as well as the SDK's go.mod, but there's some friction here as the test framework is already in the business of opttest.GoModReplacement. I think it could be nice to do a go mod tidy afterward. In our use case we primarily care that the go example program works on latest, and do not care as much that it's go.mod is accurate, and only carry it as it seems to be needed/necessary.

Affected area/feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions