captureStdoutStderr*: move to Hydra::Helper::Exec which helps avoid some environment variable fixation problems

This commit is contained in:
Graham Christensen
2022-02-09 13:40:51 -05:00
parent 1abe7f4d80
commit 845e6d4760
16 changed files with 54 additions and 50 deletions

View File

@ -2,35 +2,15 @@ use warnings;
use strict;
package CliRunners;
use Hydra::Helper::Exec;
our @ISA = qw(Exporter);
our @EXPORT = qw(
captureStdoutStderr
captureStdoutStderrWithStdin
evalFails
evalSucceeds
runBuild
sendNotifications
);
sub captureStdoutStderr {
# "Lazy"-load Hydra::Helper::Nix to avoid the compile-time
# import of Hydra::Model::DB. Early loading of the DB class
# causes fixation of the DSN, and we need to fixate it after
# the temporary DB is setup.
require Hydra::Helper::Nix;
return Hydra::Helper::Nix::captureStdoutStderr(@_)
}
sub captureStdoutStderrWithStdin {
# "Lazy"-load Hydra::Helper::Nix to avoid the compile-time
# import of Hydra::Model::DB. Early loading of the DB class
# causes fixation of the DSN, and we need to fixate it after
# the temporary DB is setup.
require Hydra::Helper::Nix;
return Hydra::Helper::Nix::captureStdoutStderrWithStdin(@_)
}
sub evalSucceeds {
my ($jobset) = @_;
my ($res, $stdout, $stderr) = captureStdoutStderr(60, ("hydra-eval-jobset", $jobset->project->name, $jobset->name));

View File

@ -8,12 +8,11 @@ use File::Temp;
use File::Path qw(make_path);
use File::Basename;
use Cwd qw(abs_path getcwd);
use Hydra::Helper::Exec;
use CliRunners;
our @ISA = qw(Exporter);
our @EXPORT = qw(
captureStdoutStderr
captureStdoutStderrWithStdin
createBaseJobset
createJobsetWithOneInput
evalFails