Skip to content

Test/stable provider contracts - #157

Open
Noaman-Akhtar wants to merge 9 commits into
sugarlabs:mainfrom
Noaman-Akhtar:test/stable-provider-contracts
Open

Test/stable provider contracts#157
Noaman-Akhtar wants to merge 9 commits into
sugarlabs:mainfrom
Noaman-Akhtar:test/stable-provider-contracts

Conversation

@Noaman-Akhtar

@Noaman-Akhtar Noaman-Akhtar commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR establishes the first automated test foundation for Sugar-AI’s provider layer and request-validation logic.

Included

  • Configure Pytest test discovery and strict marker validation.
  • Add requirements-dev.txt for development-only test dependencies.
  • Test GenerationParams defaults and temperature-controlled sampling.
  • Test provider factory selection and configuration forwarding for Hugging Face, Ollama, Gemini, and OpenAI-compatible providers.
  • Test OpenAI-compatible aliases, invalid provider names, and missing cloud API keys.
  • Test generation-parameter mapping for OpenAI-compatible, Ollama, and Gemini APIs.
  • Test Gemini chat-message conversion and response-text extraction.
  • Test BaseProvider interface helpers.
  • Test Hugging Face output cleanup and chat-message normalization.
  • Test PromptedLLMRequest defaults, numeric boundaries, and nested ChatMessage conversion.

Verification

.\venv\Scripts\python.exe -m pytest tests -q -p no:cacheprovider

@Noaman-Akhtar
Noaman-Akhtar marked this pull request as ready for review August 17, 2026 16:20
@Noaman-Akhtar

Copy link
Copy Markdown
Contributor Author

@mebinthattil , @chimosky can you please review this ?

@mebinthattil mebinthattil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is the first test suite this repo's ever had, I'd say it makes sense to add a minimal .github/workflows/ci.yml that runs pytest on PRs.

Musicblocks already has one if you want a reference.

Run the test suite automatically for pull requests targeting main.
@Noaman-Akhtar

Copy link
Copy Markdown
Contributor Author

@mebinthattil I have added the github workflow for running the tests . please review it at your convenience .

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.

2 participants