.github
datadog
doc
examples
foreman
src
t
Helper
Hydra
evaluator
input-types
jobs
lib
queue-runner
build-locally-with-substitutable-path.t
constituents.t
default-machine-file.t
direct-indirect-constituents.t
notifications.t
scripts
Makefile.am
api-test.t
build-products.t
perlcritic.pl
s3-backup-test.config
s3-backup-test.pl
setup-notifications-jobset.pl
test.pl
.editorconfig
.gitignore
.perlcriticrc
.yath.rc
COPYING
INSTALL
Makefile.am
Procfile
README.md
bootstrap
configure.ac
default.nix
flake.lock
flake.nix
hydra-api.yaml
hydra-module.nix
shell.nix
version.txt
36 lines
1.2 KiB
Perl
36 lines
1.2 KiB
Perl
use strict;
|
|
use warnings;
|
|
use Setup;
|
|
use Test2::V0;
|
|
|
|
my $ctx = test_context();
|
|
|
|
my $builds = $ctx->makeAndEvaluateJobset(
|
|
expression => 'constituents.nix',
|
|
);
|
|
|
|
my $constituentBuildA = $builds->{"constituentA"};
|
|
my $constituentBuildB = $builds->{"constituentB"};
|
|
|
|
my $eval = $constituentBuildA->jobsetevals->first();
|
|
is($eval->evaluationerror->errormsg, "");
|
|
|
|
subtest "Verifying the direct aggregate" => sub {
|
|
my $aggBuild = $builds->{"direct_aggregate"};
|
|
is($aggBuild->constituents->first()->id, $constituentBuildA->id, "The ID of the constituent is correct");
|
|
};
|
|
|
|
subtest "Verifying the indirect aggregate" => sub {
|
|
my $indirectBuild = $builds->{"indirect_aggregate"};
|
|
is($indirectBuild->constituents->first()->id, $constituentBuildA->id, "The ID of the constituent is correct");
|
|
};
|
|
|
|
subtest "Verifying a mix of direct and indirect aggregate references" => sub {
|
|
my $mixedBuild = $builds->{"mixed_aggregate"};
|
|
my ($constituentA, $constituentB) = $mixedBuild->constituents()->search({}, {order_by => { -asc => "job"} });
|
|
is($constituentA->id, $constituentBuildA->id, "The ID of the constituent is correct");
|
|
is($constituentB->id, $constituentBuildB->id, "The ID of the constituent is correct");
|
|
};
|
|
|
|
done_testing;
|