# HG changeset patch # User fubar # Date 1605747885 0 # Node ID 48acd0708839b731b23d3168f5e973685d469393 # Parent 60df9669d01c622d1ab3fd2713dd2c4d0e41864c Uploaded diff -r 60df9669d01c -r 48acd0708839 toolfactory/rgToolFactory2.py --- 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]