Skip to content

Build codegen tests against the local Pulumi SDK - #1032

Draft
i-am-tom wants to merge 3 commits into
mainfrom
claude/vibrant-babbage-ea0070
Draft

Build codegen tests against the local Pulumi SDK#1032
i-am-tom wants to merge 3 commits into
mainfrom
claude/vibrant-babbage-ea0070

Conversation

@i-am-tom

Copy link
Copy Markdown
Contributor

Summary

Replaces the pinned NuGet Pulumi PackageReference in the codegen tests with a ProjectReference to this repo's sdk/Pulumi/Pulumi.csproj. The PulumiDotnetSDKVersion constant is removed.

Why

The constant required a manual bump on every release (e.g. #1030), and — more importantly — meant TestGenerateProgram was validating generated code against a previously published SDK rather than the source tree being modified in the PR. With a project reference, the test always exercises the current SDK.

Changes

  • gen_program_test.go: replace dep{"Pulumi", PulumiDotnetSDKVersion}.install(...) with dotnet add reference <abs-path>/sdk/Pulumi/Pulumi.csproj.
  • Delete the now-unused constant and the dead if/else (both branches did the same thing).
  • Pass -p:NuGetAudit=false to the test's dotnet build. The test verifies codegen compiles; dependency-graph CVEs are the job of dedicated audit/build jobs in CI. Without this, transitive vulnerabilities surfaced by NuGet audit (e.g. the current OpenTelemetry.Exporter.OpenTelemetryProtocol 1.9.0 GHSA-4625-4j76-fww9) would fail the codegen test for unrelated reasons.

Test plan

  • make format_language_host_check && make lint_language_host
  • Spot-checked TestGenerateProgram/{assets-archives,aws-eks,kubernetes-pod,simple-resource-schema,throw-not-implemented} — all pass against the local SDK
  • Full make test_codegen in CI

🤖 Generated with Claude Code

i-am-tom and others added 3 commits April 29, 2026 14:57
The codegen test in `pulumi-language-dotnet/codegen/gen_program_test.go`
used to pin a published NuGet version of `Pulumi` via a `PulumiDotnetSDKVersion`
constant. That required a manual bump on every release (e.g. #1030), and meant
generated programs were never validated against the SDK source actually being
modified in the PR.

Replace the `dotnet add package Pulumi --version X` step with
`dotnet add reference <repo>/sdk/Pulumi/Pulumi.csproj`, so the test always
compiles against the in-tree SDK. The constant is gone for good.

Also disable NuGet audit on the test build (`-p:NuGetAudit=false`): this test
exercises codegen compilation, not the dependency graph's CVE posture, which
is covered by other CI jobs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant