Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testscript: provide WorkdirRoot as a new Params field #87

Merged
merged 1 commit into from Jan 13, 2020

Conversation

myitcv
Copy link
Collaborator

@myitcv myitcv commented Jan 7, 2020

No description provided.

@myitcv myitcv force-pushed the testscript_params_workdirroot branch from 998453b to de85f52 Compare January 8, 2020 09:32
Via testscript.Params.TestWork, it is possible for the caller to prevent
the work directories for scripts from being removed once complete.
However the work directories for testscripts are created under a
temporary directory and that working directory is not returned to the
caller of testscript.Run. This makes it impossible for the caller to
programmatically know where the resulting scripts are.

We therefore provide testscript.Params.WorkdirRoot.

WorkdirRoot specifies the directory within which scripts' work
directories will be created. Setting WorkdirRoot implies TestWork=true.
If empty, the work directories will be created inside
$GOTMPDIR/go-test-script*, where $GOTMPDIR defaults to os.TempDir().

Also fix a bug whereby the value of $WORK was not printed as part of the
verbose mode env when Params.TestWork was specified. i.e. it was
impossible to see what the working directory was because all instances
of the working directory value are replaced with the literal $WORK.
Copy link
Owner

@rogpeppe rogpeppe left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@myitcv myitcv merged commit bc89b17 into master Jan 13, 2020
@myitcv myitcv deleted the testscript_params_workdirroot branch January 13, 2020 18:21
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.

None yet

2 participants