Test Job's builds and channel pages

This commit is contained in:
Graham Christensen 2022-01-14 11:28:22 -05:00
parent a2adb8cfb6
commit 796cae0fd0

View file

@ -0,0 +1,31 @@
use strict;
use warnings;
use Setup;
use Test2::V0;
use Catalyst::Test ();
use HTTP::Request::Common;
my $ctx = test_context();
Catalyst::Test->import('Hydra');
my $builds = $ctx->makeAndEvaluateJobset(
expression => "basic.nix",
build => 1
);
my $build = $builds->{"empty_dir"};
my $jobset = $build->jobset;
my $project = $build->project;
subtest "/job/PROJECT/JOBSET/JOB/all" => sub {
my $response = request(GET '/job/' . $project->name . '/' . $jobset->name . '/' . $build->job . '/all');
ok($response->is_success, "The page showing the job's builds returns 200.");
};
subtest "/job/PROJECT/JOBSET/JOB/channel/latest" => sub {
my $response = request(GET '/job/' . $project->name . '/' . $jobset->name . '/' . $build->job . '/channel/latest');
ok($response->is_success, "The page showing the job's channel returns 200.");
};
done_testing;