test: required integration test with real provider#316
test: required integration test with real provider#316hanakannzashi wants to merge 41 commits intomainfrom
Conversation
Summary of ChangesHello @hanakannzashi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the testing framework by introducing the capability to run end-to-end tests against real inference providers. This is a significant step towards validating the system's behavior in a production-like environment, especially for critical security features. A new test specifically leverages this setup to confirm that the cryptographic signatures generated for chat completions originate from an attested source, thereby bolstering the trustworthiness of model outputs. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Code ReviewI've reviewed this PR which adds a real inference provider integration test for signature verification. Here are the critical findings:
|
There was a problem hiding this comment.
Code Review
This pull request introduces new test helpers and an end-to-end test for using a real inference provider, specifically for verifying that signature signing addresses match model attestations. The changes are logical and the new test covers an important aspect of the system. I've identified a few areas for improvement regarding test code maintainability and robustness, including refactoring duplicated test setup logic, avoiding fixed-duration sleeps that can cause flakiness, and using strongly-typed structs for JSON deserialization to improve type safety.
|
Ideally this test should be run after the latest commit in main is deployed into staging. Let's include the below tests:
|
|
I think the test coverage is probably not enough, but I think it's fine to start with a small test suite and make sure the workflow is working as expected. We can add more tests in a separate PR. To trigger the tests agains the real providers, just reply a comment with "test". This will take effect after we merge this PR into |
|
@claude review |
Code Review - PR #316Status: ✅ APPROVED - Ready to Merge This PR successfully separates real provider E2E tests from mock-based tests. The code quality is high with no critical issues found. Positive Aspects
Minor Observations (Non-blocking)1. Workflow Comment Documentation (.github/workflows/test-real.yml:25)
2. URL Encoding (crates/api/tests/common/endpoints.rs:630, 662)
3. Sleep Delays (real_e2e tests)
Architecture & Safety Checks✅ Privacy compliant (no customer data logged) Reviewed per CLAUDE.md guidelines: logic correctness, production safety, database handling, performance, Rust-specific concerns |
PierreLeGuen
left a comment
There was a problem hiding this comment.
Thank you! Real tests worked on my end
PASS [ 24.043s] api::real_e2e_conversations real_test_conversation_items_populated_by_responses_non_stream
PASS [ 24.548s] api::real_e2e_conversations real_test_update_conversation_metadata
PASS [ 26.927s] api::real_e2e_conversations real_test_conversation_items_populated_by_responses_streaming
PASS [ 26.369s] api::real_e2e_response_signature_attestation real_test_signature_signing_address_matches_gateway_attestation_stream
PASS [ 25.840s] api::real_e2e_signature_verification real_test_signature_signing_address_matches_model_attestation_non_stream
PASS [ 27.401s] api::real_e2e_response_signature_attestation real_test_signature_signing_address_matches_gateway_attestation_non_stream
PASS [ 27.555s] api::real_e2e_conversations real_test_delete_conversation
PASS [ 27.518s] api::real_e2e_signature_verification real_test_signature_signing_address_matches_model_attestation_stream
────────────
Summary [ 249.122s] 653 tests run: 653 passed (16 slow, 1 leaky), 14 skipped
|
@claude review |
Code Review - Critical Issues Found
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| set -e | ||
| PR_NUMBER=${{ github.event.issue.number }} |
There was a problem hiding this comment.
Workflow fails on pull_request events due to missing PR number
High Severity
The "Get PR head SHA" step uses github.event.issue.number which is only defined for issue_comment events. When the workflow triggers on pull_request events (opened, ready_for_review), this value is empty, causing gh pr view "" to fail. The existing claude-code-review.yml handles this correctly with github.event.pull_request.number || github.event.issue.number.
Resolves #307
Note
Separates and automates real-provider E2E testing, adds shared test utilities, and adopts nextest across CI and Makefile.
test-real.ymlworkflow runs onlyreal_test_suites with Postgres and required secrets; existingtest.ymlintegration step excludes them via-E 'not test(/^real_test_/)'.config/nextest.tomlwith parallel threads and extended 500s timeout forreal_test_casestest-integration-realtarget with filtertests/common/endpoints.rsprovides HTTP helpers forchat/completions,responses(incl. SSE parsing), conversation CRUD, file upload, and signature/attestation endpoints (URL-encoding)Written by Cursor Bugbot for commit b117aa7. This will update automatically on new commits. Configure here.