ci: run Python SDK and sample regression tests - #325
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Nice work, @arjun2075, clean scope, clean sequencing, and good call documenting the expected red baseline instead of mixing fixes into the CI PR. |
|
Thanks — really appreciate the review. That separation was intentional: I wanted the CI change to make the existing contract visible without bundling in behavioral fixes just to get a green baseline. Once #310 and #313 land, I’ll rebase onto main, rerun both Python suites, and update the draft with the resulting green baseline before marking it ready for review. |
Description
The Python SDK tests (
code/sdk/python/ap2/tests/) and the sample regression tests(
code/samples/python/tests/) are not currently executed by any GitHub Actionsworkflow, so regressions in either suite are only caught when a contributor runs
pytest locally.
This PR adds a single Python 3.12 CI job that syncs the AP2 uv workspace once and
then runs both suites.
What this changes
.github/workflows/python-tests.yml— one job, on pushes tomainand pullrequests targeting
mainuv sync --all-packages, then runs both suites withuv run --no-syncso they reuse that environment instead of re-resolving per stepWhat this deliberately does not change
uv.lock(removed in fix: remove uvlock #246), so the workflow resolves the workspace at run time, matching the
repository's current setup. This PR does not reintroduce a lockfile.
paths:filter initially, so the check behaves predictably on every PR ratherthan depending on workflow-level path skipping. Straightforward to narrow if
maintainers prefer lower CI usage.
small, and a minimum-supported-version matrix is a reasonable follow-up.
Workflow hardening
Third-party actions are pinned to immutable commit SHAs,
persist-credentials: falseis set on checkout, workflow permissions are
contents: read, and the job is boundedwith
timeout-minutes: 15. These are defensive choices rather than an existingrepository-wide requirement.
Current status — draft
This is opened as a draft because the checks are expected to be red on the current
mainbaseline:code/samples/python/tests/does not exist onmainyet — it is added by fix(samples): fail closed in x402 PSP when agent-provider key is missing #310, sothe sample step currently collects no tests.
main(
kb_sd_jwt_intermediate_tests.py::test_verify_rejects_aud_mismatchand::test_verify_rejects_nonce_mismatch) are addressed by fix(sdjwt): enforce aud/nonce binding on every KB hop, fail closed on terminal #313.Local run on Python 3.12 against this branch: SDK suite 186 passed / 2 failed (the two
above), sample suite 0 collected. This PR intentionally does not modify
kb_sd_jwt,the failing tests, or #310 — it only adds the workflow. Once #310 and #313 land, this
branch will be rebased so the check can be evaluated against a green baseline.
The sample-test coverage motivation came out of the discussion on #310, which notes
that no CI job currently runs the sample pytest suite. This PR does not fix #310.
CONTRIBUTINGGuide.