Skip to content
Snippets Groups Projects

stand-alone (not built-time) tests

Merged Eleni Mathioulaki requested to merge stand-alone-tests into master
4 files
+ 71
24
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -37,16 +37,13 @@ class WfBrainscales2Demos(Package):
@@ -37,16 +37,13 @@ class WfBrainscales2Demos(Package):
depends_on('py-pandas@1.4.2:', type=("run", "test"))
depends_on('py-pandas@1.4.2:', type=("run", "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):
def _run_notebooks(self, output_dir):
# TODO: remove debug output
mkdirp(output_dir)
cmd_env = which("env")
cmd_env()
# execute notebook and save
# execute notebook and save
jupyter = Executable("jupyter")
jupyter = Executable("jupyter")
for fn in glob("ts*.ipynb") + glob("tp*.ipynb"):
for fn in glob(join_path(prefix, "notebooks", "ts*.ipynb")) + glob(join_path(prefix, "notebooks", "tp*.ipynb")):
jupyter("nbconvert",
jupyter("nbconvert",
"--ExecutePreprocessor.kernel_name=python3",
"--ExecutePreprocessor.kernel_name=python3",
"--execute",
"--execute",
@@ -55,7 +52,7 @@ class WfBrainscales2Demos(Package):
@@ -55,7 +52,7 @@ class WfBrainscales2Demos(Package):
"notebook",
"notebook",
fn,
fn,
"--output",
"--output",
prefix + "/.spack_test_results/" + fn)
join_path(output_dir, os.path.basename(fn)))
def _set_collab_things(self):
def _set_collab_things(self):
# enable "EBRAINS lab" mode
# enable "EBRAINS lab" mode
@@ -69,8 +66,8 @@ class WfBrainscales2Demos(Package):
@@ -69,8 +66,8 @@ class WfBrainscales2Demos(Package):
def installcheck(self):
def installcheck(self):
self._set_collab_things()
self._set_collab_things()
# TODO (ECM): Provide a selection of notebooks that perform local-only tests.
# TODO (ECM): Provide a selection of notebooks that perform local-only tests.
#self._run_notebooks()
#self._run_notebooks(join_path(self.prefix, ".spack_test_results"))
def test_notebooks(self):
def test_notebooks(self):
self._set_collab_things()
self._set_collab_things()
self._run_notebooks()
self._run_notebooks(join_path(self.test_suite.stage, self.spec.format("out-{name}-{version}-{hash:7}")))