Skip to content

Commit

Permalink
Let tests themselves intentionally leak temp dir (#1320)
Browse files Browse the repository at this point in the history
* Let tests themselves intentionally leak temp dir

By default Yath will clean up temporary files, so the result is the
same. But `--keep-dirs` can be passed to `yath test` telling Yath to
*not* clean them up instead. This is very useful for debugging.

* Update t/lib/HydraTestContext.pm

Co-authored-by: Cole Helbling <[email protected]>
  • Loading branch information
Ericson2314 and cole-h committed Dec 8, 2023
1 parent 8310218 commit 411e4d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion t/lib/HydraTestContext.pm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ use Hydra::Helper::Exec;
sub new {
my ($class, %opts) = @_;

my $dir = File::Temp->newdir();
# Cleanup will be managed by yath. By the default it will be cleaned
# up, but can be kept to aid in debugging test failures.
my $dir = File::Temp->newdir(CLEANUP => 0);

$ENV{'HYDRA_DATA'} = "$dir/hydra-data";
mkdir $ENV{'HYDRA_DATA'};
Expand Down

0 comments on commit 411e4d0

Please sign in to comment.