changeset 83:48acd0708839 draft

Uploaded
author fubar
date Thu, 19 Nov 2020 01:04:45 +0000
parents 60df9669d01c
children 5304cda01f60
files toolfactory/rgToolFactory2.py
diffstat 1 files changed, 65 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/toolfactory/rgToolFactory2.py	Thu Nov 19 00:04:30 2020 +0000
+++ b/toolfactory/rgToolFactory2.py	Thu Nov 19 01:04:45 2020 +0000
@@ -873,8 +873,71 @@
         tout.close()
         return p.returncode
 
+    def planemo_test_biocontainer(self, genoutputs=True):
+        """planemo is a requirement so is available for testing but testing in a biocontainer
+        requires some fiddling to use the hacked galaxy-central .venv
+
+        Planemo runs:
+python ./scripts/functional_tests.py -v --with-nosehtml --html-report-file
+/export/galaxy-central/database/job_working_directory/000/17/working/TF_run_report_tempdir/tacrev_planemo_test_report.html
+--with-xunit --xunit-file /tmp/tmpt90p7f9h/xunit.xml --with-structureddata
+--structured-data-file
+/export/galaxy-central/database/job_working_directory/000/17/working/tfout/tool_test_output.json functional.test_toolbox
+
+
+        for the planemo-biocontainer,
+        planemo test --conda_dependency_resolution --skip_venv --galaxy_root /galthrow/ rgToolFactory2.xml
+
+        """
+        xreal = "%s.xml" % self.tool_name
+        tool_test_path = os.path.join(self.repdir,f"{self.tool_name}_planemo_test_report.html")
+        if os.path.exists(self.tlog):
+            tout = open(self.tlog, "a")
+        else:
+            tout = open(self.tlog, "w")
+        if genoutputs:
+            dummy, tfile = tempfile.mkstemp()
+            cll = [
+                ".","/home/biodocker/galaxy-central/.venv/bin/activate &&",
+                "planemo",
+                "test",
+                "--test_data", os.path.abspath(self.testdir),
+                "--test_output", os.path.abspath(tool_test_path),
+                "--skip_venv",
+                "--galaxy_root",
+                self.args.galaxy_root,
+                "--update_test_data",
+                os.path.abspath(xreal),
+            ]
+            p = subprocess.run(
+                cll,
+                shell=False,
+                cwd=self.tooloutdir,
+                stderr=dummy,
+                stdout=dummy,
+            )
+
+        else:
+            cll = [
+                ".","/home/biodocker/galaxy-central/.venv/bin/activate","&&",
+                "planemo",
+                "test",
+                "--test_data", os.path.abspath(self.testdir),
+                "--test_output", os.path.abspath(tool_test_path),
+                "--skip_venv",
+                "--galaxy_root",
+                self.args.galaxy_root,
+                os.path.abspath(xreal),
+            ]
+            p = subprocess.run(
+                cll, shell=False, cwd=self.tooloutdir, stderr=tout, stdout=tout
+            )
+        tout.close()
+        return p.returncode
+
     def planemo_test(self, genoutputs=True):
-        """planemo is a requirement so is available for testing
+        """planemo is a requirement so is available for testing but needs a different call if
+        in the biocontainer - see above
         and for generating test outputs if command or test overrides are supplied
         test outputs are sent to repdir for display
         planemo test --engine docker_galaxy  --galaxy_root /galaxy-central pyrevpos/pyrevpos.xml
@@ -937,6 +1000,7 @@
         tout.close()
         return p.returncode
 
+
     def writeShedyml(self):
         """for planemo"""
         yuser = self.args.user_email.split("@")[0]