* Build the Subversion test in Hydra (as a regression test for NixOS).

* Pass the location to the services tree around instead of requiring
  it to be in ../services.

svn path=/nixos/trunk/; revision=16901
This commit is contained in:
Eelco Dolstra 2009-08-31 14:56:19 +00:00
parent a2945a2eb2
commit 9359bf11d5
10 changed files with 35 additions and 16 deletions

View File

@ -1,5 +1,6 @@
{ nixos ? /etc/nixos/nixos { nixos ? ./..
, nixpkgs ? /etc/nixos/nixpkgs , nixpkgs ? /etc/nixos/nixpkgs
, services ? /etc/nixos/services
}: }:
let pkgs = import nixpkgs { config = {}; }; in let pkgs = import nixpkgs { config = {}; }; in
@ -54,7 +55,7 @@ rec {
nodes: configuration: nodes: configuration:
import "${nixos}/lib/eval-config.nix" { import "${nixos}/lib/eval-config.nix" {
inherit nixpkgs; inherit nixpkgs services;
modules = [ configuration ]; modules = [ configuration ];
extraArgs = { inherit nodes; }; extraArgs = { inherit nodes; };
/* !!! bug in the module/option handling: this ignores the /* !!! bug in the module/option handling: this ignores the
@ -175,6 +176,9 @@ rec {
echo "making report..." echo "making report..."
ensureDir $out/coverage ensureDir $out/coverage
${pkgs.lcov}/bin/genhtml --show-details $TMPDIR/out.info -o $out/coverage ${pkgs.lcov}/bin/genhtml --show-details $TMPDIR/out.info -o $out/coverage
ensureDir $out/nix-support
echo "report coverage $out/coverage" >> $out/nix-support/hydra-build-products
''; # */ ''; # */
} }

View File

@ -4,6 +4,7 @@
{ system ? builtins.currentSystem { system ? builtins.currentSystem
, nixpkgs ? import ./from-env.nix "NIXPKGS" /etc/nixos/nixpkgs , nixpkgs ? import ./from-env.nix "NIXPKGS" /etc/nixos/nixpkgs
, services ? /etc/nixos/services
, pkgs ? null , pkgs ? null
, baseModules ? import ../modules/module-list.nix , baseModules ? import ../modules/module-list.nix
, extraArgs ? {} , extraArgs ? {}
@ -28,6 +29,7 @@ rec {
extraArgs = extraArgs_ // { extraArgs = extraArgs_ // {
inherit pkgs optionDeclarations; inherit pkgs optionDeclarations;
modulesPath = ../modules; modulesPath = ../modules;
servicesPath = services;
}; };
# Import Nixpkgs, allowing the NixOS option nixpkgs.config to # Import Nixpkgs, allowing the NixOS option nixpkgs.config to
@ -46,7 +48,7 @@ rec {
inherit system; inherit system;
config = config =
(import ./eval-config.nix { (import ./eval-config.nix {
inherit system nixpkgs extraArgs modules; inherit system nixpkgs services extraArgs modules;
# For efficiency, leave out most NixOS modules; they don't # For efficiency, leave out most NixOS modules; they don't
# define nixpkgs.config, so it's pointless to evaluate them. # define nixpkgs.config, so it's pointless to evaluate them.
baseModules = [ ../modules/misc/nixpkgs.nix ]; baseModules = [ ../modules/misc/nixpkgs.nix ];

View File

@ -1,4 +1,4 @@
{pkgs, config, ...}: { config, pkgs, servicesPath, ... }:
with pkgs.lib; with pkgs.lib;
@ -70,7 +70,7 @@ let
startupScript = ""; startupScript = "";
options = {}; options = {};
}; };
res = defaults // svcFunction {inherit config pkgs serverInfo;}; res = defaults // svcFunction {inherit config pkgs serverInfo servicesPath;};
in res; in res;
in map f defs; in map f defs;

View File

@ -1,4 +1,4 @@
{config, pkgs, serverInfo}: { config, pkgs, serverInfo, servicesPath, ... }:
let let
@ -31,7 +31,7 @@ let
# Build the maintenance scripts and commit hooks. # Build the maintenance scripts and commit hooks.
scripts = substituteInAll { scripts = substituteInAll {
name = "svn-server-scripts"; name = "svn-server-scripts";
src = pkgs.lib.cleanSource ../../../../services/subversion/src/scripts; src = pkgs.lib.cleanSource "${servicesPath}/subversion/src/scripts";
# The variables to substitute: # The variables to substitute:
@ -75,7 +75,7 @@ let
# Build our custom authentication modules. # Build our custom authentication modules.
authModules = import ../../../../services/subversion/src/auth { authModules = import "${servicesPath}/subversion/src/auth" {
inherit (pkgs) stdenv apacheHttpd; inherit (pkgs) stdenv apacheHttpd;
}; };
@ -115,7 +115,7 @@ let
# Build ViewVC. # Build ViewVC.
viewvc = import ../../../../services/subversion/src/viewvc { viewvc = import "${servicesPath}/subversion/src/viewvc" {
inherit (pkgs) fetchurl stdenv python enscript; inherit (pkgs) fetchurl stdenv python enscript;
inherit urlPrefix reposDir adminAddr subversion; inherit urlPrefix reposDir adminAddr subversion;
}; };
@ -149,7 +149,7 @@ let
# Build WebSVN. # Build WebSVN.
websvn = import ../../../../services/subversion/src/websvn { websvn = import "${servicesPath}/subversion/src/websvn" {
inherit (pkgs) fetchurl stdenv writeText enscript gnused diffutils; inherit (pkgs) fetchurl stdenv writeText enscript gnused diffutils;
inherit urlPrefix reposDir subversion; inherit urlPrefix reposDir subversion;
cacheDir = tmpDir; cacheDir = tmpDir;
@ -232,7 +232,7 @@ let
staticFiles = substituteInSome { staticFiles = substituteInSome {
name = "svn-static-files"; name = "svn-static-files";
src = pkgs.lib.cleanSource ../../../../services/subversion/root; src = pkgs.lib.cleanSource "${servicesPath}/subversion/root";
files = ["xsl/svnindex.xsl"]; files = ["xsl/svnindex.xsl"];
inherit urlPrefix; inherit urlPrefix;
}; };

View File

@ -1,4 +1,4 @@
{config, pkgs, serverInfo}: { config, pkgs, serverInfo, ... }:
let let
workersProperties = pkgs.writeText "workers.properties" '' workersProperties = pkgs.writeText "workers.properties" ''

View File

@ -1,4 +1,4 @@
{config, pkgs, serverInfo}: { config, pkgs, serverInfo, ... }:
let let
inherit (pkgs.lib) mkOption; inherit (pkgs.lib) mkOption;

View File

@ -1,4 +1,4 @@
{config, pkgs, serverInfo}: { config, pkgs, serverInfo, ... }:
let let

View File

@ -1,4 +1,4 @@
{config, pkgs, serverInfo}: { config, pkgs, serverInfo, ... }:
let let

View File

@ -96,6 +96,14 @@ let
module = ./modules/installer/cd-dvd/installation-cd-graphical.nix; module = ./modules/installer/cd-dvd/installation-cd-graphical.nix;
description = "graphical"; description = "graphical";
}; };
tests.subversion =
{ services ? ../services }:
(import ./tests/subversion.nix {
inherit nixpkgs services;
}).report;
}; };

View File

@ -1,4 +1,9 @@
with import ../lib/build-vms.nix {}; { nixos ? ./..
, nixpkgs ? /etc/nixos/nixpkgs
, services ? /etc/nixos/services
}:
with import ../lib/build-vms.nix { inherit nixos nixpkgs services; };
let let