Implemented quoted strings support in hydra-build-products to allow file names with spaces + testcase

[?]
Mar 20, 2013, 5:05 PM
PY5GVGC7QVTOTCZ52LRHUCUJY5MER6ADCMTC2FR2WQACQV4QV5CQC

Dependencies

  • [2] S5NPXZG3 Fix indentation
  • [3] YDVFPMKP Security: Ensure that a build product refers to the Nix store
  • [4] RBZRCTAL hydra: fixed and re-enabled evaluation tests
  • [5] 3RL7VFKE Add tests for "git describe --long".
  • [6] FAIJDQKZ
  • [7] HE3GX5IP Optimize fetch-git.
  • [8] HX4QYOYA add first evaluations tests
  • [9] SBKX3YH2 cleanup
  • [10] 5SMQ2PLK Fix tests
  • [11] FM4O2L4M hydra: if evaluator sees cached build, also add the buildproducts
  • [12] WFJ3ZPRM add tests for scm inputs
  • [13] PMNWRTGJ Add multiple output support
  • [*] OOQ2D3KC * Refactoring: move fetchInput out of hydra_scheduler into a separate

Change contents

  • replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 785
    [4.5445][4.5445:5515]()
    /^([\w\-]+)\s+([\w\-]+)\s+(\S+)(\s+(\S+))?$/ or next;
    [4.5445]
    [4.5515]
    /^([\w\-]+)\s+([\w\-]+)\s+("[^"]*"|\S+)(\s+(\S+))?$/ or next;
  • replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 788
    [4.5600][3.85:139]()
    my $path = File::Spec->canonpath($3);
    [4.5600]
    [4.5631]
    my $path = File::Spec->canonpath((substr $3, 0, 1) eq "\"" ? substr $3, 1, -1 : $3);
  • replacement in tests/evaluation-tests.pl at line 10
    [4.969][4.298:328]()
    use Test::Simple tests => 60;
    [4.969]
    [4.998]
    use Test::Simple tests => 68;
  • edit in tests/evaluation-tests.pl at line 137
    [2.2218]
    [2.2218]
    }
    }
    # Test build products
    $jobset = createBaseJobset("build-products", "build-products.nix");
    ok(evalSucceeds($jobset), "Evaluating jobs/build-products.nix should exit with return code 0");
    ok(nrQueuedBuildsForJobset($jobset) == 2 , "Evaluating jobs/build-products.nix should result in 2 builds");
    for my $build (queuedBuildsForJobset($jobset)) {
    ok(runBuild($build), "Build '".$build->job->name."' from jobs/build-products.nix should exit with code 0");
    my $newbuild = $db->resultset('Builds')->find($build->id);
    ok($newbuild->finished == 1 && $newbuild->buildstatus == 0, "Build '".$build->job->name."' from jobs/build-products.nix should have buildstatus 0");
    my $buildproducts = $db->resultset('BuildProducts')->search({ build => $build->id });
    my $buildproduct = $buildproducts->next;
    if($build->job->name eq "simple") {
    ok($buildproduct->name eq "text.txt", "We should have text.txt, but found: ".$buildproduct->name."\n");
    } elsif ($build->job->name eq "with_spaces") {
    ok($buildproduct->name eq "some text.txt", "We should have: \"some text.txt\", but found: ".$buildproduct->name."\n");