Skip to content

Commit

Permalink
Add missing baseline provider config
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrbradley committed Jan 23, 2024
1 parent 510510c commit adb8a0b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions previewProviderUpgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,23 @@ func PreviewProviderUpgrade(pulumiTest *pulumitest.PulumiTest, providerName stri
test.T().Logf("writing grpc log to %s", grpcLogPath)
grptLog.WriteTo(grpcLogPath)
},
optrun.WithOpts(opttest.NewStackOptions(optnewstack.EnableAutoDestroy())),
optrun.WithCache(filepath.Join(cacheDir, "stack.json")),
optrun.WithOpts(options.BaselineOpts...))
optrun.WithOpts(
opttest.NewStackOptions(optnewstack.EnableAutoDestroy()),
baselineProviderOpt(options, providerName, baselineVersion)),
optrun.WithOpts(options.BaselineOpts...),
)
return previewTest.Preview()
}

func baselineProviderOpt(options optproviderupgrade.PreviewProviderUpgradeOptions, providerName string, baselineVersion string) opttest.Option {
if options.DisableAttach {
return opttest.DownloadProviderVersion(providerName, baselineVersion)
} else {
return opttest.AttachDownloadedPlugin(providerName, baselineVersion)
}
}

func getCacheDir(options optproviderupgrade.PreviewProviderUpgradeOptions, programName string, baselineVersion string) string {
var cacheDir string
for _, pathTemplateElement := range options.CacheDirTemplate {
Expand Down

0 comments on commit adb8a0b

Please sign in to comment.