Commit 3e4ce8bb authored by Valentin Reis's avatar Valentin Reis
Browse files

finished dhall test drafts.

parent d4a2f6e6
Pipeline #6379 passed with stages
in 2 minutes and 23 seconds
let lib = ./lib.dh
in let message = "HelloWorld"
in let cn = "testContainer"
in let basicManifest = lib.argopkgsManifestDirPath ++ "basic.json"
in let apps =
{ qmcpack =
λ(isTest : Bool)
→ lib.progressAppTest
( lib.emptyProgressAppTestArg
"mpiexec"
[ "-n"
, if isTest then "2" else "24"
, "qmcpack"
, lib.qmcPackDir ++ "/simple-H2O.xml"
]
)
, lammps =
λ(isTest : Bool)
→ lib.progressAppTest
( lib.emptyProgressAppTestArg
"mpiexec"
[ "-n"
, if isTest then "2" else "24"
, "-bind-to"
, "core"
, "lmp_mpi"
, "-i"
, lib.lammpsDir ++ "/modified.lj"
]
⫽ { isTest = isTest }
)
, openmc =
λ(isTest : Bool)
→ lib.progressAppTest
( lib.emptyProgressAppTestArg
"mpiexec"
[ "-n", if isTest then "2" else "24", "openmc" ]
⫽ { isTest = isTest }
)
⫽ { pre = [ "cp -r \$OPENMC_PWD/* ." ] }
, amg =
λ(isTest : Bool)
→ lib.progressAppTest
( lib.emptyProgressAppTestArg
"mpiexec"
[ "-n"
, if isTest then "2" else "24"
, "amg"
, "-problem"
, "2"
, "-n"
, "90"
, "90"
, "90"
, "-P"
, "2"
, "12"
, "1"
]
⫽ { vars =
[ { varname = "OMP_NUM_THREADS", value = "1" } ]
, isTest =
isTest
}
)
, stream =
λ(isTest : Bool)
→ lib.progressAppTest
( lib.emptyProgressAppTestArg "stream_c" ([] : List Text)
⫽ { vars =
[ { varname =
"OMP_NUM_THREADS"
, value =
if isTest then "2" else "24"
}
, { varname = "OMP_PLACES", value = "cores" }
]
, isTest =
isTest
}
)
}
in { hello =
lib.makeBase
( lib.emptyMakeBaseArgs "echo" basicManifest cn
⫽ { args = [ message ], verbose = True, cmdwants = [ message ] }
)
, listen =
lib.makeExtended
( lib.emptyMakeBaseArgs "sleep" basicManifest cn
⫽ { args = [ "1" ], verbose = True, cmdwants = [] : List Text }
)
[ lib.values.emptyCmd
{ name =
"cmd"
, outfile =
"cmdlisten.out"
, errfile =
"cmdlisten.err"
}
⫽ { args = [ "listen", "-u", cn ] }
]
, power =
lib.appTest (lib.emptyFilterTestArgs "power")
, performance =
lib.appTest (lib.emptyFilterTestArgs "performance")
, stream =
apps.stream True
, openmc =
apps.openmc True
, lammps =
apps.lammps True
, qmcpack =
apps.qmcpack True
, amg =
apps.amg True
, streamRun =
apps.stream False
, openmcRun =
apps.openmc False
, lammpsRun =
apps.lammps False
, qmcpackRun =
apps.qmcpack False
, amgRun =
apps.amg False
}
let lib = ./package.dh
in let message = "HelloWorld"
in let cn = "testContainer"
in { hello =
lib.makeBase
{ manifest =
lib.argopkgsManifestDirPath ++ "basic.json"
, cmd =
"echo"
, containerName =
cn
, args =
[ message ]
, verbose =
True
, cmdwants =
[ message ]
}
, listen =
lib.makeExtended
{ manifest =
lib.argopkgsManifestDirPath ++ "basic.json"
, containerName =
cn
, cmd =
"sleep"
, args =
[ "1" ]
, verbose =
True
, cmdwants =
[] : List Text
}
[ lib.values.emptyCmd
{ name =
"cmd"
, outfile =
"cmdlisten.out"
, errfile =
"cmdlisten.err"
}
⫽ { args = [ "listen", "-u", cn ] }
]
, power =
lib.appTest (lib.emptyFilterTestArgs "power")
, performance =
lib.appTest (lib.emptyFilterTestArgs "performance")
, qmcPack =
lib.appTest
( lib.emptyFilterTestArgs "progress"
⫽ { cmd =
< Cmd = "qmcpack" | Sleep : {} >
, args =
[ "-n", "24", "qmcpack", lib.qmcPackDir ++ "/simple-H2O.xml" ]
}
)
}
...@@ -7,6 +7,8 @@ in let argopkgsManifestDirPath = ...@@ -7,6 +7,8 @@ in let argopkgsManifestDirPath =
in let qmcPackDir = "toto" in let qmcPackDir = "toto"
in let lammpsDir = "toto"
in let basicCommand = in let basicCommand =
λ(args : { name : Text, outprefix : Text, outwants : List Text }) λ(args : { name : Text, outprefix : Text, outwants : List Text })
→ { name = → { name =
...@@ -46,8 +48,30 @@ in let MakeBaseArgs = ...@@ -46,8 +48,30 @@ in let MakeBaseArgs =
Bool Bool
, cmdwants : , cmdwants :
List Text List Text
, vars :
List types.EnvVar
} }
in let emptyMakeBaseArgs =
λ(cmd : Text)
→ λ(manifest : Text)
→ λ(containerName : Text)
→ { manifest =
manifest
, cmd =
cmd
, containerName =
containerName
, args =
[] : List Text
, verbose =
False
, cmdwants =
[] : List Text
, vars =
values.emptyVars
}
in let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text in let addVerbose = λ(v : Bool) → if v then [ "--verbose" ] else [] : List Text
in let makeBase = in let makeBase =
...@@ -110,7 +134,17 @@ in let makeExtended = ...@@ -110,7 +134,17 @@ in let makeExtended =
in let OptionalSleep = < Cmd : Text | Sleep : {} > in let OptionalSleep = < Cmd : Text | Sleep : {} >
in let FilterTestArgs = in let FilterTestArgs =
{ filter : Text, cmd : OptionalSleep, args : List Text } { filter :
Text
, cmd :
OptionalSleep
, args :
List Text
, vars :
List types.EnvVar
, isTest :
Bool
}
in let emptyFilterTestArgs = in let emptyFilterTestArgs =
λ(filter : Text) λ(filter : Text)
...@@ -120,6 +154,10 @@ in let emptyFilterTestArgs = ...@@ -120,6 +154,10 @@ in let emptyFilterTestArgs =
< Sleep = {=} | Cmd : Text > < Sleep = {=} | Cmd : Text >
, args = , args =
[] : List Text [] : List Text
, vars =
values.emptyVars
, isTest =
False
} }
in let sleepArgs = in let sleepArgs =
...@@ -150,6 +188,8 @@ in let appTest = ...@@ -150,6 +188,8 @@ in let appTest =
True True
, cmdwants = , cmdwants =
[] : List Text [] : List Text
, vars =
args.vars
} }
[ let b = [ let b =
values.emptyCmd values.emptyCmd
...@@ -168,23 +208,77 @@ in let appTest = ...@@ -168,23 +208,77 @@ in let appTest =
b.out b.out
⫽ { filecheck = ⫽ { filecheck =
values.emptyCheck values.emptyCheck
⫽ { wants = [ args.filter ] } ⫽ { wants =
if args.isTest
then [ args.filter ]
else [] : List Text
}
} }
} }
] ]
in let ProgressAppTestArg =
{ cmd :
Text
, args :
List Text
, vars :
List types.EnvVar
, isTest :
Bool
}
in let emptyProgressAppTestArg =
λ(cmd : Text)
→ λ(args : List Text)
→ { cmd =
cmd
, args =
args
, vars =
[] : List types.EnvVar
, isTest =
False
}
: ProgressAppTestArg
in let progressAppTest =
λ(args : ProgressAppTestArg)
→ appTest
( emptyFilterTestArgs "progress"
⫽ { cmd =
< Cmd = args.cmd | Sleep : {} >
, args =
args.args
, vars =
args.vars
, isTest =
False
}
)
in { values = in { values =
values values
, emptyMakeBaseArgs =
emptyMakeBaseArgs
, makeBase = , makeBase =
makeBase makeBase
, makeExtended = , makeExtended =
makeExtended makeExtended
, appTest = , appTest =
appTest appTest
, progressAppTest =
progressAppTest
, emptyFilterTestArgs = , emptyFilterTestArgs =
emptyFilterTestArgs emptyFilterTestArgs
, qmcPackDir = , qmcPackDir =
qmcPackDir qmcPackDir
, lammpsDir =
lammpsDir
, argopkgsManifestDirPath = , argopkgsManifestDirPath =
argopkgsManifestDirPath argopkgsManifestDirPath
, emptyProgressAppTestArg =
emptyProgressAppTestArg
} }
let all = ../all-tests.dh in all.amg
let all = ./all.dh in all.hello let all = ../all-tests.dh in all.hello
let all = ../all-tests.dh in all.lammps
let all = ../all-tests.dh in all.hello
let all = ../all-tests.dh in all.openmc
let all = ../all-tests.dh in all.performance
let all = ../all-tests.dh in all.power
let all = ../all-tests.dh in all.qmcpack
let all = ../all-tests.dh in all.stream
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