Skip to content
Snippets Groups Projects
Commit b7dff4ba authored by Eleni Mathioulaki's avatar Eleni Mathioulaki
Browse files

run multi_area_model as stand-alone test

parent 28afd512
No related branches found
No related tags found
No related merge requests found
...@@ -28,12 +28,26 @@ class WfMultiAreaModel(Package): ...@@ -28,12 +28,26 @@ class WfMultiAreaModel(Package):
depends_on("py-notebook", type="test") depends_on("py-notebook", type="test")
def install(self, spec, prefix): def install(self, spec, prefix):
# sanity_check_prefix requires something in the install directory install_tree(".", join_path(prefix, "notebooks"))
mkdirp(prefix + "/.spack_test_results")
def _run_notebooks(self, output_dir):
mkdirp(output_dir)
# execute notebook and save
jupyter = Executable("jupyter")
jupyter("nbconvert",
"--ExecutePreprocessor.kernel_name=python3",
"--execute",
"--allow-errors",
"--to",
"notebook",
join_path(self.prefix, "notebooks", "multi-area-model.ipynb"),
"--output",
join_path(output_dir, "multi-area-model.ipynb"))
@run_after("install") @run_after("install")
@on_package_attributes(run_tests=True) @on_package_attributes(run_tests=True)
def installcheck(self): def installcheck(self):
# execute notebook and save self._run_notebooks(join_path(self.prefix, ".spack_test_results"))
jupyter = Executable("jupyter")
jupyter("nbconvert", "--ExecutePreprocessor.kernel_name=python3", "--execute", "--allow-errors", "--to", "notebook", "multi-area-model.ipynb", "--output", prefix+"/.spack_test_results/multi-area-model.ipynb") def test(self):
self._run_notebooks(join_path(self.test_suite.stage, self.spec.format("out-{name}-{version}-{hash:7}")))
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