Skip to content

docs: update versions to 0.1.300 and expand testing documentation#105

Merged
Tuntii merged 2 commits intomainfrom
docs/update-versions-and-testing-12707341404442644071
Feb 7, 2026
Merged

docs: update versions to 0.1.300 and expand testing documentation#105
Tuntii merged 2 commits intomainfrom
docs/update-versions-and-testing-12707341404442644071

Conversation

@Tuntii
Copy link
Owner

@Tuntii Tuntii commented Feb 7, 2026

Updated documentation to align with current workspace versions (0.1.300) and sqlx 0.8. Significantly expanded testing documentation to cover MockServer and TestClient.


PR created automatically by Jules for task 12707341404442644071 started by @Tuntii

- Updated `sqlx` version in `db_integration.md` to `0.8` (fixing feature flags).
- Verified `rustapi-rs` versions in docs are `0.1.300`.
- Expanded `rustapi_testing.md` to include detailed documentation for `MockServer`, `TestClient`, and Expectations.
- Updated Learning Path (`docs/cookbook/src/learning/README.md`) to include "Reliable Testing" and "Service Mocking".

Co-authored-by: Tuntii <121901995+Tuntii@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 7, 2026 03:49
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates cookbook documentation to reflect current dependency versions and expands the testing guidance around rustapi-testing’s TestClient and MockServer.

Changes:

  • Update the SQLx dependency snippet to 0.8 with current feature flags.
  • Extend the learning path docs to include a service mocking/testing step and link to rustapi-testing.
  • Greatly expand rustapi-testing documentation with new examples and best practices.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
docs/cookbook/src/recipes/db_integration.md Updates SQLx version/features to match the current ecosystem and workspace usage.
docs/cookbook/src/learning/README.md Adds learning-path references to service mocking/testing using rustapi-testing.
docs/cookbook/src/crates/rustapi_testing.md Adds substantial new testing documentation and examples for TestClient and MockServer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +76 to +80
server.expect(RequestMatcher::new(Method::GET, "/external-api/data"))
.respond_with(MockResponse::new()
.status(StatusCode::OK)
.json(serde_json::json!({ "result": "success" })))
.times(1);
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

RequestMatcher::new(Method::GET, "/external-api/data") doesn't match the actual rustapi-testing API: RequestMatcher::new() takes no args, and method/path are set via .method(...) / .path(...). Also Method isn’t brought into scope here (the rustapi_rs::prelude doesn’t re-export it), so the example as written won’t compile for readers.

Copilot uses AI. Check for mistakes.
Comment on lines +67 to +70
```rust,ignore
use rustapi_testing::{MockServer, MockResponse, RequestMatcher};

#[tokio::test]
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

This snippet uses TestClient, Method, and StatusCode without importing them. Consider either adding the missing use statements (e.g. use rustapi_testing::TestClient; and use http::Method;) or qualifying them (http::Method::GET, etc.) to keep the example copy/pasteable.

Copilot uses AI. Check for mistakes.
Comment on lines +111 to +116
The `MockServer` automatically verifies that all expectations were met when it is dropped (at the end of the test scope). If an expectation was set to be called `once` but was never called, the test will panic.

The client provides a fluent API for making requests and asserting responses.
- `.once()`: Must be called exactly once (default).
- `.times(n)`: Must be called exactly `n` times.
- `.at_least_once()`: Must be called 1 or more times.
- `.never()`: Must not be called.
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

The docs say expectations are automatically verified when MockServer is dropped, but MockServer’s Drop implementation only shuts the server down and does not call verify(). Unless the crate behavior is changed, the docs should instruct callers to explicitly call server.verify() at the end of the test (or assert on unmatched_requests()).

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Owner Author

@Tuntii Tuntii left a comment

Choose a reason for hiding this comment

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


@Tuntii Tuntii merged commit 6f71402 into main Feb 7, 2026
7 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 7, 2026
…te-versions-and-testing-12707341404442644071

docs: update versions to 0.1.300 and expand testing documentation 6f71402
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