comparison toolfactory/rgToolFactory2.py @ 83:48acd0708839 draft

Uploaded
author fubar
date Thu, 19 Nov 2020 01:04:45 +0000
parents 6395be766c2e
children 5304cda01f60
comparison
equal deleted inserted replaced
82:60df9669d01c 83:48acd0708839
871 cll, shell=False, stderr=tout, stdout=tout) 871 cll, shell=False, stderr=tout, stdout=tout)
872 tout.write("eph_test Ran %s got %d" % (" ".join(cll), p.returncode)) 872 tout.write("eph_test Ran %s got %d" % (" ".join(cll), p.returncode))
873 tout.close() 873 tout.close()
874 return p.returncode 874 return p.returncode
875 875
876 def planemo_test_biocontainer(self, genoutputs=True):
877 """planemo is a requirement so is available for testing but testing in a biocontainer
878 requires some fiddling to use the hacked galaxy-central .venv
879
880 Planemo runs:
881 python ./scripts/functional_tests.py -v --with-nosehtml --html-report-file
882 /export/galaxy-central/database/job_working_directory/000/17/working/TF_run_report_tempdir/tacrev_planemo_test_report.html
883 --with-xunit --xunit-file /tmp/tmpt90p7f9h/xunit.xml --with-structureddata
884 --structured-data-file
885 /export/galaxy-central/database/job_working_directory/000/17/working/tfout/tool_test_output.json functional.test_toolbox
886
887
888 for the planemo-biocontainer,
889 planemo test --conda_dependency_resolution --skip_venv --galaxy_root /galthrow/ rgToolFactory2.xml
890
891 """
892 xreal = "%s.xml" % self.tool_name
893 tool_test_path = os.path.join(self.repdir,f"{self.tool_name}_planemo_test_report.html")
894 if os.path.exists(self.tlog):
895 tout = open(self.tlog, "a")
896 else:
897 tout = open(self.tlog, "w")
898 if genoutputs:
899 dummy, tfile = tempfile.mkstemp()
900 cll = [
901 ".","/home/biodocker/galaxy-central/.venv/bin/activate &&",
902 "planemo",
903 "test",
904 "--test_data", os.path.abspath(self.testdir),
905 "--test_output", os.path.abspath(tool_test_path),
906 "--skip_venv",
907 "--galaxy_root",
908 self.args.galaxy_root,
909 "--update_test_data",
910 os.path.abspath(xreal),
911 ]
912 p = subprocess.run(
913 cll,
914 shell=False,
915 cwd=self.tooloutdir,
916 stderr=dummy,
917 stdout=dummy,
918 )
919
920 else:
921 cll = [
922 ".","/home/biodocker/galaxy-central/.venv/bin/activate","&&",
923 "planemo",
924 "test",
925 "--test_data", os.path.abspath(self.testdir),
926 "--test_output", os.path.abspath(tool_test_path),
927 "--skip_venv",
928 "--galaxy_root",
929 self.args.galaxy_root,
930 os.path.abspath(xreal),
931 ]
932 p = subprocess.run(
933 cll, shell=False, cwd=self.tooloutdir, stderr=tout, stdout=tout
934 )
935 tout.close()
936 return p.returncode
937
876 def planemo_test(self, genoutputs=True): 938 def planemo_test(self, genoutputs=True):
877 """planemo is a requirement so is available for testing 939 """planemo is a requirement so is available for testing but needs a different call if
940 in the biocontainer - see above
878 and for generating test outputs if command or test overrides are supplied 941 and for generating test outputs if command or test overrides are supplied
879 test outputs are sent to repdir for display 942 test outputs are sent to repdir for display
880 planemo test --engine docker_galaxy --galaxy_root /galaxy-central pyrevpos/pyrevpos.xml 943 planemo test --engine docker_galaxy --galaxy_root /galaxy-central pyrevpos/pyrevpos.xml
881 944
882 Planemo runs: 945 Planemo runs:
934 p = subprocess.run( 997 p = subprocess.run(
935 cll, shell=False, cwd=self.tooloutdir, stderr=tout, stdout=tout 998 cll, shell=False, cwd=self.tooloutdir, stderr=tout, stdout=tout
936 ) 999 )
937 tout.close() 1000 tout.close()
938 return p.returncode 1001 return p.returncode
1002
939 1003
940 def writeShedyml(self): 1004 def writeShedyml(self):
941 """for planemo""" 1005 """for planemo"""
942 yuser = self.args.user_email.split("@")[0] 1006 yuser = self.args.user_email.split("@")[0]
943 yfname = os.path.join(self.tooloutdir, ".shed.yml") 1007 yfname = os.path.join(self.tooloutdir, ".shed.yml")