api-test: use is for nicer errors

[?]
Apr 28, 2021, 10:27 PM
XWEWQOHVHXRAEZRIV7PZ4HKU5EEJ35SKDKHY5RPQDKSMMSIATLJQC

Dependencies

  • [2] GLJD3PG2 api-test.t: make it work under yath
  • [3] Q3VTDUSQ Fix the API test
  • [4] UOL7YDDL Fix test
  • [5] TZEDUWFX api-test: make created project and jobset visible
  • [6] SYLVCTT6 Start api cleanup with the User model
  • [7] MIMHJSZK Add json output for the search API endpoint
  • [8] 4VYSDP4I Add eager fetching of relations and enable that for jobset->jobsetinputs
  • [9] WQ2VQ7H3 Use hydra-module.nix in the tests
  • [10] KSFJOFIC Make PathInput plugin cache validity configurable
  • [11] ZIIXICG7 Make the outputs' outpaths available via the Build JSON API
  • [12] KYSBJAYN Allow dashes in jobset input names
  • [13] 5QYMALGU Fix Perl error in tests.api
  • [14] 4YCF3KBG Concurrent hydra-evaluator
  • [15] LZVO64YG Merge in the first bits of the API work
  • [16] 2DGIP6L4 Cleanup build serialization
  • [17] NP7IOJ4Q Flesh out the API a bit
  • [18] MQYHIUEE Cleanup eval serialization
  • [19] 7ECJWNVX Cleanup Project model
  • [20] MMHOJIGD Test whether incorrect passwords are rejected
  • [21] YI3BZG5N Cleanup Jobset serialization

Change contents

  • replacement in t/api-test.t at line 54
    [3.150][3.150:210]()
    ok($result->code() == 403, "Incorrect password rejected.");
    [3.150]
    [3.210]
    is($result->code(), 403, "Incorrect password rejected.");
  • replacement in t/api-test.t at line 60
    [3.37103][3.37103:37167](),[3.37167][3.2096:2165]()
    ok($user->{username} eq "root", "The root user is named root");
    ok($user->{userroles}->[0] eq "admin", "The root user is an admin");
    [3.37103]
    [2.1006]
    is($user->{username}, "root", "The root user is named root");
    is($user->{userroles}->[0], "admin", "The root user is an admin");
  • replacement in t/api-test.t at line 65
    [3.37319][3.37319:37386](),[3.37386][3.2166:2238]()
    ok($user->{username} eq "root", "The current user is named root");
    ok($user->{userroles}->[0] eq "admin", "The current user is an admin");
    [3.37319]
    [3.37466]
    is($user->{username}, "root", "The current user is named root");
    is($user->{userroles}->[0], "admin", "The current user is an admin");
  • replacement in t/api-test.t at line 68
    [3.37467][3.37467:37567]()
    ok(request_json({ uri => '/project/sample' })->code() == 404, "Non-existent projects don't exist");
    [3.37467]
    [3.37567]
    is(request_json({ uri => '/project/sample' })->code(), 404, "Non-existent projects don't exist");
  • replacement in t/api-test.t at line 71
    [3.141][3.37693:37757](),[3.37693][3.37693:37757]()
    ok($result->code() == 201, "PUTting a new project creates it");
    [3.141]
    [3.37757]
    is($result->code(), 201, "PUTting a new project creates it");
  • replacement in t/api-test.t at line 78
    [3.256][3.38157:38220](),[3.414][3.38157:38220](),[3.526][3.38157:38220](),[2.1317][3.38157:38220](),[3.38157][3.38157:38220]()
    ok($result->code() == 201, "PUTting a new jobset creates it");
    [2.1317]
    [3.38220]
    is($result->code(), 201, "PUTting a new jobset creates it");
  • replacement in t/api-test.t at line 84
    [3.229][2.1318:1438]()
    ok($jobset->{jobsetinputs}->{"my-src"}->{"jobsetinputalts"}->[0] eq $jobsetdir, "The 'my-src' input is in $jobsetdir");
    [3.229]
    [3.244]
    is($jobset->{jobsetinputs}->{"my-src"}->{"jobsetinputalts"}->[0], $jobsetdir, "The 'my-src' input is in $jobsetdir");
  • replacement in t/api-test.t at line 89
    [3.38804][3.38804:38861]()
    ok($result->code() == 200, "Can get evals of a jobset");
    [3.38804]
    [3.38861]
    is($result->code(), 200, "Can get evals of a jobset");
  • replacement in t/api-test.t at line 92
    [3.38939][3.250:327]()
    ok($eval->{hasnewbuilds} == 1, "The first eval of a jobset has new builds");
    [3.38939]
    [3.39016]
    is($eval->{hasnewbuilds}, 1, "The first eval of a jobset has new builds");
  • replacement in t/api-test.t at line 101
    [3.39401][3.564:648](),[3.648][3.328:497](),[3.39401][3.328:497]()
    ok(scalar(@$evals) == 2, "Changing a jobset source creates the second evaluation");
    ok($evals->[0]->{jobsetevalinputs}->{"my-src"}->{revision} != $evals->[1]->{jobsetevalinputs}->{"my-src"}->{revision}, "Changing a jobset source changes its revision");
    [3.39401]
    [3.709]
    is(scalar(@$evals), 2, "Changing a jobset source creates the second evaluation");
    isnt($evals->[0]->{jobsetevalinputs}->{"my-src"}->{revision}, $evals->[1]->{jobsetevalinputs}->{"my-src"}->{revision}, "Changing a jobset source changes its revision");
  • replacement in t/api-test.t at line 105
    [3.279][3.39678:39798](),[3.599][3.39678:39798](),[3.39678][3.39678:39798]()
    ok($build->{job} eq "job", "The build's job name is job");
    ok($build->{finished} == 0, "The build isn't finished yet");
    [3.599]
    [2.1777]
    is($build->{job}, "job", "The build's job name is job");
    is($build->{finished}, 0, "The build isn't finished yet");
  • replacement in t/api-test.t at line 111
    [3.391][3.391:484]()
    ok($search_project->{projects}[0]->{name} == "sample", "Search for project 'sample' works");
    [3.391]
    [3.484]
    is($search_project->{projects}[0]->{name}, "sample", "Search for project 'sample' works");
  • replacement in t/api-test.t at line 114
    [3.612][3.612:742]()
    ok($search_build->{builds}[0]->{buildoutputs}->{out}->{path} == $build->{buildoutputs}->{out}->{path}, "Search for builds work");
    [3.612]
    [2.1920]
    is($search_build->{builds}[0]->{buildoutputs}->{out}->{path}, $build->{buildoutputs}->{out}->{path}, "Search for builds work");