Add -i option
This commit is contained in:
parent
5b92d2a8a5
commit
c396682913
13
main.py
13
main.py
@ -19,7 +19,7 @@ worktrees = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def _run_odoo(worktree_root, test_tags: str) -> bool:
|
def _run_odoo(worktree_root, test_tags: str, init: str) -> bool:
|
||||||
venv_path = f"{worktree_root}/venv-bisect"
|
venv_path = f"{worktree_root}/venv-bisect"
|
||||||
rmtree(venv_path, ignore_errors=True)
|
rmtree(venv_path, ignore_errors=True)
|
||||||
subprocess.check_call(
|
subprocess.check_call(
|
||||||
@ -43,7 +43,7 @@ def _run_odoo(worktree_root, test_tags: str) -> bool:
|
|||||||
env=env,
|
env=env,
|
||||||
)
|
)
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
["odoo", "--no-patch", "--drop", "--test-tags", test_tags],
|
["odoo", "--no-patch", "--drop", "-i", init, "--test-tags", test_tags],
|
||||||
cwd=worktree_root,
|
cwd=worktree_root,
|
||||||
env=env,
|
env=env,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
@ -114,7 +114,7 @@ def _find_first_failing_commit(batches: list[int], test_failed):
|
|||||||
raise ValueError("404")
|
raise ValueError("404")
|
||||||
|
|
||||||
|
|
||||||
def _bisect(version: str, test_tags: str) -> Optional[dict[Repo, str]]:
|
def _bisect(version: str, test_tags: str, init: str) -> Optional[dict[Repo, str]]:
|
||||||
bundle = bundles[version]
|
bundle = bundles[version]
|
||||||
worktree_root = worktrees[version]
|
worktree_root = worktrees[version]
|
||||||
odoo_repository = GitRepository(f"{worktree_root}/odoo")
|
odoo_repository = GitRepository(f"{worktree_root}/odoo")
|
||||||
@ -125,7 +125,7 @@ def _bisect(version: str, test_tags: str) -> Optional[dict[Repo, str]]:
|
|||||||
commits = _commits_from_batch(batch)
|
commits = _commits_from_batch(batch)
|
||||||
odoo_repository.checkout(commits["odoo"])
|
odoo_repository.checkout(commits["odoo"])
|
||||||
enterprise_repository.checkout(commits["enterprise"])
|
enterprise_repository.checkout(commits["enterprise"])
|
||||||
return not _run_odoo(test_tags)
|
return not _run_odoo(test_tags, init)
|
||||||
|
|
||||||
suspect = _find_first_failing_commit(batches, test_failed)
|
suspect = _find_first_failing_commit(batches, test_failed)
|
||||||
if suspect:
|
if suspect:
|
||||||
@ -159,8 +159,9 @@ def _bisect(version: str, test_tags: str) -> Optional[dict[Repo, str]]:
|
|||||||
@click.command()
|
@click.command()
|
||||||
@click.option("--version", default="17.0", type=click.Choice(bundles.keys()))
|
@click.option("--version", default="17.0", type=click.Choice(bundles.keys()))
|
||||||
@click.option("--test-tags")
|
@click.option("--test-tags")
|
||||||
def main(version, test_tags):
|
@click.option("-i", "--init")
|
||||||
_bisect(version, test_tags)
|
def main(version, test_tags, init):
|
||||||
|
_bisect(version, test_tags, init)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user