Commit 9f78ce0d authored by Valentin Reis's avatar Valentin Reis

massive testset refactor.

parent b2a822e8
Pipeline #7689 failed with stages
in 27 minutes and 12 seconds
λ(dataDir : Text)
-> λ(manifestDir : Text)
→ λ(manifestDir : Text)
→ λ(isTest : Bool)
→ let lib = ./lib.dh dataDir manifestDir
let message = "HelloWorld"
let assetDir = dataDir ++ "assets/"
let cn = "testContainer"
let types = ./resources/types.dh
let basicManifest = manifestDir ++ "basic.yml"
let argotypes = ./argo/types.dh
let singularityManifest = manifestDir ++ "singularity.yml"
let argo = ./argo/package.dh
let argIfTest =
λ(isTest : Bool)
→ { isTest =
isTest
, timeout =
if isTest
let message = "HelloWorld"
then [ 600 ] : Optional Natural
let cn = "testContainer"
else [] : Optional Natural
let manifests =
{ basic =
manifestDir ++ "basic.yml"
, perf =
manifestDir ++ "perfwrap.yml"
}
let Powercap = < Cap : Text | NoCap : {} >
let ifTest =
λ(t : Type)
→ λ(default : t)
→ λ(value : t)
→ if isTest then value else default
in { run-singularity =
lib.makeBase
( lib.emptyMakeBaseArg "echo" singularityManifest cn
⫽ { args =
[ message ]
, verbose =
True
, singularity =
True
, cmdwants =
[] : List Text
, cmdavoids =
[ "Traceback" ]
, timeout =
[ 600 ] : Optional Natural
let ifTestList = ifTest (List Text) ([] : List Text)
let ifTestTimeout =
ifTest
(Optional Natural)
([] : Optional Natural)
([ 600 ] : Optional Natural)
let withDaemon =
λ(runArg : argotypes.MkRun)
→ λ(runOverrides : types.Cmd → types.Cmd)
→ λ(extraCmds : List types.Cmd)
→ lib.makeExtended
( argo.nrmd.defarg
⫽ { daemonavoids =
ifTestList [ "Traceback", "ValueError" ]
, powercap =
< NoCap = {=} | Cap : Text > : argotypes.Powercap
}
)
, run =
lib.makeBase
( lib.emptyMakeBaseArg "echo" basicManifest cn
⫽ { args =
[ message ]
, verbose =
True
, cmdwants =
[] : List Text
, cmdavoids =
[ "Traceback" ]
, timeout =
[ 600 ] : Optional Natural
}
lib.idCmd
(runArg ⫽ { cmdavoids = ifTestList [ "Traceback" ] })
(λ(c : types.Cmd) → runOverrides (c ⫽ { timeout = ifTestTimeout }))
extraCmds
let withDaemonNoExtras =
λ(runArg : argotypes.MkRun)
→ λ(runOverrides : types.Cmd → types.Cmd)
→ withDaemon runArg runOverrides ([] : List types.Cmd)
let withDaemonExtraPerftest =
λ(runArg : argotypes.MkRun)
→ λ(runOverrides : types.Cmd → types.Cmd)
→ withDaemon
runArg
runOverrides
[ argo.listen.mk
( argo.listen.defarg cn
⫽ { filter = "performance", doFilter = True }
)
]
let basicRun = λ(name : Text) → argo.run.defarg name manifests.basic cn
let perfRun = λ(name : Text) → argo.run.defarg name manifests.perf cn
in { run =
withDaemonNoExtras (basicRun "true") lib.idCmd
, pwd =
lib.makeBase
( lib.emptyMakeBaseArg "pwd" basicManifest cn
⫽ { args =
[] : List Text
, verbose =
True
, cmdwants =
[ "toto" ] : List Text
, cmdavoids =
[ "Traceback" ]
, timeout =
[ 600 ] : Optional Natural
, runwd =
[ "toto" ] : Optional Text
}
)
let somedir = "toto"
in withDaemonNoExtras
(basicRun "pwd" ⫽ { cmdwants = [ somedir ] : List Text })
(λ(x : types.Cmd) → x ⫽ { otherwd = [ somedir ] : Optional Text })
, exitcode =
lib.makeBase
( lib.emptyMakeBaseArg "false" basicManifest cn
⫽ { args =
[] : List Text
, verbose =
True
, cmdwants =
[] : List Text
, cmdavoids =
[ "Traceback" ]
, timeout =
[ 600 ] : Optional Natural
, runExitcode =
[ +1 ] : Optional Integer
}
)
withDaemonNoExtras
(basicRun "false")
(λ(x : types.Cmd) → x ⫽ { exitcode = [ +1 ] : Optional Integer })
, hello =
lib.makeBase
( lib.emptyMakeBaseArg "echo" basicManifest cn
⫽ { args =
[ message ]
, verbose =
True
, cmdwants =
[ message ]
, cmdavoids =
[ "Traceback" ]
, timeout =
[ 600 ] : Optional Natural
}
withDaemonNoExtras
( basicRun "echo"
⫽ { args = [ message ], cmdwants = [ message ] : List Text }
)
lib.idCmd
, listen =
lib.makeExtended
( lib.emptyMakeBaseArg "sleep" basicManifest cn
⫽ { args =
[ "1" ]
, verbose =
True
, cmdwants =
[] : List Text
, cmdavoids =
[ "Traceback" ]
, timeout =
[ 600 ] : Optional Natural
}
)
[ lib.values.emptyCmd
{ name =
"nrm"
, outfile =
"nrmlisten.out"
, errfile =
"nrmlisten.err"
}
⫽ { args = [ "listen", "-u", cn ] }
]
withDaemon
(basicRun "sleep" ⫽ { args = [ "1" ] })
lib.idCmd
[ argo.listen.mk (argo.listen.defarg cn ⫽ { doFilter = False }) ]
, power =
lib.appTest
( lib.emptyFilterTestArgs "power" "sleep"
⫽ { timeout =
[ 600 ] : Optional Natural
, args =
[ "15" ]
, isTest =
True
}
)
withDaemon
(basicRun "sleep" ⫽ { args = [ "15" ] })
lib.idCmd
[ argo.listen.mk
(argo.listen.defarg cn ⫽ { filter = "power", doFilter = True })
]
, performance =
lib.appTest
( lib.emptyFilterTestArgs "performance" "sleep"
⫽ { timeout =
[ 600 ] : Optional Natural
, args =
[ "15" ]
, isTest =
True
, manifestname =
"perfwrap.yml"
}
)
withDaemon (perfRun "sleep" ⫽ { args = [ "15" ] }) lib.idCmd
, qmcpack =
λ(isTest : Bool)
→ λ(powercap : Powercap)
→ lib.extendApp
( lib.progressAppTest
( lib.emptyProgressAppTestArg
"mpiexec"
[ "-n"
, if isTest then "2" else "24"
withDaemonExtraPerftest
( perfRun "mpiexec"
⫽ { args =
[ if isTest then "2" else "24"
, "qmcpack"
, lib.qmcPackDir ++ "/simple-H2O.xml"
, assetDir ++ "/simple-H2O.xml"
]
⫽ argIfTest isTest
⫽ { cmdavoids =
, cmdavoids =
[ "Error", "error", "ERROR" ]
, powercap =
powercap
}
)
)
isTest
lib.idCmd
, lammps =
λ(isTest : Bool)
→ λ(powercap : Powercap)
→ lib.extendApp
( lib.progressAppTest
( lib.emptyProgressAppTestArg
"mpiexec"
withDaemonExtraPerftest
( perfRun "mpiexec"
⫽ { args =
[ "-n"
, if isTest then "2" else "24"
, "-bind-to"
, "core"
, "lmp_mpi"
, "-i"
, lib.lammpsDir ++ "/modified.lj"
, assetDir ++ "/modified.lj"
]
⫽ argIfTest isTest
⫽ { cmdavoids =
, cmdavoids =
[ "Error", "error", "ERROR" ]
, powercap =
powercap
}
)
)
isTest
lib.idCmd
, openmc =
λ(isTest : Bool)
→ λ(powercap : Powercap)
→ lib.extendApp
( lib.progressAppTest
( lib.emptyProgressAppTestArg
"mpiexec"
withDaemonExtraPerftest
( perfRun "mpiexec"
⫽ { args =
[ "-n", if isTest then "2" else "24", "openmc" ]
⫽ argIfTest isTest
⫽ { passvars =
[ "OPENMC_CROSS_SECTIONS" ]
, cmdavoids =
[ "Error" ]
, powercap =
powercap
}
)
⫽ { pre =
[ "cp --no-preserve=mode -r " ++ lib.openmcDir ++ "/* ." ]
[ "Error", "error", "ERROR" ]
, passvars =
[ "OPENMC_CROSS_SECTIONS" ]
}
)
isTest
lib.idCmd
⫽ { pre = [ "cp --no-preserve=mode -r " ++ lib.openmcDir ++ "/* ." ] }
, amg =
λ(isTest : Bool)
→ λ(powercap : Powercap)
→ lib.extendApp
( lib.progressAppTest
( lib.emptyProgressAppTestArg
"mpiexec"
withDaemonExtraPerftest
( perfRun "mpiexec"
⫽ { args =
[ "-n"
, if isTest then "2" else "24"
, "amg"
......@@ -242,24 +167,24 @@
, if isTest then "1" else "12"
, "1"
]
⫽ argIfTest isTest
⫽ { vars =
[ { varname = "OMP_NUM_THREADS", value = "1" } ]
, cmdavoids =
[ "Error", "error", "ERROR" ]
, powercap =
powercap
}
)
( λ(x : types.Cmd)
→ x ⫽ { vars = [ { varname = "OMP_NUM_THREADS", value = "1" } ] }
)
isTest
, stream =
λ(isTest : Bool)
→ λ(powercap : Powercap)
→ lib.extendApp
( lib.progressAppTest
( lib.emptyProgressAppTestArg "stream_c" ([] : List Text)
⫽ argIfTest isTest
withDaemonExtraPerftest
( perfRun "stream_c"
⫽ { args =
[] : List Text
, cmdavoids =
[ "Error", "error", "ERROR" ]
}
)
( λ(x : types.Cmd)
→ x
⫽ { vars =
[ { varname =
"OMP_NUM_THREADS"
......@@ -268,12 +193,6 @@
}
, { varname = "OMP_PLACES", value = "cores" }
]
, cmdavoids =
[ "Error", "error", "ERROR" ]
, powercap =
powercap
}
)
)
isTest
}
let values = ../../resources/package.dh
let values = ../resources/package.dh
let types = ../../resources/types.dh
let types = ../resources/types.dh
in λ ( args
: { name :
......
......@@ -4,14 +4,13 @@ let types = ../resources/types.dh
let argotypes = ./types.dh
let basicCommand = ./internal/basicCommand.dh
let basicCommand = ./basicCommand.dh
let defaultMkListen =
λ(containerName : Text)
→ λ(attr : Text)
→ { attr =
"performance"
, isTest =
, doFilter =
False
, filter =
","
......@@ -30,20 +29,19 @@ let listen =
, outavoids =
[] : List Text
, outwants =
if a.isTest then [ a.filter ] else [] : List Text
if a.doFilter then [ a.filter ] else [] : List Text
}
⫽ { args = [ "listen", "-u", a.containerName, "--filter", a.filter ] }
: types.Cmd
let default =
λ(containerName : Text)
→ λ(attr : Text)
→ listen (defaultMkListen containerName attr) : types.Cmd
→ listen (defaultMkListen containerName) : types.Cmd
in { defarg =
defaultMkListen : Text → Text → argotypes.MkListen
defaultMkListen : Text → argotypes.MkListen
, mk =
listen : argotypes.MkListen → types.Cmd
, default =
default : Text → Text → types.Cmd
default : Text → types.Cmd
}
......@@ -4,7 +4,7 @@ let types = ../resources/types.dh
let argotypes = ./types.dh
let basicCommand = ./internal/basicCommand.dh
let basicCommand = ./basicCommand.dh
let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text
......@@ -28,7 +28,9 @@ let defaultMkDaemon =
, powercap =
< NoCap = {=} | Cap : Text >
, singularity =
True
False
, daemonavoids =
[] : List Text
}
: argotypes.MkDaemon
......@@ -53,11 +55,7 @@ let daemon =
{ filename =
"nrmd.out"
, filecheck =
{ wants =
[] : List Text
, avoids =
[ "Traceback", "ValueError" ] : List Text
}
{ wants = [] : List Text, avoids = a.daemonavoids }
}
, vars =
[ { varname =
......
{ nrmd = ./nrmd.dh, run = ./run.dh, listen = ./listen.dh }
{basic = ./basicCommand.dh, nrmd = ./nrmd.dh, run = ./run.dh, listen = ./listen.dh }
......@@ -4,33 +4,26 @@ let types = ../resources/types.dh
let argotypes = ./types.dh
let basicCommand = ./internal/basicCommand.dh
let basicCommand = ./basicCommand.dh
let defaultMkRun =
λ(cmd : Text)
→ λ(manifest : Text)
→ λ(containerName : Text)
→ { manifest =
manifest
, cmd =
cmd
, containerName =
"containerName"
containerName
, args =
[] : List Text
, cmdwants =
[] : List Text
, cmdavoids =
[] : List Text
, vars =
values.emptyVars
, timeout =
[] : Optional Natural
, runExitcode =
[] : Optional Integer
, passvars =
[] : List Text
, runwd =
[] : Optional Text
}
: argotypes.MkRun
......@@ -54,25 +47,26 @@ let run =
, passvars =
b.passvars # a.passvars
, vars =
a.vars
values.emptyVars
, timeout =
a.timeout
[] : Optional Natural
, exitcode =
a.runExitcode
[] : Optional Integer
, otherwd =
a.runwd
[] : Optional Text
}
: types.Cmd
let default =
λ(cmd : Text)
→ λ(manifest : Text)
→ run (defaultMkRun cmd manifest) : types.Cmd
→ λ(containerName : Text)
→ run (defaultMkRun cmd manifest containerName) : types.Cmd
in { defarg =
defaultMkRun : Text → Text → argotypes.MkRun
defaultMkRun : Text → Text → Text → argotypes.MkRun
, mk =
run : argotypes.MkRun → types.Cmd
, default =
default : Text → Text → types.Cmd
default : Text → Text → Text → types.Cmd
}
......@@ -2,7 +2,16 @@ let types = ../resources/types.dh
let Powercap = < Cap : Text | NoCap : {} >
let MkDaemon = { verbose : Bool, powercap : Powercap, singularity : Bool }
let MkDaemon =
{ verbose :
Bool
, powercap :
Powercap
, singularity :
Bool
, daemonavoids :
List Text
}
let MkRun =
{ manifest :
......@@ -17,20 +26,12 @@ let MkRun =
List Text
, cmdavoids :
List Text
, vars :
List types.EnvVar
, timeout :
Optional Natural
, runExitcode :
Optional Integer
, passvars :
List Text
, runwd :
Optional Text
}
let MkListen =
{ attr : Text, containerName : Text, isTest : Bool, filter : Text }
{ attr : Text, containerName : Text, doFilter : Bool, filter : Text }
in { MkRun =
MkRun
......
......@@ -18,11 +18,21 @@
let Powercap = < Cap : Text | NoCap : {} >
let makeBase =
let id = λ(a : Type) → λ(x : a) → x
let idCmd = id types.Cmd
let makeExtended =
λ(daemonArg : argotypes.MkDaemon)
→ λ(daemonOverrides : types.Cmd → types.Cmd)
→ λ(runArg : argotypes.MkRun)
→ λ(runOverrides : types.Cmd → types.Cmd)
→ λ(extraCmds : List types.Cmd)
→ { cmds =
[ argo.nrmd.mk daemonArg, argo.run.mk runArg ]
[ daemonOverrides (argo.nrmd.mk daemonArg)
, runOverrides (argo.run.mk runArg)
]
# extraCmds
, verbose =
True
, cleaning =
......@@ -36,12 +46,6 @@
}
: 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 FilterTestArgs =
{ manifestname :
Text
......@@ -92,11 +96,20 @@
: FilterTestArgs
let appTest =
let cn = "testContainer"
let cn = "containerName"
in λ(args : FilterTestArgs)
→ makeExtended
{ powercap = args.powercap, verbose = True, singularity = False }
{ powercap =
args.powercap
, verbose =
True
, singularity =
False
, daemonavoids =
[ "Traceback", "ValueError" ]
}
idCmd
{ manifest =
manifestDir
++ ( if args.isTest
......@@ -115,18 +128,15 @@
[] : List Text
, cmdavoids =
args.cmdavoids
, vars =
args.vars
, passvars =
args.passvars
, timeout =
args.timeout
, runwd =
[] : Optional Text
, runExitcode =
[] : Optional Integer
}
[ argo.listen.default cn args.filter ]
( λ(c : types.Cmd)
→ c ⫽ { timeout = args.timeout, vars = args.vars }
)
[ argo.listen.mk
(argo.listen.defarg cn ⫽ { filter = args.filter })
]
let ProgressAppTestArg =
{ cmd :
......@@ -208,9 +218,12 @@
in b ⫽ { args = [ "listen", "-u", cn, "--filter", filter ] }
let powerexpeCmds =
[ argo.listen.default "testContainer" "power"
, argo.listen.default "testContainer" "performance"
, argo.listen.default "testContainer" "control"
let cn = "containerName"
in [ argo.listen.mk (argo.listen.defarg cn ⫽ { filter = "power" })
, argo.listen.mk
(argo.listen.defarg cn ⫽ { filter = "performance" })
, argo.listen.mk (argo.listen.defarg cn ⫽ { filter = "control" })
]
: List types.Cmd
......@@ -221,8 +234,6 @@
in { values =
values
, makeBase =
makeBase
, makeExtended =
makeExtended
, appTest =
......@@ -245,4 +256,6 @@
powerexpeCmds
, extendApp =
extendApp
, idCmd =
id types.Cmd
}
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