add first evaluations tests

[?]
Mar 16, 2011, 1:18 PM
HX4QYOYAKKFKK4KF6SZ6FQCM5ZF7ZFDTQUR4GS5WPPTYZASYZZUAC

Dependencies

  • [2] 2KJFOYGS hydra: Actually check for Nix in `configure'.
  • [3] HHPQFVQM add local srcdir to perl5lib env var
  • [4] EFPZWV5S
  • [5] 7RO7CINM setup environment variables for tests
  • [6] WHS5RMPO
  • [7] G2ZB6464 first test, not yet in buildprocess
  • [8] FV2M6MOT hydra: use autoconf/-make
  • [9] M3A5PZIH hydra: Clarify the dependency on BDW-GC.

Change contents

  • replacement in configure.ac at line 39
    [2.248][2.248:419]()
    AC_CHECK_LIB([expr], [_ZN3nix17parseExprFromFileERNS_9EvalStateESs], [:],
    [AC_MSG_ERROR([Nix library not found; please install Nix or check the `--with-nix' option.])])
    [2.248]
    [2.419]
    #AC_CHECK_LIB([expr], [_ZN3nix17parseExprFromFileERNS_9EvalStateESs], [:],
    # [AC_MSG_ERROR([Nix library not found; please install Nix or check the `--with-nix' option.])])
  • edit in configure.ac at line 70
    [5.46]
    [5.16774]
    tests/evaluation-tests.pl
  • replacement in tests/Makefile.am at line 1
    [5.92][4.0:1]()
    [5.92]
    [5.0]
    TESTDIR=`pwd`
  • replacement in tests/Makefile.am at line 4
    [5.59][5.59:101]()
    HYDRA_DATA="$(top_srcdir)/tests/data" \
    [5.59]
    [5.101]
    HYDRA_DATA="$(TESTDIR)/data" \
  • replacement in tests/Makefile.am at line 7
    [5.152][5.152:291]()
    NIX_STATE_DIR=$(top_srcdir)/tests/nix/var \
    NIX_DATA_DIR=$(top_srcdir)/tests/nix/var \
    NIX_STORE_DIR=$(top_srcdir)/tests/nix/store \
    [5.152]
    [3.0]
    NIX_STATE_DIR="$(TESTDIR)/nix/var/nix" \
    NIX_STORE_DIR="$(TESTDIR)/nix/store" \
    NIX_LOG_DIR="$(TESTDIR)/nix/var/log/nix" \
  • replacement in tests/Makefile.am at line 14
    [5.103][5.103:125]()
    query-all-tables.pl
    [5.103]
    [5.125]
    query-all-tables.pl \
    evaluation-tests.pl
    clean :
    chmod -R a+w nix
    rm -rf db.sqlite data nix
  • replacement in tests/Makefile.am at line 21
    [5.126][5.304:330]()
    $(TESTS) : db.sqlite dirs
    [5.126]
    [5.147]
    $(TESTS) : clean db.sqlite dirs
  • file addition: Setup.pm (----------)
    [5.73]
    package Setup;
    use strict;
    use Exporter;
    our @ISA = qw(Exporter);
    our @EXPORT = qw(hydra_setup);
    sub hydra_setup {
    my ($db) = @_;
    $db->resultset('Users')->create({ username => "root", emailaddress => 'root@email.com', password => '' });
    }
    1;
  • file addition: evaluation-tests.pl.in (---r------)
    [5.73]
    #! @perl@ -w -I@nix@/libexec/nix
    use strict;
    use Hydra::Schema;
    use Hydra::Helper::Nix;
    use Hydra::Helper::AddBuilds;
    use Cwd;
    use Setup;
    my $db = openHydraDB;
    use Test::Simple tests => 1;
    hydra_setup($db);
    my $res;
    my $stdout;
    my $stderr;
    my $project = $db->resultset('Projects')->create({name => "tests", displayname => "", owner => "root"});
    my $jobset = $project->jobsets->create({name => "basic", nixexprinput => "input", nixexprpath => "basic.nix", emailoverride => ""});
    my $jobsetinput = $jobset->jobsetinputs->create({name => "input", type => "path"});
    my $jobsetinputals = $jobsetinput->jobsetinputalts->create({altnr => 0, value => getcwd."/jobs"});
    ($res, $stdout, $stderr) = captureStdoutStderr(60, ("../src/script/hydra_evaluator.pl", "tests", "basic"));
    ok($res, "Evaluating jobs/basic.nix should exit with return code 0");
    print STDERR "\n$res\n";
  • file addition: jobs (d--r------)
    [5.73]
  • file addition: basic.nix (----------)
    [0.1729]
    { input }:
    {
    empty_dir =
    derivation {
    name = "empty-dir";
    system = builtins.currentSystem;
    builder = ./empty-dir-builder.sh;
    };
    fails =
    derivation {
    name = "fails";
    system = builtins.currentSystem;
    builder = ./fail.sh;
    };
    succeed_with_failed =
    derivation {
    name = "succeed-with-failed";
    system = builtins.currentSystem;
    builder = ./succeed-with-failed.sh;
    };
    }
  • file addition: empty-dir-builder.sh (----------)
    [0.1729]
    mkdir $out
  • file addition: fail.sh (----------)
    [0.1729]
    exit 1
  • file addition: succeed-with-failed.sh (----------)
    [0.1729]
    mkdir -p $out/nix-support/failed