autotools -> meson

Original commit message:

> There are some known regressions regarding local testing setups - since
> everything was kinda half written with the expectation that build dir =
> source dir (which should not be true anymore). But everything builds and
> the test suite runs fine, after several hours spent debugging random
> crashes in libpqxx with MALLOC_PERTURB_...

I have not experienced regressions with local testing.

(cherry picked from commit 4b886d9c45cd2d7fe9b0a8dbc05c7318d46f615d)
This commit is contained in:
Pierre Bourdon
2024-07-22 15:54:29 +02:00
committed by John Ericson
parent f974891c76
commit 182a48c9fb
30 changed files with 391 additions and 329 deletions

View File

@ -4,6 +4,8 @@ use warnings;
package HydraTestContext;
use File::Path qw(make_path);
use File::Basename;
use File::Copy::Recursive qw(rcopy);
use File::Which qw(which);
use Cwd qw(abs_path getcwd);
use CliRunners;
use Hydra::Helper::Exec;
@ -77,6 +79,13 @@ sub new {
);
$ENV{'HYDRA_DBI'} = $pgsql->dsn;
my $jobsdir = "$dir/jobs";
rcopy(abs_path(dirname(__FILE__) . "/../jobs"), $jobsdir);
my $coreutils_path = dirname(which 'install');
replace_variable_in_file($jobsdir . "/config.nix", '@testPath@', $coreutils_path);
replace_variable_in_file($jobsdir . "/declarative/project.json", '@jobsPath@', $jobsdir);
my $self = bless {
_db => undef,
db_handle => $pgsql,
@ -84,7 +93,7 @@ sub new {
nix_state_dir => $nix_state_dir,
nix_log_dir => $nix_log_dir,
testdir => abs_path(dirname(__FILE__) . "/.."),
jobsdir => abs_path(dirname(__FILE__) . "/../jobs"),
jobsdir => $jobsdir,
deststoredir => $deststoredir,
}, $class;
@ -243,6 +252,18 @@ sub write_file {
close $fh;
}
sub replace_variable_in_file {
my ($fn, $var, $val) = @_;
open (my $input, '<', "$fn.in") or die $!;
open (my $output, '>', $fn) or die $!;
while (my $line = <$input>) {
$line =~ s/$var/$val/g;
print $output $line;
}
}
sub rand_chars {
return sprintf("t%08X", rand(0xFFFFFFFF));
}