Skip to content

Various improvements to test env #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ syn = "2.0"
typify = { version = "0.1.0" }

[workspace]
members = ["macros", "test-services", "test-env"]
members = ["macros", "test-services", "testcontainers"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Just configure it as usual through [`tracing_subscriber`](https://docs.rs/tracin
### Testing

The SDK uses [Testcontainers](https://rust.testcontainers.org/) to support integration testing using a Docker-deployed restate server.
The `restate-sdk-test-env` crate provides a framework for initializing the test environment, and an integration test example in `test-env/tests/test_container.rs`.
The `restate-sdk-testcontainers` crate provides a framework for initializing the test environment, and an integration test example in `testcontainers/tests/test_container.rs`.

```rust
#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ print-target:
@echo {{ _resolved_target }}

test: (_target-installed target)
cargo nextest run {{ _target-option }} --all-features
cargo nextest run {{ _target-option }} --all-features --workspace

doctest:
cargo test --doc
Expand Down
8 changes: 8 additions & 0 deletions src/endpoint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ impl Endpoint {

let parts: Vec<&str> = path.split('/').collect();

if parts.last() == Some(&"health") {
return Ok(Response::ReplyNow {
status_code: 200,
headers: vec![],
body: Bytes::new(),
});
}

if parts.last() == Some(&"discover") {
let accept_header = headers
.extract("accept")
Expand Down
321 changes: 0 additions & 321 deletions test-env/src/lib.rs

This file was deleted.

9 changes: 4 additions & 5 deletions test-env/Cargo.toml → testcontainers/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
[package]
name = "restate-sdk-test-env"
name = "restate-sdk-testcontainers"
version = "0.4.0"
edition = "2021"
description = "Test Utilities for Restate SDK for Rust"
description = "Restate SDK Testcontainers utilities"
license = "MIT"
repository = "https://github.com/restatedev/sdk-rust"
rust-version = "1.76.0"


[dependencies]
anyhow = "1.0.95"
nu-ansi-term = "0.50.1"
futures = "0.3.31"
reqwest = { version= "0.12.12", features = ["json"] }
restate-sdk = { version = "0.4.0", path = "../" }
serde = "1.0.217"
serde_json = "1.0.138"
testcontainers = "0.23.1"
testcontainers = { version = "0.23.3", features = ["http_wait"] }
tokio = "1.43.0"
tracing = "0.1.41"
tracing-subscriber = "0.3.19"
Loading
Loading