Commit 59c5aa66 authored by Valentin Reis's avatar Valentin Reis

refactoring tests to be able to launch from external repo.

parent 4c2bdeef
Pipeline #4583 passed with stage
in 6 seconds
stages: stages:
- test - test
nix.test: integration.test:
stage: test stage: test
script: script:
- ./tests.hs - ./integration.sh
except: except:
- /^wip\/.*/ - /^wip\/.*/
- /^WIP\/.*/ - /^WIP\/.*/
......
...@@ -56,14 +56,14 @@ instance Default StackArgs where ...@@ -56,14 +56,14 @@ instance Default StackArgs where
{ dargs = "" { dargs = ""
, app = "echo Dummy app: Hello world!" , app = "echo Dummy app: Hello world!"
, manifest = "manifests/basic.json" , manifest = "manifests/basic.json"
, cmd_out = "/tmp/cmd_out.log" , cmd_out = "cmd_out.log"
, cmd_err = "/tmp/cmd_err.log" , cmd_err = "cmd_err.log"
, daemon_out = "/tmp/daemon_out.log" , daemon_out = "daemon_out.log"
, daemon_err = "/tmp/daemon_err.log" , daemon_err = "daemon_err.log"
, log_progress = "/tmp/progress.log" , log_progress = "progress.log"
, log_hardwareprogress = "/tmp/hardwareprogress.log" , log_hardwareprogress = "hardwareprogress.log"
, log_power = "/tmp/power.log" , log_power = "power.log"
, time_file = "/tmp/time.log" , time_file = "time.log"
} }
......
...@@ -30,7 +30,13 @@ in rec ...@@ -30,7 +30,13 @@ in rec
]; ];
}; };
test = env.overrideAttrs(old: { test = env.overrideAttrs(old: {
src = ./.;
buildInputs = old.buildInputs ++ [ (argopkgs.haskellPackages.ghcWithPackages hpkgs) ]; buildInputs = old.buildInputs ++ [ (argopkgs.haskellPackages.ghcWithPackages hpkgs) ];
buildPhase = "runhaskell integration.hs";
installPhase = ''
mkdir -p $out/bin
cp cmd_out.log cmd_err.log daemon_out.log daemon_err.log progress.log hardwareprogress.log power.log time.log $out/bin
'';
}); });
dev = env.overrideAttrs(old: { dev = env.overrideAttrs(old: {
buildInputs = old.buildInputs ++ [ (argopkgs.haskellPackages.ghcWithHoogle hpkgs-dev) ]; buildInputs = old.buildInputs ++ [ (argopkgs.haskellPackages.ghcWithHoogle hpkgs-dev) ];
......
#! /usr/bin/env nix-shell #! /usr/bin/env runhaskell
#! nix-shell default.nix -i runhaskell -A test
import Argotest import Argotest
import Data.Default import Data.Default
......
#! /usr/bin/env bash
nix-shell --pure -A test --command ./integration.hs
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