Mercurial > repos > fubar > tool_factory_2
comparison toolfactory/rgToolFactory2.py @ 78:89aca6c67405 draft
Uploaded
author | fubar |
---|---|
date | Tue, 17 Nov 2020 06:04:40 +0000 |
parents | 46db8143adb7 |
children | f423a77bc669 |
comparison
equal
deleted
inserted
replaced
77:1fa49a9a4ec5 | 78:89aca6c67405 |
---|---|
1 #!/usr/bin/python3 | 1 |
2 # rgToolFactory.py | 2 # rgToolFactory.py |
3 # see https://github.com/fubar2/toolfactory | 3 # see https://github.com/fubar2/toolfactory |
4 # | 4 # |
5 # copyright ross lazarus (ross stop lazarus at gmail stop com) May 2012 | 5 # copyright ross lazarus (ross stop lazarus at gmail stop com) May 2012 |
6 # | 6 # |
880 and for generating test outputs if command or test overrides are supplied | 880 and for generating test outputs if command or test overrides are supplied |
881 test outputs are sent to repdir for display | 881 test outputs are sent to repdir for display |
882 planemo test --engine docker_galaxy --database_type docker_postgres --galaxy_root /galaxy-central pyrevpos/pyrevpos.xml | 882 planemo test --engine docker_galaxy --database_type docker_postgres --galaxy_root /galaxy-central pyrevpos/pyrevpos.xml |
883 """ | 883 """ |
884 xreal = "%s.xml" % self.tool_name | 884 xreal = "%s.xml" % self.tool_name |
885 tool_test_path = os.path.join(self.repdir,f"{self.tool_name}_planemo_test_report.html") | |
885 if os.path.exists(self.tlog): | 886 if os.path.exists(self.tlog): |
886 tout = open(self.tlog, "a") | 887 tout = open(self.tlog, "a") |
887 else: | 888 else: |
888 tout = open(self.tlog, "w") | 889 tout = open(self.tlog, "w") |
889 if genoutputs: | 890 if genoutputs: |
890 dummy, tfile = tempfile.mkstemp() | 891 dummy, tfile = tempfile.mkstemp() |
891 cll = [ | 892 cll = [ |
892 "planemo", | 893 "planemo", |
893 "test", | 894 "test", |
895 "--test_output_xunit",os.path.join(self.repdir,f"{self.tool_name}_xunit.xml") | |
896 "--test_data", os.path.abspath(self.testdir), | |
897 "--test_output", os.path.abspath(tool_test_path), | |
894 "--galaxy_root", | 898 "--galaxy_root", |
895 self.args.galaxy_root, | 899 self.args.galaxy_root, |
896 "--update_test_data", | 900 "--update_test_data", |
897 xreal, | 901 os.path.abspath(xreal), |
898 ] | 902 ] |
899 p = subprocess.run( | 903 p = subprocess.run( |
900 cll, | 904 cll, |
901 shell=False, | 905 shell=False, |
902 cwd=self.tooloutdir, | 906 cwd=self.tooloutdir, |
903 stderr=dummy, | 907 stderr=tout, |
904 stdout=dummy, | 908 stdout=tout, |
905 ) | 909 ) |
906 else: | 910 else: |
907 cll = [ | 911 cll = [ |
908 "planemo", | 912 "planemo", |
909 "test", | 913 "test", |
914 "--test_data", self.testdir, | |
915 "--test_output", tool_test_path, | |
910 "--galaxy_root", | 916 "--galaxy_root", |
911 self.args.galaxy_root, | 917 self.args.galaxy_root, |
912 xreal, | 918 os.path.abspath(xreal), |
913 ] | 919 ] |
914 p = subprocess.run( | 920 p = subprocess.run( |
915 cll, shell=False, cwd=self.tooloutdir, stderr=tout, stdout=tout | 921 cll, shell=False, cwd=self.tooloutdir, stderr=tout, stdout=tout |
916 ) | 922 ) |
917 tout.close() | 923 tout.close() |