Skip to content

Update CI to exercise async test coverage for v1.1 #312

Description

@Mattsface

Parent: #297

Goal

Update the GitHub Actions test workflow so the v1.1 async transport tests actually run in CI while preserving coverage for the default sync-only installation path.

Why this is needed

The current Offline CI workflow installs dependencies with:

poetry install --no-interaction

Because HTTPX is an optional dependency behind the async extra, the async adapter tests skip in CI when that extra is not installed. The workflow also still targets release/1.0.0 rather than the active release/1.1.0 integration branch.

This creates a coverage gap where the new async transport can appear green locally but receive no meaningful protection from the GitHub Actions matrix.

Scope

Update .github/workflows/build-and-test.yml so that:

  • pull requests targeting release/1.1.0 run CI
  • pushes to release/1.1.0 run CI
  • the existing Python 3.10–3.14 offline-test matrix installs the async extra and therefore executes both synchronous and asynchronous offline tests
  • a small separate sync-only job verifies that the default installation still works without HTTPX
  • the existing package-build and release-artifact validation flow remains intact unless a change is strictly required for the CI update

Proposed test split

Main offline matrix

Use the existing Python 3.10–3.14 matrix, but install the async extra, for example:

poetry install --no-interaction -E async

This matrix should run the normal offline suite so both sync and async implementation tests execute across all supported Python versions.

Sync-only installation smoke test

Add one lightweight job on a representative supported Python version that installs without extras:

poetry install --no-interaction

Then verify that a normal synchronous import still works without HTTPX, for example:

from mlbstatsapi import Mlb

The purpose of this job is to protect the optional-dependency contract established in #300. It does not need to duplicate the full five-version test matrix.

Out of scope

Do not expand scripts/validate_release.py into full async artifact validation in this issue. Clean-install validation of both python-mlb-statsapi and python-mlb-statsapi[async] belongs with the v1.1 release-validation work in #307.

Do not change async transport behavior in this CI issue.

Do not make HTTPX mandatory for ordinary package installation.

Acceptance criteria

  • CI runs for pull requests targeting release/1.1.0
  • CI runs for pushes to release/1.1.0
  • Python 3.10–3.14 offline matrix installs the async extra
  • Async adapter tests no longer skip merely because HTTPX is absent from the CI environment
  • Existing synchronous tests continue to run in the same matrix
  • A sync-only installation job verifies Mlb remains importable without the async extra
  • The optional HTTPX dependency contract from Add optional async dependency and packaging support #300 remains intact
  • Package build and existing release-artifact validation continue to pass

Refs #297, #300, #301, #302, #307

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions