You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/09/02 00:20:30 UTC

[GitHub] [tvm] driazati commented on a diff in pull request #12361: [ci][tvmbot] Trigger GitHub Actions after merging

driazati commented on code in PR #12361:
URL: https://github.com/apache/tvm/pull/12361#discussion_r961193815


##########
tests/python/ci/test_utils.py:
##########
@@ -30,12 +31,41 @@ class TempGit:
 
     def __init__(self, cwd):
         self.cwd = cwd
+        # Jenkins git is too old and doesn't have 'git init --initial-branch'
+        self.run("init", stderr=subprocess.PIPE, stdout=subprocess.PIPE)
+        self.run("checkout", "-b", "main", stderr=subprocess.PIPE)
+        self.run("remote", "add", "origin", "https://github.com/apache/tvm.git")
 
     def run(self, *args, **kwargs):
+        """
+        Run a git command based on *args
+        """
         proc = subprocess.run(
             ["git"] + list(args), encoding="utf-8", cwd=self.cwd, check=False, **kwargs
         )
         if proc.returncode != 0:
             raise RuntimeError(f"git command failed: '{args}'")
 
         return proc
+
+
+def run_script(command: List[Any], check: bool = True, **kwargs):

Review Comment:
   `check_output` is kind of the same but not really, it enables stdout catching all the time but here usually we want to print out both streams on an error and none if its fine (unless otherwise requested)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org