Skip to content

refactor(rig-core)!: migrate examples to integration tests#1603

Merged
gold-silver-copper merged 21 commits into0xPlaygrounds:mainfrom
gold-silver-copper:codex/completion-smoke-tests-docs
Apr 9, 2026
Merged

refactor(rig-core)!: migrate examples to integration tests#1603
gold-silver-copper merged 21 commits into0xPlaygrounds:mainfrom
gold-silver-copper:codex/completion-smoke-tests-docs

Conversation

@gold-silver-copper
Copy link
Copy Markdown
Contributor

@gold-silver-copper gold-silver-copper commented Apr 6, 2026

Description

This PR reorganizes a large portion of rig-core's provider coverage by migrating many provider-specific examples into provider-scoped integration tests under rig-core/tests.

The main goal is to keep a smaller set of canonical runnable examples in rig-core/examples while moving provider-specific regression coverage into a structure that is easier to extend, run by provider, and maintain over time.

In addition to the migration itself, this PR:

  • adds shared test helpers for streaming, reasoning, structured output, tools, loaders, and provider layout checks
  • strengthens several migrated tests so they validate behavior instead of only checking for non-empty responses
  • updates the README/docs to reflect that many provider-specific examples now live under tests/
  • fixes agent streaming so FinalResponse.response() consistently reflects the concatenated assistant text for the final turn
  • updates provider-backed smoke test guidance to use serial ignored runs (-- --ignored --test-threads=1) to reduce quota/rate-limit flakiness
  • refreshes some provider model defaults where older aliases/models were no longer reliable for current accounts or local setups

A large part of the diff is mechanical movement/reorganization from examples/ into tests/, rather than entirely new behavior.

Fixes #

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Breaking changes

This PR removes the following public Anthropic constants:

  • anthropic::completion::CLAUDE_3_5_SONNET
  • anthropic::completion::CLAUDE_3_7_SONNET

Migration path:

  • use anthropic::completion::CLAUDE_4_SONNET
  • or pass an explicit current Anthropic model string

Testing

Validated locally with:

  • cargo test -p rig-core --tests --no-run
  • cargo check -p rig-core --examples

Provider-backed smoke tests were also run selectively during development with provider credentials. Whole-provider runs should be executed serially, for example:

  • cargo test -p rig-core --test openai -- --ignored --test-threads=1
  • cargo test -p rig-core --test anthropic -- --ignored --test-threads=1
  • cargo test -p rig-core --test gemini -- --ignored --test-threads=1

@gold-silver-copper gold-silver-copper changed the title Migration of provider examples to tests refactor(rig-core)!: migrate examples to integration tests Apr 9, 2026
@gold-silver-copper gold-silver-copper marked this pull request as ready for review April 9, 2026 02:10
@gold-silver-copper gold-silver-copper added this pull request to the merge queue Apr 9, 2026
Merged via the queue into 0xPlaygrounds:main with commit be9ee5a Apr 9, 2026
6 checks passed
@github-actions github-actions bot mentioned this pull request Apr 7, 2026
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