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