Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): remove redundant --concurrency test run in CI #207

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ jobs:
python3 -m venv ci
ci/bin/pip install -r scripts/requirements.txt
ci/bin/python scripts/run_tests.py --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
ci/bin/python scripts/run_tests.py --changes_only --concurrency --commit_id ${{ github.event.pull_request.base.sha }}
env:
SEED: 0

Expand All @@ -129,7 +128,6 @@ jobs:
python3 -m venv ci
ci/bin/pip install -r scripts/requirements.txt
ci/bin/python scripts/run_tests.py
ci/bin/python scripts/run_tests.py --concurrency
env:
SEED: 0

Expand Down
15 changes: 2 additions & 13 deletions scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def packages_to_test_due_to_global_changes(files: List[str]) -> Set[str]:
return set()


def run_test(changes_only: bool, commit_id: Optional[str], concurrency: bool):
def run_test(changes_only: bool, commit_id: Optional[str]):
local_changes = get_local_changes(".", commit_id=commit_id)
modified_packages = get_modified_packages(local_changes)
args = []
Expand All @@ -100,12 +100,6 @@ def run_test(changes_only: bool, commit_id: Optional[str], concurrency: bool):
# args).
cmd = ["cargo", "test"] + args

# TODO: Less specific handling of active feature combinations in tests (which combos should be
# tested and which shouldn't?).
# If blockifier is to be tested, add the concurrency flag if requested.
if concurrency and "blockifier" in tested_packages:
cmd.extend(["--features", "concurrency"])

print("Running tests...")
print(cmd, flush=True)
subprocess.run(cmd, check=True)
Expand All @@ -115,18 +109,13 @@ def run_test(changes_only: bool, commit_id: Optional[str], concurrency: bool):
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Presubmit script.")
parser.add_argument("--changes_only", action="store_true")
parser.add_argument(
"--concurrency",
action="store_true",
help="If blockifier is to be tested, add the concurrency flag.",
)
parser.add_argument("--commit_id", type=str, help="GIT commit ID to compare against.")
return parser.parse_args()


def main():
args = parse_args()
run_test(changes_only=args.changes_only, commit_id=args.commit_id, concurrency=args.concurrency)
run_test(changes_only=args.changes_only, commit_id=args.commit_id)


if __name__ == "__main__":
Expand Down
Loading