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
This diff is collapsed.
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,14 +4,13 @@ let types = ../resources/types.dh ...@@ -4,14 +4,13 @@ let types = ../resources/types.dh
let argotypes = ./types.dh let argotypes = ./types.dh
let basicCommand = ./internal/basicCommand.dh let basicCommand = ./basicCommand.dh
let defaultMkListen = let defaultMkListen =
λ(containerName : Text) λ(containerName : Text)
→ λ(attr : Text)
→ { attr = → { attr =
"performance" "performance"
, isTest = , doFilter =
False False
, filter = , filter =
"," ","
...@@ -30,20 +29,19 @@ let listen = ...@@ -30,20 +29,19 @@ let listen =
, outavoids = , outavoids =
[] : List Text [] : List Text
, outwants = , 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 ] } ⫽ { args = [ "listen", "-u", a.containerName, "--filter", a.filter ] }
: types.Cmd : types.Cmd
let default = let default =
λ(containerName : Text) λ(containerName : Text)
→ λ(attr : Text) → listen (defaultMkListen containerName) : types.Cmd
→ listen (defaultMkListen containerName attr) : types.Cmd
in { defarg = in { defarg =
defaultMkListen : Text → Text → argotypes.MkListen defaultMkListen : Text → argotypes.MkListen
, mk = , mk =
listen : argotypes.MkListen → types.Cmd listen : argotypes.MkListen → types.Cmd
, default = , default =
default : Text → Text → types.Cmd default : 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 = ./internal/basicCommand.dh let basicCommand = ./basicCommand.dh
let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text
...@@ -28,7 +28,9 @@ let defaultMkDaemon = ...@@ -28,7 +28,9 @@ let defaultMkDaemon =
, powercap = , powercap =
< NoCap = {=} | Cap : Text > < NoCap = {=} | Cap : Text >
, singularity = , singularity =
True False
, daemonavoids =
[] : List Text
} }
: argotypes.MkDaemon : argotypes.MkDaemon
...@@ -53,11 +55,7 @@ let daemon = ...@@ -53,11 +55,7 @@ let daemon =
{ filename = { filename =
"nrmd.out" "nrmd.out"
, filecheck = , filecheck =
{ wants = { wants = [] : List Text, avoids = a.daemonavoids }
[] : List Text
, avoids =
[ "Traceback", "ValueError" ] : List Text
}
} }
, vars = , vars =
[ { varname = [ { 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 ...@@ -4,33 +4,26 @@ let types = ../resources/types.dh
let argotypes = ./types.dh let argotypes = ./types.dh
let basicCommand = ./internal/basicCommand.dh let basicCommand = ./basicCommand.dh
let defaultMkRun = let defaultMkRun =
λ(cmd : Text) λ(cmd : Text)
→ λ(manifest : Text) → λ(manifest : Text)
→ λ(containerName : Text)
→ { manifest = → { manifest =
manifest manifest
, cmd = , cmd =
cmd cmd
, containerName = , containerName =
"containerName" containerName
, args = , args =
[] : List Text [] : List Text
, cmdwants = , cmdwants =
[] : List Text [] : List Text
, cmdavoids = , cmdavoids =
[] : List Text [] : List Text
, vars =
values.emptyVars
, timeout =
[] : Optional Natural
, runExitcode =
[] : Optional Integer
, passvars = , passvars =
[] : List Text [] : List Text
, runwd =
[] : Optional Text
} }
: argotypes.MkRun : argotypes.MkRun
...@@ -54,25 +47,26 @@ let run = ...@@ -54,25 +47,26 @@ let run =
, passvars = , passvars =
b.passvars # a.passvars b.passvars # a.passvars
, vars = , vars =
a.vars values.emptyVars
, timeout = , timeout =
a.timeout [] : Optional Natural
, exitcode = , exitcode =
a.runExitcode [] : Optional Integer
, otherwd = , otherwd =
a.runwd [] : Optional Text
} }
: types.Cmd : types.Cmd
let default = let default =
λ(cmd : Text) λ(cmd : Text)
→ λ(manifest : Text) → λ(manifest : Text)
→ run (defaultMkRun cmd manifest) : types.Cmd → λ(containerName : Text)
→ run (defaultMkRun cmd manifest containerName) : types.Cmd
in { defarg = in { defarg =
defaultMkRun : Text → Text → argotypes.MkRun defaultMkRun : Text → Text → Text → argotypes.MkRun
, mk = , mk =
run : argotypes.MkRun → types.Cmd run : argotypes.MkRun → types.Cmd
, default = , default =
default : Text → Text → types.Cmd default : Text → Text → Text → types.Cmd
} }
...@@ -2,7 +2,16 @@ let types = ../resources/types.dh ...@@ -2,7 +2,16 @@ let types = ../resources/types.dh
let Powercap = < Cap : Text | NoCap : {} > 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 = let MkRun =
{ manifest : { manifest :
...@@ -17,20 +26,12 @@ let MkRun = ...@@ -17,20 +26,12 @@ let MkRun =
List Text List Text
, cmdavoids : , cmdavoids :
List Text List Text
, vars :
List types.EnvVar
, timeout :
Optional Natural
, runExitcode :
Optional Integer
, passvars : , passvars :
List Text List Text
, runwd :
Optional Text
} }
let MkListen = let MkListen =
{ attr : Text, containerName : Text, isTest : Bool, filter : Text } { attr : Text, containerName : Text, doFilter : Bool, filter : Text }
in { MkRun = in { MkRun =
MkRun MkRun
......
λ(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 id = λ(a : Type) → λ(x : a) → x
let idCmd = id types.Cmd
let makeExtended =
λ(daemonArg : argotypes.MkDaemon) λ(daemonArg : argotypes.MkDaemon)
→ λ(daemonOverrides : types.Cmd → types.Cmd)
→ λ(runArg : argotypes.MkRun) → λ(runArg : argotypes.MkRun)
→ λ(runOverrides : types.Cmd → types.Cmd)
→ λ(extraCmds : List types.Cmd)
→ { cmds = → { cmds =
[ argo.nrmd.mk daemonArg, argo.run.mk runArg ] [ daemonOverrides (argo.nrmd.mk daemonArg)
, runOverrides (argo.run.mk runArg)
]
# extraCmds
, verbose = , verbose =
True True
, cleaning = , cleaning =
...@@ -35,13 +45,7 @@ ...@@ -35,13 +45,7 @@
[] : List Text [] : List Text
} }
: types.Config : 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 = let FilterTestArgs =
{ manifestname : { manifestname :
Text Text
...@@ -64,7 +68,7 @@ ...@@ -64,7 +68,7 @@
, powercap : , powercap :
Powercap Powercap
} }
let emptyFilterTestArgs = let emptyFilterTestArgs =
λ(filter : Text) λ(filter : Text)
→ λ(cmd : Text) → λ(cmd : Text)
...@@ -90,19 +94,28 @@ ...@@ -90,19 +94,28 @@
< NoCap = {=} | Cap : Text > < NoCap = {=} | Cap : Text >
} }
: FilterTestArgs : FilterTestArgs
let appTest = let appTest =
let cn = "testContainer" let cn = "containerName"
in λ(args : FilterTestArgs) in λ(args : FilterTestArgs)
→ makeExtended → makeExtended
{ powercap = args.powercap, verbose = True, singularity = False } { powercap =
args.powercap
, verbose =
True
, singularity =
False
, daemonavoids =
[ "Traceback", "ValueError" ]
}
idCmd
{ manifest = { manifest =
manifestDir manifestDir
++ ( if args.isTest ++ ( if args.isTest
then args.manifestname then args.manifestname
else "parallel.yml" else "parallel.yml"
) )
, containerName = , containerName =
...@@ -115,19 +128,16 @@ ...@@ -115,19 +128,16 @@
[] : List Text [] : List Text
, cmdavoids = , cmdavoids =
args.cmdavoids args.cmdavoids
, vars =
args.vars
, passvars = , passvars =
args.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 = let ProgressAppTestArg =
{ cmd : { cmd :
Text Text
...@@ -146,7 +156,7 @@ ...@@ -146,7 +156,7 @@
, powercap : , powercap :
Powercap Powercap
} }
let emptyProgressAppTestArg = let emptyProgressAppTestArg =
λ(cmd : Text) λ(cmd : Text)
→ λ(args : List Text) → λ(args : List Text)
...@@ -168,7 +178,7 @@ ...@@ -168,7 +178,7 @@
< NoCap = {=} | Cap : Text > < NoCap = {=} | Cap : Text >
} }
: ProgressAppTestArg : ProgressAppTestArg
let progressAppTest = let progressAppTest =
λ(args : ProgressAppTestArg) λ(args : ProgressAppTestArg)
→ appTest → appTest
...@@ -191,7 +201,7 @@ ...@@ -191,7 +201,7 @@
args.powercap args.powercap
} }
) )
let mkListen = let mkListen =
λ(cn : Text) λ(cn : Text)
→ λ(filter : Text) → λ(filter : Text)
...@@ -204,25 +214,26 @@ ...@@ -204,25 +214,26 @@
, errfile = , errfile =
filter ++ ".err" filter ++ ".err"
} }
in b ⫽ { args = [ "listen", "-u", cn, "--filter", filter ] } in b ⫽ { args = [ "listen", "-u", cn, "--filter", filter ] }
let powerexpeCmds = let powerexpeCmds =
[ argo.listen.default "testContainer" "power" let cn = "containerName"
, argo.listen.default "testContainer" "performance"
, argo.listen.default "testContainer" "control" in [ argo.listen.mk (argo.listen.defarg cn ⫽ { filter = "power" })
] , argo.listen.mk
: List types.Cmd (argo.listen.defarg cn ⫽ { filter = "performance" })
, argo.listen.mk (argo.listen.defarg cn ⫽ { filter = "control" })
]
: 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
, makeExtended = , makeExtended =
makeExtended makeExtended
, appTest = , appTest =
...@@ -245,4 +256,6 @@ ...@@ -245,4 +256,6 @@
powerexpeCmds powerexpeCmds
, extendApp = , extendApp =
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