t/JobsetEval: test GETing the eval page

[?]
Jan 10, 2022, 6:46 PM
NNKWJGML3HR2BFDW74WGPNQR36AO73TMFITH3UCZOTVDTO3HVIFAC

Dependencies

  • [2] ZZ4HEML6 JobsetEval/restart-*: Write tests for the behavior

Change contents

  • file addition: fetch.t (----------)
    [2.1]
    use feature 'unicode_strings';
    use strict;
    use warnings;
    use Setup;
    use JSON::MaybeXS qw(decode_json encode_json);
    my %ctx = test_init();
    require Hydra::Schema;
    require Hydra::Model::DB;
    require Hydra::Helper::Nix;
    use Test2::V0;
    require Catalyst::Test;
    Catalyst::Test->import('Hydra');
    use HTTP::Request::Common qw(POST PUT GET DELETE);
    my $db = Hydra::Model::DB->new;
    hydra_setup($db);
    my $jobset = createBaseJobset("basic", "basic.nix", $ctx{jobsdir});
    ok(evalSucceeds($jobset), "Evaluating jobs/basic.nix should exit with return code 0");
    my ($eval, @evals) = $jobset->jobsetevals;
    my $fetch = request(GET '/eval/' . $eval->id);
    is($fetch->code, 200, "eval page is 200");
    done_testing;