Skip to content
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: 1 addition & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 8 additions & 6 deletions policyengine_us/tests/test_batched.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import gc
import time
import argparse
import re
from pathlib import Path
from typing import List, Dict

Expand Down Expand Up @@ -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...")

Expand Down