Skip to content

Consider logging Pulumi and Pulumi Plugins versions #161

@pose

Description

@pose

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

When running tests, it may be useful to know what version of pulumi is the test framework using. For instance, while I was debugging some tests, I added the following snippet:

	test := pulumitest.NewPulumiTest(t, "testdata/my_program")

	versionCmd := test.CurrentStack().Workspace().PulumiCommand()
	version, _, _, err := versionCmd.Run(test.Context(), test.WorkingDir(), nil, nil, nil, nil, "version")
	contract.AssertNoErrorf(err, "failed to get pulumi version: %s", version)
	t.Logf("pulumi version: %s", version)

	plugins, _, _, err := versionCmd.Run(test.Context(), test.WorkingDir(), nil, nil, nil, nil, "plugin", "ls", "-p")
	contract.AssertNoErrorf(err, "failed to get pulumi plugins: %s", plugins)
	t.Logf("pulumi plugins: %s", plugins)

However, this could already be offered by the test framework itself. It could either be printed always or when a verbose/diagnose mode is triggered. The main benefit would be reducing the amount of times the tests need to be run to gather this information (shortening the feedback loop).

Sample Output

    grpcLog_test.go:20: pulumi version: v3.209.0-alpha.x310407f
    grpcLog_test.go:24: pulumi plugins: NAME    KIND      VERSION  SIZE    INSTALLED    LAST USED
        random  resource  4.18.4   47 MB   5 days ago   5 days ago
        yaml    language           247 MB  2 hours ago  2 hours ago

Affected area/feature

Test Authoring

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions