Commit 1b7469ea authored by Christopher League's avatar Christopher League

nix specification, fix test

parent 884c9ebb
Pipeline #543 passed with stage
in 5 minutes and 17 seconds
......@@ -22,3 +22,4 @@ bookme.cabal
/TAGS
/deps.png
/devenv.sh
/result
......@@ -6,7 +6,7 @@ before_script:
build:
script:
- stack build
- stack test
cache:
paths:
......
{ nixpkgs ? import <nixpkgs> {}
}:
with nixpkgs;
let
stackageVersion = "lts-1110";
stackageSrc = pkgs.fetchgit {
url = "https://github.com/typeable/nixpkgs-stackage.git";
rev = "7c94ec65e12850e7dd5282e83a6da91f88cb8857";
sha256 = "1ihsbgb9agg1f5q7mk3ycja6njbrg1dqlxniav47kyr9cm5ng0kn";
};
gogolSrc = pkgs.fetchgit {
url = "https://github.com/brendanhay/gogol.git";
rev = "344c9f781560e1ed8395b17e370ba1b085f2edc2";
sha256 = "0f48mh7f2ifk3b7rjwgn9cwmi6845xv9zvs07khycbk70959pk1n";
};
stackageOverlay = import stackageSrc;
nixpkgs' = import pkgs.path { overlays = [stackageOverlay]; };
haskell = nixpkgs'.pkgs.haskell;
mkNix = name: loc: pkgs.runCommand name {} ''
${pkgs.cabal2nix}/bin/cabal2nix ${loc} >$out
'';
gogolCoreNix = mkNix "gogol-core.nix" "${gogolSrc}/core";
gogolNix = mkNix "gogol.nix" "${gogolSrc}/gogol";
gogolCalNix = mkNix "gogol-cal.nix" "${gogolSrc}/gogol-apps-calendar";
bookmeNix = mkNix "bookme.nix" ./.;
hpkgs = haskell.packages.stackage.${stackageVersion}.override {
overrides = self: super: {
gogol-core = self.callPackage gogolCoreNix {};
gogol = self.callPackage gogolNix {};
gogol-apps-calendar = self.callPackage gogolCalNix {};
alex = haskell.lib.dontCheck super.alex;
bookme = self.callPackage bookmeNix {};
# mkDerivation = args: super.mkDerivation (args // {
# enableLibraryProfiling = false;
# doHoogle = false;
# doHaddock = false;
# });
};
};
in
haskell.lib.justStaticExecutables hpkgs.bookme
{ nixpkgs ? import <nixpkgs> {}
}:
(import ./default.nix { inherit nixpkgs; }).env
......@@ -14,13 +14,4 @@ spec =
it "loads the index and checks it looks right" $ do
get HomeR
statusIs 200
htmlAnyContain "h1" "a modern framework for blazing fast websites"
request $ do
setMethod "POST"
setUrl HomeR
addToken
fileByLabelExact "Choose a file" "test/Spec.hs" "text/plain" -- talk about self-reference
byLabelExact "What's on the file?" "Some Content"
-- more debugging printBody
htmlAllContain ".upload-response" "text/plain"
htmlAllContain ".upload-response" "Some Content"
htmlAnyContain "h1" "Find time to meet"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment