diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 3a2ccb4aea7..560c4a754c6 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -5,7 +5,7 @@ on: # Concurrency: queues runs to ensure each merge completes its versioning/publishing concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: false jobs: Lint: runs-on: ubuntu-latest diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb2d..b8f7c96e0d9 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,5 @@ +- bump: patch + changes: + fixed: + - Fix test_batched.py incorrectly marking tests as passed when failure count ends in 0. + - Fix push.yaml concurrency to queue runs instead of cancelling versioning jobs. diff --git a/policyengine_us/tests/test_batched.py b/policyengine_us/tests/test_batched.py index d5a6b54e14a..ce7a3511416 100644 --- a/policyengine_us/tests/test_batched.py +++ b/policyengine_us/tests/test_batched.py @@ -10,6 +10,7 @@ import gc import time import argparse +import re from pathlib import Path from typing import List, Dict @@ -256,15 +257,16 @@ def run_batch(test_paths: List[str], batch_name: str) -> Dict: # Detect pytest completion # Look for patterns like "====== 5638 passed in 491.24s ======" # or "====== 2 failed, 5636 passed in 500s ======" - import re - if re.search(r"=+.*\d+\s+(passed|failed).*in\s+[\d.]+s.*=+", line): test_completed = True - # Check if tests passed (no failures mentioned or 0 failed) - if "failed" not in line or "0 failed" in line: - test_passed = True + # Check if tests passed by parsing actual failure count + failed_match = re.search(r"(\d+) failed", line) + if failed_match: + failed_count = int(failed_match.group(1)) + test_passed = failed_count == 0 else: - test_passed = False + # No "X failed" in line means all passed + test_passed = True print(f"\n Tests completed, terminating process...")