MCPcopy Create free account
hub / github.com/apache/tvm / test_skip_ci

Function test_skip_ci

tests/python/ci/test_ci.py:725–749  ·  view source on GitHub ↗

Test that CI is skipped when it should be

(tmpdir_factory, commands, should_skip, pr_title, why)

Source from the content-addressed store, hash-verified

723 ),
724)
725def test_skip_ci(tmpdir_factory, commands, should_skip, pr_title, why):
726 """
727 Test that CI is skipped when it should be
728 """
729 skip_ci_script = JENKINS_SCRIPT_ROOT / "git_skip_ci.py"
730
731 git = TempGit(tmpdir_factory.mktemp("tmp_git_dir"))
732
733 git.run("config", "user.name", "ci")
734 git.run("config", "user.email", "email@example.com")
735 git.run("commit", "--allow-empty", "--message", "base commit")
736 for command in commands:
737 git.run(*command)
738 pr_number = "1234"
739 proc = run_script(
740 [skip_ci_script, "--pr", pr_number, "--pr-title", pr_title],
741 cwd=git.cwd,
742 check=False,
743 )
744 expected = 0 if should_skip else 1
745 if proc.returncode != expected:
746 raise RuntimeError(
747 f"Unexpected return code {proc.returncode} "
748 f"(expected {expected}) in {why}:\n{proc.stdout}"
749 )
750
751
752@parameterize_named(

Callers

nothing calls this directly

Calls 3

runMethod · 0.95
TempGitClass · 0.85
run_scriptFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…