nixos/tests/hoogle: init
This commit is contained in:
@@ -718,6 +718,7 @@ in
|
|||||||
homepage-dashboard = runTest ./homepage-dashboard.nix;
|
homepage-dashboard = runTest ./homepage-dashboard.nix;
|
||||||
homer = handleTest ./homer { };
|
homer = handleTest ./homer { };
|
||||||
honk = runTest ./honk.nix;
|
honk = runTest ./honk.nix;
|
||||||
|
hoogle = runTest ./hoogle.nix;
|
||||||
hostname = handleTest ./hostname.nix { };
|
hostname = handleTest ./hostname.nix { };
|
||||||
hound = runTest ./hound.nix;
|
hound = runTest ./hound.nix;
|
||||||
hub = runTest ./git/hub.nix;
|
hub = runTest ./git/hub.nix;
|
||||||
|
|||||||
31
nixos/tests/hoogle.nix
Normal file
31
nixos/tests/hoogle.nix
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
name = "hoogle";
|
||||||
|
meta.maintainers = with lib.maintainers; [ h7x4 ];
|
||||||
|
|
||||||
|
nodes.machine =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.hoogle = {
|
||||||
|
enable = true;
|
||||||
|
packages =
|
||||||
|
hp: with hp; [
|
||||||
|
arrows
|
||||||
|
lens
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript =
|
||||||
|
{ nodes, ... }:
|
||||||
|
let
|
||||||
|
cfg = nodes.machine.services.hoogle;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
machine.wait_for_unit("hoogle.service")
|
||||||
|
machine.wait_for_open_port(${toString cfg.port})
|
||||||
|
|
||||||
|
machine.succeed("curl http://${cfg.host}:${toString cfg.port} | grep '<title>Hoogle</title>'")
|
||||||
|
machine.succeed("curl 'http://${cfg.host}:${toString cfg.port}?hoogle=>>>' | grep Arrow")
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
haskellPackages,
|
haskellPackages,
|
||||||
writeText,
|
writeText,
|
||||||
runCommand,
|
runCommand,
|
||||||
|
nixosTests,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# This argument is a function which selects a list of Haskell packages from any
|
# This argument is a function which selects a list of Haskell packages from any
|
||||||
@@ -137,6 +138,8 @@ buildPackages.stdenv.mkDerivation (finalAttrs: {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
passthru.tests.nixos = nixosTests.hoogle;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Local Hoogle database";
|
description = "Local Hoogle database";
|
||||||
platforms = ghc.meta.platforms;
|
platforms = ghc.meta.platforms;
|
||||||
|
|||||||
Reference in New Issue
Block a user