# HG changeset patch # User fubar # Date 1618896652 0 # Node ID c4f192ec521c7492dd50c08d12e9526a1f050b1b # Parent b65ec4f387b9a5aa6886ebe962e8bba49c8b8763 Uploaded diff -r b65ec4f387b9 -r c4f192ec521c toolfactory/rgToolFactory2.py --- a/toolfactory/rgToolFactory2.py Sun Apr 18 04:42:15 2021 +0000 +++ b/toolfactory/rgToolFactory2.py Tue Apr 20 05:30:52 2021 +0000 @@ -1043,6 +1043,23 @@ and for generating test outputs if command or test overrides are supplied test outputs are sent to repdir for display """ + penv = os.environ + phome = penv['HOME'] + isDocker = os.path.exists('/.dockerenv') + if isDocker: # use the volume if it exists + phome = '/home/planemo' + if os.path.exists(phome): # is mounted + home = phome + else: + home = '/tmp/planemo' # this will be brutal but otherwise /home/galaxy + os.mkdir('/tmp/planemo') + penv["HOME"] = phome + path = penv['PATH'] + penv['PATH'] = '%s:%s' % (phome,path) + print(f"#### set home to {phome} with path={penv['PATH']}") + #pconfig = os.path.join(phome,'.planemo.yml') + #penv["PLANEMO_GLOBAL_CONFIG_PATH"] = pconfig + # self.set_planemo_galaxy_root(self.args.galaxy_root, config_path=pconfig) xreal = "%s.xml" % self.tool_name tool_test_path = os.path.join( self.repdir, f"{self.tool_name}_planemo_test_report.html" @@ -1054,17 +1071,20 @@ cll = [ "planemo", "test", + "--galaxy_python_version", + self.args.python_version, "--test_data", os.path.abspath(self.testdir), "--test_output", os.path.abspath(tool_test_path), - "--galaxy_root", - self.args.galaxy_root, + ## "--galaxy_root", + ## self.args.galaxy_root, "--update_test_data", os.path.abspath(xreal), ] p = subprocess.run( cll, + env = penv, shell=False, cwd=self.tooloutdir, stderr=tout, @@ -1073,6 +1093,36 @@ tout.close() return p.returncode + def set_planemo_galaxy_root(self, galaxyroot, config_path): + # planemo tries to write to ~/.planemo - trying to convince it otherwise + CONFIG_TEMPLATE = """## Planemo Global Configuration File. +## Everything in this file is completely optional - these values can all be +## configured via command line options for the corresponding commands. +## Specify a default galaxy_root for test and server commands here. +galaxy_root: %s +## Username used with toolshed(s). +#shed_username: "" +sheds: + # For each tool shed you wish to target, uncomment key or both email and + # password. + toolshed: + #key: "" + #email: "" + #password: "" + testtoolshed: + #key: "" + #email: "" + #password: "" + local: + #key: "" + #email: "" + #password: "" +""" + if not os.path.exists(config_path): + with open(config_path, "w") as f: + f.write(CONFIG_TEMPLATE % galaxyroot) + + def main(): """ This is a Galaxy wrapper. diff -r b65ec4f387b9 -r c4f192ec521c toolfactory/rgToolFactory2.xml --- a/toolfactory/rgToolFactory2.xml Sun Apr 18 04:42:15 2021 +0000 +++ b/toolfactory/rgToolFactory2.xml Tue Apr 20 05:30:52 2021 +0000 @@ -64,8 +64,8 @@
- + - - + + @@ -99,15 +99,15 @@ - - + + - - + + @@ -127,14 +127,14 @@
-
+
- + @@ -182,6 +182,7 @@ galaxyxml planemo + ephemeris