comparison toolfactory/rgToolFactory2.py @ 96:d54976fc996a draft

Uploaded
author fubar
date Fri, 20 Nov 2020 09:06:25 +0000
parents 6d122fd54cd0
children 515be7318f2b
comparison
equal deleted inserted replaced
95:6d122fd54cd0 96:d54976fc996a
965 if genoutputs: 965 if genoutputs:
966 dummy, tfile = tempfile.mkstemp() 966 dummy, tfile = tempfile.mkstemp()
967 cll = [ 967 cll = [
968 "planemo", 968 "planemo",
969 "test", 969 "test",
970 "--test_data", os.path.abspath(self.testdir),
971 "--test_output", os.path.abspath(tool_test_path),
972 "--skip_venv", 970 "--skip_venv",
973 "--galaxy_root", 971 "--galaxy_root",
974 self.args.galaxy_root, 972 self.args.galaxy_root,
975 "--update_test_data", 973 "--update_test_data",
976 os.path.abspath(xreal), 974 os.path.abspath(xreal),
977 ] 975 ]
978 p = subprocess.run( 976 p = subprocess.run(
979 cll, 977 cll,
980 shell=False, 978 shell=False,
981 cwd=self.tooloutdir, 979 cwd=self.testdir,
982 stderr=dummy, 980 stderr=dummy,
983 stdout=dummy, 981 stdout=dummy,
984 ) 982 )
985 983
986 else: 984 else:
993 "--galaxy_root", 991 "--galaxy_root",
994 self.args.galaxy_root, 992 self.args.galaxy_root,
995 os.path.abspath(xreal), 993 os.path.abspath(xreal),
996 ] 994 ]
997 p = subprocess.run( 995 p = subprocess.run(
998 cll, shell=False, cwd=self.tooloutdir, stderr=tout, stdout=tout 996 cll, shell=False, cwd=self.testdir, stderr=tout, stdout=tout
999 ) 997 )
1000 tout.close() 998 tout.close()
1001 return p.returncode 999 return p.returncode
1002 1000
1003 1001
1043 if filename.startswith(excludeme) 1041 if filename.startswith(excludeme)
1044 else tarinfo 1042 else tarinfo
1045 ) 1043 )
1046 1044
1047 for p in self.outfiles: 1045 for p in self.outfiles:
1048 src = p[ONAMEPOS] 1046 oname = p[ONAMEPOS]
1047 src = os.path.join(self.testdir,oname)
1049 if os.path.isfile(src): 1048 if os.path.isfile(src):
1050 dest = os.path.join(self.testdir, "%s_sample" % src) 1049 dest = os.path.join(self.testdir, "%s_sample" % oname)
1051 shutil.copyfile(src, dest) 1050 shutil.copyfile(src, dest)
1052 dest = os.path.join(self.repdir, "%s.%s" % (src, p[OFMTPOS])) 1051 dest = os.path.join(self.repdir, "%s.sample" % (oname))
1053 shutil.copyfile(src, dest) 1052 shutil.copyfile(src, dest)
1054 else: 1053 else:
1055 print( 1054 print(
1056 "### problem - output file %s not found in tooloutdir %s" 1055 "### problem - output file %s not found in tooloutdir %s"
1057 % (src, self.tooloutdir) 1056 % (src, self.tooloutdir)