Commit b2a822e8 authored by Valentin Reis's avatar Valentin Reis

test refactor

parent b2136521
Pipeline #7685 failed with stages
in 2 minutes and 26 seconds
let values = ../resources/package.dh
let values = ../../resources/package.dh
let types = ../resources/types.dh
let types = ../../resources/types.dh
in λ ( args
: { name :
......
......@@ -4,7 +4,7 @@ let types = ../resources/types.dh
let argotypes = ./types.dh
let basicCommand = ./basicCommand.dh
let basicCommand = ./internal/basicCommand.dh
let defaultMkListen =
λ(containerName : Text)
......@@ -35,10 +35,15 @@ let listen =
⫽ { args = [ "listen", "-u", a.containerName, "--filter", a.filter ] }
: types.Cmd
let default =
λ(containerName : Text)
→ λ(attr : Text)
→ listen (defaultMkListen containerName attr) : types.Cmd
in { defarg =
defaultMkListen : Text → Text → argotypes.MkListen
, mk =
listen : argotypes.MkListen → types.Cmd
, default =
listen defaultMkListen : Text → Text → types.Cmd
default : Text → Text → types.Cmd
}
......@@ -4,7 +4,7 @@ let types = ../resources/types.dh
let argotypes = ./types.dh
let basicCommand = ./basicCommand.dh
let basicCommand = ./internal/basicCommand.dh
let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text
......
{ nrmd = ./nrmd.dh, run = ./run.dh, listen = ./listen.dh, basicCommand = ./basicCommand.dh }
{ nrmd = ./nrmd.dh, run = ./run.dh, listen = ./listen.dh }
......@@ -4,7 +4,7 @@ let types = ../resources/types.dh
let argotypes = ./types.dh
let basicCommand = ./basicCommand.dh
let basicCommand = ./internal/basicCommand.dh
let defaultMkRun =
λ(cmd : Text)
......
λ(dataDir : Text)
→ λ(manifestDir : Text)
→ let values = ./resources/package.dh
let types = ./resources/types.dh
let argotypes = ./argo/types.dh
let argo = ./argo/package.dh
let assetDir = dataDir ++ "assets/"
let openmcDir = assetDir ++ "openmc/"
let lammpsDir = assetDir
let qmcPackDir = assetDir
let Powercap = < Cap : Text | NoCap : {} >
let makeBase =
λ(daemonArg : argotypes.MkDaemon)
→ λ(runArg : argotypes.MkRun)
......@@ -35,15 +35,13 @@
[] : List Text
}
: types.Config
let makeExtended =
λ(daemonArg : argotypes.MkDaemon)
→ λ(runArg : argotypes.MkRun)
→ λ(cmds : List types.Cmd)
→ let b = makeBase daemonArg runArg in b ⫽ { cmds = b.cmds # cmds }
let OptionalSleep = < Cmd : Text | Sleep : {} >
let FilterTestArgs =
{ manifestname :
Text
......@@ -66,7 +64,7 @@
, powercap :
Powercap
}
let emptyFilterTestArgs =
λ(filter : Text)
→ λ(cmd : Text)
......@@ -92,19 +90,19 @@
< NoCap = {=} | Cap : Text >
}
: FilterTestArgs
let appTest =
λ(args : FilterTestArgs)
→ let cn = "testContainer"
in makeExtended
let cn = "testContainer"
in λ(args : FilterTestArgs)
makeExtended
{ powercap = args.powercap, verbose = True, singularity = False }
{ manifest =
manifestDir
++ ( if args.isTest
then args.manifestname
else "parallel.yml"
)
, containerName =
......@@ -128,34 +126,8 @@
, runExitcode =
[] : Optional Integer
}
[ let b =
values.emptyCmd
{ name =
"nrm"
, outfile =
"nrmlisten.out"
, errfile =
"nrmlisten.err"
}
in b
⫽ { args =
[ "listen", "-u", cn, "--filter", args.filter ]
, out =
b.out
⫽ { filecheck =
values.emptyCheck
⫽ { wants =
if args.isTest
then [ args.filter ]
else [] : List Text
}
}
}
]
[ argo.listen.default cn args.filter ]
let ProgressAppTestArg =
{ cmd :
Text
......@@ -174,7 +146,7 @@
, powercap :
Powercap
}
let emptyProgressAppTestArg =
λ(cmd : Text)
→ λ(args : List Text)
......@@ -196,7 +168,7 @@
< NoCap = {=} | Cap : Text >
}
: ProgressAppTestArg
let progressAppTest =
λ(args : ProgressAppTestArg)
→ appTest
......@@ -219,19 +191,34 @@
args.powercap
}
)
let mkListen =
λ(cn : Text)
→ λ(filter : Text)
→ let b =
values.emptyCmd
{ name =
"nrm"
, outfile =
filter ++ ".out"
, errfile =
filter ++ ".err"
}
in b ⫽ { args = [ "listen", "-u", cn, "--filter", filter ] }
let powerexpeCmds =
[ mkListen "testContainer" "power"
, mkListen "testContainer" "performance"
, mkListen "testContainer" "control"
[ argo.listen.default "testContainer" "power"
, argo.listen.default "testContainer" "performance"
, argo.listen.default "testContainer" "control"
]
: List types.Cmd
let extendApp =
λ(c : types.Config)
→ λ(isTest : Bool)
→ if isTest then c else c ⫽ { cmds = c.cmds # powerexpeCmds }
in { values =
values
, makeBase =
......
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