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

Updating this branch to extend the CI jobs.

parent 77acfd11
Pipeline #4976 failed with stage
in 3 minutes and 8 seconds
......@@ -32,9 +32,9 @@ import Text.Show.Pretty
cleanLeftovers :: WorkingDirectory -> Shell ()
cleanLeftovers (WorkingDirectory wd) = do
printInfo "Cleaning working(output) directory.\n"
printInfo "Cleaning working(output) directory."
cleanLog wd
printInfo "Cleaning sockets.\n"
printInfo "Cleaning sockets."
CM.mapM_ cleanSocket ["/tmp/nrm-downstream-in", "/tmp/nrm-upstream-in"]
checkFsAttributes :: FilePath -> Shell ()
......@@ -55,24 +55,24 @@ prepareDaemon out stdErr test = do
confPath <- myWhich "argo_nodeos_config"
let confPath' = "./argo_nodeos_config"
cp confPath confPath'
printInfo $ format ("Copied the configurator to " % fp % "\n") confPath'
printInfo $ format "Trying to sudo chown and chmod argo_nodeos_config\n"
printInfo $ format ("Copied the configurator to " % fp ) confPath'
printInfo $ format "Trying to sudo chown and chmod argo_nodeos_config"
verboseShell (format ("sudo chown root:root " % fp) confPath') empty >>= \case
ExitSuccess -> printInfo "Chowned argo_nodeos_config to root:root.\n"
ExitSuccess -> printInfo "Chowned argo_nodeos_config to root:root."
ExitFailure n ->
die ("Failed to set argo_nodeos_config permissions " <> repr n)
verboseShell (format ("sudo chmod u+sw " % fp) confPath') empty >>= \case
ExitSuccess -> printInfo "Set the suid bit.\n"
ExitSuccess -> printInfo "Set the suid bit."
ExitFailure n -> die ("Setting suid bit failed with exit code " <> repr n)
cleanContainers confPath' 1 2
export "ARGO_NODEOS_CONFIG" (format fp confPath')
return $ Instrumentation (P.proc "daemon" []) out stdErr test
where
nodeOsFailure n = do
printError ("argo_nodeos_config failed with exit code :" <> repr n <> "\n")
printError ("argo_nodeos_config failed with exit code :" <> repr n )
testfile ".argo_nodeos_config_exit_message" >>= \case
True -> do
printInfo "Contents of .argo_nodeos_config_exit_message: \n"
printInfo "Contents of .argo_nodeos_config_exit_message: "
view $ input ".argo_nodeos_config_exit_message"
False -> die ("argo_nodeos_config failed with exit code " <> repr n)
cleanContainers :: FilePath -> NominalDiffTime -> Integer -> Shell ()
......@@ -89,14 +89,14 @@ prepareDaemon out stdErr test = do
printWarning
( "the argo_nodeos_config call failed with exit code "
<> repr n
<> ". Retrying..\n"
<> ". Retrying.."
)
liftIO $ sleep (retryTime * 2)
cleanContainers argo_nodeos_config
(retryTime * 2)
(remainingRetries - 1)
(ExitSuccess, _, _) -> do
printInfo "Cleaned the argo config.\n"
printInfo "Cleaned the argo config."
len <- liftIO $ Turtle.Shell.fold
(grep (has "CONTAINER") showConfig)
Fold.length
......@@ -112,7 +112,7 @@ prepareDaemon out stdErr test = do
else
printInfo
"argo_nodeos_config successfully cleaned the container \
\config.\n"
\config."
cmdRunI
:: AppName
......@@ -204,14 +204,14 @@ runStack sa@StackArgs {..} = do
if verbosity == Verbose
then do
printInfo "Starting the following processes:\n"
printInfo "Starting the following processes:"
liftIO $ pPrint ilist
else liftIO $ pPrint (fmap fst ilist)
asyncs <- liftIO $ mapM tupleToAsync ilist
_ <- liftIO $ kbInstallHandler $ CM.mapM_ cancel asyncs
when (verbosity == Verbose) $ printInfo "Processes started.\n"
when (verbosity == Verbose) $ printInfo "Processes started."
out <- liftIO $ waitAnyCancel asyncs
......@@ -220,7 +220,6 @@ runStack sa@StackArgs {..} = do
<> repr (fst $ snd out)
<> " with exit information: "
<> repr (snd $ snd out)
<> "\n"
)
cd "../"
......
......@@ -42,11 +42,11 @@ printSuccess :: Text -> Shell ()
printTest :: Text -> Shell ()
dieRed :: Text -> Shell ()
printInfo = printf ("Info: " % s)
printInfo = printf ("Info: " % s% "\n")
printCommand = printf ("Running: " % s % "\n")
printWarning = colorShell Yellow . printf ("Warning: " % s)
printError = colorShell Red . printf ("Error: " % s)
printSuccess = colorShell Green . printf ("Success: " % s)
printWarning = colorShell Yellow . printf ("Warning: " % s% "\n")
printError = colorShell Red . printf ("Error: " % s% "\n")
printSuccess = colorShell Green . printf ("Success: " % s% "\n")
printTest = colorShell Green . printf ("RUNNING TEST: " % s % "\n")
dieRed str =
colorShell Red (printf ("Failure: " % s) str) >> exit (ExitFailure 1)
......@@ -54,12 +54,12 @@ dieRed str =
myWhich :: FilePath -> Shell FilePath
myWhich str = which str >>= \case
(Just p) ->
printInfo (format ("Found " % fp % " at " % fp % "\n") str p) >> return p
printInfo (format ("Found " % fp % " at " % fp) str p) >> return p
Nothing -> die $ format ("Argo `" % fp % "` not in $PATH.") str
myWhichMaybe :: FilePath -> Shell (Maybe FilePath)
myWhichMaybe str = which str >>= \case
(Just p) -> printInfo (format ("Found " % fp % " at " % fp % "\n") str p)
(Just p) -> printInfo (format ("Found " % fp % " at " % fp) str p)
>> return (Just p)
Nothing -> return Nothing
......@@ -67,7 +67,7 @@ sudoRemoveFile :: (Text -> Shell ()) -> Text -> FilePath -> Shell ()
sudoRemoveFile printer desc filePath = do
foundSocket <- testfile filePath
when foundSocket $ go False
printInfo $ format ("OK: " % s % " " % fp % "\n") desc filePath
printInfo $ format ("OK: " % s % " " % fp) desc filePath
where
go useSudo = do
printer $ format ("found stale " % s % " at " % fp % ".. ") desc filePath
......
......@@ -17,7 +17,7 @@ opts sa = hsubparser
( command "clean"
(info (pure $ clean sa) (progDesc "Clean sockets, logfiles."))
<> mconcat (fmap commandTest [(minBound :: TestType) ..])
<> commandTests [TestHello, TestListen, TestPerfwrapper]
<> commandTests [TestHello, TestListen, TestPerfwrapper, TestAMG, TestSTREAM]
"tests"
"Run hardware-independent CI tests"
<> help
......@@ -64,7 +64,7 @@ doSpec :: TestSpec -> StackArgs -> Shell ()
doSpec spec stackArgs = do
printTest $ T.pack $ description spec
fullStack (isTest spec) stackArgs
printSuccess "Test Successful."
printSuccess "Test Successful.\n"
configureTest :: TestType -> TestSpec
configureTest = \case
......@@ -235,14 +235,13 @@ newtype IsTest = IsTest Bool
fullStack :: IsTest -> StackArgs -> Shell ()
fullStack (IsTest b) a@StackArgs {..} = runStack a >>= \case
FoundMessage -> printSuccess "Found message!\n"
FoundMessage -> printSuccess "Found message!"
Died stacki errorcode -> if b
then
printError
( repr stacki
<> " died before a message could be found:"
<> repr errorcode
<> "\n"
)
>> exit (ExitFailure 1)
else exit ExitSuccess
......
......@@ -8,13 +8,13 @@
inherit (pinnedVersion) url rev sha256;
},
pkgs ? import argopkgs-src {},
nrm-src ? pkgs.nodelevel.nrm.src,
nrm-src ? pkgs.nodelevel.nrm.src,
containers-src ? pkgs.nodelevel.containers.src,
libnrm-src ? pkgs.nodelevel.libnrm.src,
amg-src ? pkgs.applications.nrm.amg.src,
lammps-src ? pkgs.applications.nrm.lammps.src,
qmcpack-src ? pkgs.applications.nrm.qmcpack.src,
stream-src ? pkgs.applications.nrm.stream.src,
libnrm-src ? pkgs.nodelevel.libnrm.src,
amg-src ? pkgs.applications.nrm.amg.src,
lammps-src ? pkgs.applications.nrm.lammps.src,
qmcpack-src ? pkgs.applications.nrm.qmcpack.src,
stream-src ? pkgs.applications.nrm.stream.src,
}:
let
filterHdevTools = builtins.filterSource (path: type: baseNameOf path != ".hdevtools.sock");
......@@ -46,33 +46,8 @@ let
echo "Installed bash completion."
'';
#cabal2snack = hpkgs.callPackage ({ mkDerivation, base, Cabal, cabal2nix, containers
#, distribution-nixpkgs, filepath, language-nix
#, optparse-applicative, pretty, stdenv, text
#}:
#mkDerivation {
#pname = "cabal2snack";
#version = "0.1.0.0";
#src = pkgs.fetchFromGitHub {
#owner = "freuk";
#repo = "cabal2snack";
#rev = "83705f82baa4b62864a6580a9048d547968dd185";
#sha256 = "0xqkznn66vg10iag47pan0d6zsn352xs69pi3jzvn8vgfclfy6h4";
#};
#isLibrary = true;
#isExecutable = true;
#libraryHaskellDepends = [
#base Cabal cabal2nix containers distribution-nixpkgs filepath
#language-nix optparse-applicative pretty text
#];
#executableHaskellDepends = [ base ];
#description = "A tool to generate nix expressions for snack from cabal projects";
#license = stdenv.lib.licenses.bsd3;
#}) {};
in rec
{
#inherit cabal2snack;
nrm = pkgs.nodelevel.nrm.overrideAttrs (old: {src = nrm-src;} );
libnrm = pkgs.nodelevel.libnrm.overrideAttrs (old: {src = libnrm-src;} );
containers = pkgs.nodelevel.containers.overrideAttrs (old: {src = containers-src;} );
......@@ -174,7 +149,4 @@ in rec
in pkgs.writeText "test-list" (''
Available test provenance configurations:
''+(builtins.concatStringsSep "\n" (pkgs.lib.mapAttrsToList showTest tests)));
#testsRepresentations = pkgs.lib.mapAttrsToList (name: value: name ) tests;
#output = builtins.concatStringsSep "\n" testsRepresentations;
}
......@@ -73,6 +73,20 @@ nrm.build:
- XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestPerfwrapper"
- rm -rf $CACHE
.TestAMG.test:
extends: .nix-integration
script:
- CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX)
- XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestAMG"
- rm -rf $CACHE
.TestSTREAM.test:
extends: .nix-integration
script:
- CACHE=$(mktemp -d --suffix=nixcache /tmp/deletable-nix-cache-XXXX)
- XDG_CACHE_HOME=$CACHE nix-shell .nix -A test --run "argotk.hs TestSTREAM"
- rm -rf $CACHE
KNL-Power.test:
extends: .TestPower.test
tags:
......@@ -98,3 +112,17 @@ KNL-Hello.test:
extends: .TestHello.test
tags:
- knl
STREAM.test:
extends: .TestSTREAM.test
KNL-STREAM.test:
extends: .TestSTREAM.test
tags:
- knl
AMG.test:
extends: .TestAMG.test
KNL-AMG.test:
extends: .TestAMG.test
tags:
- knl
{
"url": "https://xgitlab.cels.anl.gov/argo/argopkgs.git",
"rev": "59feb155cb40de40e3f1345e2a01dd86c0d4c6bb",
"date": "2019-01-07T16:58:16-06:00",
"sha256": "13dxwsmsb84hxqiga4mray6j2mwcg9lhgdxfaipbf2v7gd3n574h",
"rev": "79d93fefe6d7e3cb1992332fd07389cc1436b0aa",
"date": "2019-01-23T08:46:56-06:00",
"sha256": "10hc9mgvr3fkn6q40rdc79a1f865hmh2h3xymj9rmxq1dffmc8ag",
"fetchSubmodules": false
}
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