From bdda86c12dd0b3aa265feee1f085b1dce8295d22 Mon Sep 17 00:00:00 2001 From: Ziming Date: Mon, 12 Jan 2026 10:48:58 -0500 Subject: [PATCH 1/2] test_batched.py incorrectly marks tests as passed when failure count ends in 0 Fixes #7152 --- .github/workflows/push.yaml | 2 +- policyengine_us/tests/test_batched.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) 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/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...") From 9951d055dcdc7e899de22cd828af65108fea7991 Mon Sep 17 00:00:00 2001 From: Ziming Date: Mon, 12 Jan 2026 10:49:46 -0500 Subject: [PATCH 2/2] changelog --- changelog_entry.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index f8f61c000cc..b8f7c96e0d9 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,4 +1,5 @@ -- bump: minor +- bump: patch changes: - added: - - Add Florida Temporary Cash Assistance (TCA) program. + 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.