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