Skip to content

Conversation

@danielrbradley
Copy link
Contributor

@danielrbradley danielrbradley commented Mar 17, 2025

Make it easy to use a local temp directory for better debugging.

Readme extract

By default, your program is copied to a temporary directory before running to avoid modifying your source files or cluttering your working directory with temporary files. This will use an OS-specific temporary location by default but can be set to a custom directory using the opttest.TempDir(dir) option. Using an ignored directory within your repository can be useful for being able to locate any left-over folders retained from failed tests:

test := NewPulumiTest(t, filepath.Join("path", "to", "program"), opttest.TempDir(".temp"))

Make it easy to use a local temp directory for better debugging.

- Check python install process works for python (re: #124)
- Use same 0755 permissions for all Mkdir calls.
Copy link
Contributor

@thomas11 thomas11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use case isn't clear to me yet.

being able to locate any left-over folders retained from failed tests

Why can we not locate them in the temp dir? The dir is logged, no?

@danielrbradley
Copy link
Contributor Author

The use case isn't clear to me yet.

being able to locate any left-over folders retained from failed tests

Why can we not locate them in the temp dir? The dir is logged, no?

You can identify them via the logs, but it's a little more handy if the directory shows up directly in your IDE file tree rather than having to open a new IDE from the command line having copied and pasted the path (after distinguishing the right one in the logs). With VSCode too it's a little annoying as you get a security prompt when opening any new directory now too.

@danielrbradley
Copy link
Contributor Author

Oh, also, this could actually be very useful too when running in CI - to write to a predictable location that we can then grab as a workflow asset on failure so we can see the failed scenario (and perhaps manually clean up if required).

@danielrbradley danielrbradley merged commit 46b58c1 into main Mar 17, 2025
2 checks passed
@danielrbradley danielrbradley deleted the custom-temp-dir branch March 17, 2025 11:16
@pulumi-bot
Copy link

This PR has been shipped in release v0.1.6.

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.

3 participants