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/07/12 17:22:06 UTC

[GitHub] [tvm] areusch commented on a diff in pull request #11974: [ci] Override `Request` in pytests

areusch commented on code in PR #11974:
URL: https://github.com/apache/tvm/pull/11974#discussion_r919225338


##########
conftest.py:
##########
@@ -96,3 +100,12 @@ def pytest_collection_modifyitems(config, items):
                 reason=f"Test running on shard {item_shard_index} of {num_shards}",
             )
         )
+
+
+def pytest_sessionstart():
+    if IS_IN_CI:
+        hook_script_dir = REPO_ROOT / "tests" / "scripts" / "request_hook"
+        sys.path.append(str(hook_script_dir))
+        import request_hook  # pylint: disable=import-outside-toplevel
+
+        request_hook.init()

Review Comment:
   maybe print a warning here?



##########
conftest.py:
##########
@@ -16,10 +16,14 @@
 # under the License.
 import hashlib
 import pytest
+import sys
 import os
-from collections import OrderedDict
+
+from pathlib import Path
 
 pytest_plugins = ["tvm.testing.plugin"]
+IS_IN_CI = os.getenv("CI", "") == "true"

Review Comment:
   should this be "CI" in os.environ?



-- 
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