Skip to content

Commit

Permalink
Let tests themselves intentionally leak temp dir
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ericson2314 committed Dec 8, 2023
1 parent 91bbd53 commit 9d87d81
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 ill 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 9d87d81

Please sign in to comment.