From 235802013dd3fe20504d7d92456e9b40e6a17f74 Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Mon, 7 Aug 2023 11:43:32 -0700 Subject: h5bench: include tests for E4S and new version (#37830) * include tests for h5bench * update to new test format * update path * improve description and detect MPI runner * fix test name * Include new release * update with corrections * include SLURM dependency and reduce test to one process * fixes on filters * fix on oversubscribe * suggested fixes --------- Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> --- .../repos/builtin/packages/h5bench/package.py | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/var/spack/repos/builtin/packages/h5bench/package.py b/var/spack/repos/builtin/packages/h5bench/package.py index 3829b02bb9..93ac11e58e 100644 --- a/var/spack/repos/builtin/packages/h5bench/package.py +++ b/var/spack/repos/builtin/packages/h5bench/package.py @@ -17,6 +17,7 @@ class H5bench(CMakePackage): version("latest", branch="master", submodules=True) version("develop", branch="develop", submodules=True) + version("1.4", commit="67a3e6d91508e5ab77db79c6187b2eb3c96119e0", submodules=True) version("1.3", commit="ec75a466a77c337b4252c0afe1055c7fbe841e16", submodules=True) version( "1.2", commit="866af6777573d20740d02acc47a9080de093e4ad", submodules=True, deprecated=True @@ -58,3 +59,30 @@ class H5bench(CMakePackage): ] return args + + @run_after("install") + def setup_build_tests(self): + launcher = self.mpi_launcher() + filename = "samples/sync-write-1d-contig-contig.json" + filter_file("mpirun", f"{launcher}", filename) + filter_file(r"-n 2", "-n 1 --timeout 240", filename) + + """Copy the example source files after the package is installed to an + install test subdirectory for use during `spack test run`.""" + cache_extra_test_sources(self, ["tests", "samples"]) + + def mpi_launcher(self): + commands = ["mpirun", "mpiexec"] + + return which(*commands, path=[self.spec["mpi"].prefix.bin]) or which(*commands) + + def test_help(self): + """Run h5bench help.""" + h5bench = which(self.prefix.bin.h5bench) + h5bench("-h") + + def test_h5bench(self): + """Run h5bench synchronous write test.""" + with working_dir(self.test_suite.current_test_cache_dir): + h5bench = which(self.prefix.bin.h5bench) + h5bench("--debug", "--abort", "samples/sync-write-1d-contig-contig.json") -- cgit v1.2.3-60-g2f50