Skip to content

feat: enable Speakeasy contract testing + exhaustive SDK test suite#379

Open
Nelson-PROIA wants to merge 2 commits intomainfrom
nelson.proia/speakeasy-sdk-testing
Open

feat: enable Speakeasy contract testing + exhaustive SDK test suite#379
Nelson-PROIA wants to merge 2 commits intomainfrom
nelson.proia/speakeasy-sdk-testing

Conversation

@Nelson-PROIA
Copy link
Contributor

@Nelson-PROIA Nelson-PROIA commented Feb 26, 2026

Summary

  • Enable Speakeasy contract testing for all 3 SDK targets (main, Azure, GCP)
  • Add exhaustive unit test suite (933+ tests total)
  • Reorganize provider tests to their respective packages
  • Add scripts/run_all_tests.sh for running complete test suite

Test Coverage

Suite Tests
Main SDK unit tests 563
Azure unit tests 7
GCP unit tests 15
Azure parity tests 158
GCP parity tests 190
Main SDK integration 33
Azure integration 18
GCP integration 22

Changes

  • tests/unit/ - 31 new unit test files covering all SDK endpoints
  • packages/azure/tests/unit/ - Azure-specific unit tests
  • packages/gcp/tests/unit/ - GCP-specific unit tests
  • tests/test_integration.py - Main SDK integration tests
  • scripts/run_all_tests.sh - Script to run all test suites
  • .github/workflows/test_custom_code.yaml - Updated CI to run all tests
  • pyproject.toml - Added pytest filterwarnings
  • .genignore files - Updated to protect custom test code

Test plan

  • All unit tests pass locally
  • All parity tests pass locally
  • CI passes
  • Integration tests pass with API keys

Nelson-PROIA and others added 2 commits February 26, 2026 17:48
- Enable `generateTests: true` and `testing: enabled: true` in all gen.yaml/workflow.yaml
- Bootstrap arazzo test definitions and generated pytest files for main, Azure, and GCP SDKs
- Add `.genignore` entries to protect hand-written tests from being overwritten
- Add `pytest-xdist` dev dependency for parallel test execution
- Add GitHub Actions workflow for contract tests on PRs
- Disable `persistentEdits` on main SDK (workaround for mockserver incompatibility)
- Fix `prompt_audio_seconds: {}` → `null` in agents arazzo tests (OpenAPI spec bug workaround)

Results: main SDK 230/238 pass (96.6%), Azure 2/3, GCP 0/2 (blocked by path rewriting hook)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Nelson-PROIA Nelson-PROIA changed the title feat: enable Speakeasy contract testing for all 3 SDK targets feat: enable Speakeasy contract testing + exhaustive SDK test suite Feb 27, 2026

# _build_url produces the HTTPS URL; the WSS conversion happens in connect().
# Verify the URL is HTTPS-based (connect() replaces https -> wss)
assert url.startswith("https://api.mistral.ai")

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

The string
https://api.mistral.ai
may be at an arbitrary position in the sanitized URL.

Copilot Autofix

AI 3 days ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

query_params={},
)

assert url.startswith("https://custom.server.com")

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

The string
https://custom.server.com
may be at an arbitrary position in the sanitized URL.

Copilot Autofix

AI 3 days ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

content = request.content.decode("utf-8", errors="replace")
assert "mistral-large-latest" in content
# The URL may be URL-encoded in form data
assert "example.com" in content

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

The string
example.com
may be at an arbitrary position in the sanitized URL.

Copilot Autofix

AI 3 days ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

@github-actions
Copy link
Contributor

SDK Test Report: all — tests failed

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