input-types: use is() for test comparisons

[?]
Feb 23, 2021, 7:52 PM
HRBL4HYREOAGDMCUQQHTNL3BIKAUXDBIYUPX63SASSVGGXTOO3NAC

Dependencies

  • [2] ZTYKNDOL Move tests for SCM inputs in to its own .t

Change contents

  • edit in tests/input-types.t at line 86
    [2.2259][2.2259:2474]()
    my $nixexpr = $scm->{"nixexpr"};
    my $type = $scm->{"type"};
    my $uri = $scm->{"uri"};
    my $update = $scm->{"update"};
    my $jobset = createJobsetWithOneInput($scmName, $nixexpr, "src", $type, $uri);
  • replacement in tests/input-types.t at line 87
    [2.2475][2.2475:2611]()
    my $state = 0;
    my $q = 0;
    my ($loop, $updated) = updateRepository($scmName, $update);
    while($loop) {
    my $c = 0;
    [2.2475]
    [2.2611]
    subtest "With the SCM input named $scmName" => sub {
    my $nixexpr = $scm->{"nixexpr"};
    my $type = $scm->{"type"};
    my $uri = $scm->{"uri"};
    my $update = $scm->{"update"};
    my $jobset = createJobsetWithOneInput($scmName, $nixexpr, "src", $type, $uri);
  • replacement in tests/input-types.t at line 94
    [2.2612][2.2612:2781]()
    # Verify that it can be fetched and possibly queued.
    ok(evalSucceeds($jobset), "$scmName:$state.$c: Evaluating nix-expression."); $c++;
    [2.2612]
    [2.2781]
    my $state = 0;
    my $q = 0;
    my ($loop, $updated) = updateRepository($scmName, $update);
    while($loop) {
    subtest "Mutation number $state" => sub {
    # Verify that it can be fetched and possibly queued.
    ok(evalSucceeds($jobset), "Evaluating nix-expression.");
  • replacement in tests/input-types.t at line 102
    [2.2782][2.2782:3150]()
    # Verify that the evaluation has queued a new job and evaluate again to ...
    if ($updated) {
    $q++;
    ok(nrQueuedBuildsForJobset($jobset) == $q, "$scmName:$state.$c: Expect $q jobs in the queue."); $c++;
    ok(evalSucceeds($jobset), "$scmName:$state.$c: Evaluating nix-expression again."); $c++;
    }
    [2.2782]
    [2.3150]
    # Verify that the evaluation has queued a new job and evaluate again to ...
    if ($updated) {
    $q++;
    is(nrQueuedBuildsForJobset($jobset), $q, "Expect $q jobs in the queue.");
    ok(evalSucceeds($jobset), "Evaluating nix-expression again.");
    }
  • replacement in tests/input-types.t at line 109
    [2.3151][2.3151:3328]()
    # ... check that it is deterministic and not queued again.
    ok(nrQueuedBuildsForJobset($jobset) == $q, "$scmName:$state.$c: Expect $q jobs in the queue."); $c++;
    [2.3151]
    [2.3328]
    # ... check that it is deterministic and not queued again.
    is(nrQueuedBuildsForJobset($jobset), $q, "Expect deterministic evaluation.");
  • replacement in tests/input-types.t at line 112
    [2.3329][2.3329:3446]()
    $state++;
    ($loop, $updated) = updateRepository($scmName, $update, getcwd . "/$scmName-repo/");
    }
    [2.3329]
    [2.3446]
    $state++;
    ($loop, $updated) = updateRepository($scmName, $update, getcwd . "/$scmName-repo/");
    };
    }
    };