Skip to content

SUR-1267: Add CI with example contract validation#2

Merged
Patrick Miller (MillerPatrick214) merged 2 commits into
mainfrom
SUR-1267/example-ci-contract
Mar 20, 2026
Merged

SUR-1267: Add CI with example contract validation#2
Patrick Miller (MillerPatrick214) merged 2 commits into
mainfrom
SUR-1267/example-ci-contract

Conversation

@MillerPatrick214
Copy link
Copy Markdown
Collaborator

@MillerPatrick214 Patrick Miller (MillerPatrick214) commented Mar 20, 2026

Summary

  • Added GitHub Actions CI workflow running on every PR and main push (Python 3.8, 3.10, 3.12)
  • Contract tests mock the HTTP layer and validate all SDK request payloads against JSON schemas vendored from surmado-api-public
  • Scans for hardcoded sur_live_ keys in examples and client source — CI fails if found
  • Mock responses validated against response schemas at import time (broken mocks fail fast)
  • Vendored 7 JSON schemas into /schemas
  • Fixed version test assertions (0.3.0 → 0.3.1)
  • Fixed README param name bugs: Signal/Scan use url=, brand methods use website=
  • Added CI badge to README

200 tests passing (192 unit + 8 contract).

Test plan

  • All 200 tests pass locally (Python 3.13)
  • CI workflow runs on this PR
  • Verify CI badge resolves after first workflow run

- GitHub Actions workflow: runs unit tests + example contract tests on
  Python 3.8, 3.10, 3.12 for every PR and main push
- Contract test mocks HTTP layer, validates all SDK request payloads
  against JSON schemas from /schemas, returns schema-valid mock responses
- Scans for hardcoded sur_live_ keys in examples and client source
- Vendored JSON schemas from surmado-api-public into /schemas
- Fixed version assertions in test_client.py (0.3.0 → 0.3.1)
- Fixed README: Signal/Scan examples use url=, brand methods use website=
- Added CI badge to README

SUR-1267

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pytest was missing from pip install. Python 3.8 is EOL and failing
on ubuntu-latest — bumped minimum CI matrix to 3.9.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MillerPatrick214 Patrick Miller (MillerPatrick214) merged commit 787f958 into main Mar 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant