Mousius commented on code in PR #11594:
URL: https://github.com/apache/tvm/pull/11594#discussion_r891246613
##########
jenkins/Test.groovy.j2:
##########
@@ -266,8 +266,13 @@ stage('Test') {
)
}
{{ m.upload_artifacts(tag='docs', filenames=["docs.tgz"]) }}
+ def docs_path =
"tvm-jenkins-artifacts-prod/tvm/${env.BRANCH_NAME}/docs/"
Review Comment:
Can this use `s3_prefix` which also incorporates `BUILD_NUMBER`?
See:
https://github.com/apache/tvm/blob/70884e957aa5c8de9c02c25a14d30563d7300cb9/Jenkinsfile#L97-L98
##########
tests/python/ci/test_ci.py:
##########
@@ -35,6 +35,37 @@ def run(self, *args):
raise RuntimeError(f"git command failed: '{args}'")
+def test_docs_comment(tmpdir_factory):
+ docs_comment_script = REPO_ROOT / "tests" / "scripts" /
"github_docs_comment.py"
+ base_url = "https://d3f1x5ne0bf47p.cloudfront.net"
+
+ def run(build_number, expected_url, expected_body):
Review Comment:
I think this is `pr_number` rather than `build_number` ?
##########
tests/python/ci/test_ci.py:
##########
@@ -35,6 +35,37 @@ def run(self, *args):
raise RuntimeError(f"git command failed: '{args}'")
+def test_docs_comment(tmpdir_factory):
+ docs_comment_script = REPO_ROOT / "tests" / "scripts" /
"github_docs_comment.py"
+ base_url = "https://d3f1x5ne0bf47p.cloudfront.net"
Review Comment:
Can we use a domain name we have control over rather than `cloudfront.net` ?
##########
tests/python/ci/test_ci.py:
##########
@@ -35,6 +35,37 @@ def run(self, *args):
raise RuntimeError(f"git command failed: '{args}'")
+def test_docs_comment(tmpdir_factory):
+ docs_comment_script = REPO_ROOT / "tests" / "scripts" /
"github_docs_comment.py"
+ base_url = "https://d3f1x5ne0bf47p.cloudfront.net"
+
+ def run(build_number, expected_url, expected_body):
+ git = TempGit(tmpdir_factory.mktemp("tmp_git_dir"))
+ git.run("init")
+ git.run("checkout", "-b", "main")
+ git.run("remote", "add", "origin", "https://github.com/apache/tvm.git")
+ proc = subprocess.run(
+ [str(docs_comment_script), "--dry-run"],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ env={"PR": json.dumps({"number": int(build_number)})},
+ encoding="utf-8",
+ cwd=git.cwd,
+ )
+ if proc.returncode != 0:
+ raise RuntimeError(f"Process
failed:\nstdout:\n{proc.stdout}\n\nstderr:\n{proc.stderr}")
+
+ assert (
+ f"Dry run, would have posted {expected_url} with data
{expected_body}." in proc.stdout
+ )
+
+ run(
Review Comment:
Please use `pytest.mark.parameterize` rather than nested function calls
(see: https://docs.pytest.org/en/6.2.x/parametrize.html)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]