Let tests themselves intentionally leak temp dir (#1320)

* 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 <cole.e.helbling@outlook.com>
This commit is contained in:
John Ericson 2023-12-08 11:30:31 -05:00 committed by GitHub
parent 831021808c
commit 411e4d0c24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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'};