Skip to content

Improve test-local.sh multi-phase pytest exit handling and failure reporting #362

@shaypal5

Description

@shaypal5

Summary

scripts/test-local.sh can run tests in two phases:

  1. main pytest invocation
  2. optional seriallocal invocation

The script currently relies on shell set -e behavior and only reads $? at the end, which makes the success/failure accounting implicit.

Current behavior

  • Failures do cause non-zero exit due to set -e.
  • But the script does not explicitly capture/report separate phase exit codes.
  • If we keep or extend multi-phase execution, explicit aggregation would make behavior clearer and safer to evolve.

Proposed change

  • Capture exit code immediately after each pytest phase.
  • Aggregate into a final script exit code (non-zero if any phase failed).
  • Preserve readable per-phase logging for diagnostics.

Acceptance criteria

  • Script exits non-zero when either phase fails.
  • Script exit behavior is explicit in code (not only implicit via set -e).
  • Log output clearly indicates which phase failed.

Context

Follow-up from Copilot review discussion on PR #360.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions