Skip to content

Commit 2d90ae2

Browse files
committed
Changes needed for TCP tests
Signed-off-by: Ryan Levick <[email protected]>
1 parent cadd38a commit 2d90ae2

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ redis = "0.24"
9999
runtime-tests = { path = "tests/runtime-tests" }
100100
test-components = { path = "tests/test-components" }
101101
test-codegen-macro = { path = "crates/test-codegen-macro" }
102-
test-environment = { git = "https://github.com/fermyon/conformance-tests", branch = "libtest_mimic" }
102+
test-environment = { git = "https://github.com/fermyon/conformance-tests", branch = "main" }
103103

104104
[build-dependencies]
105105
cargo-target-dep = { git = "https://github.com/fermyon/cargo-target-dep", rev = "482f269eceb7b1a7e8fc618bf8c082dd24979cf1" }

tests/conformance-tests/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ rust-version.workspace = true
1111
[dependencies]
1212
anyhow = "1.0"
1313
testing-framework = { path = "../testing-framework" }
14-
conformance-tests = { git = "https://github.com/fermyon/conformance-tests", branch = "libtest_mimic" }
15-
test-environment = { git = "https://github.com/fermyon/conformance-tests", branch = "libtest_mimic" }
14+
conformance-tests = { git = "https://github.com/fermyon/conformance-tests", branch = "main" }
15+
test-environment = { git = "https://github.com/fermyon/conformance-tests", branch = "main" }
1616

1717
[lints]
1818
workspace = true

tests/conformance-tests/src/main.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use anyhow::Context as _;
12
use testing_framework::runtimes::spin_cli::{SpinCli, SpinConfig};
23

34
fn main() {
@@ -15,6 +16,9 @@ fn run_test(test: conformance_tests::Test, spin_binary: &std::path::Path) -> any
1516
conformance_tests::config::Precondition::HttpEcho => {
1617
services.push("http-echo".into());
1718
}
19+
conformance_tests::config::Precondition::TcpEcho => {
20+
services.push("tcp-echo".into());
21+
}
1822
conformance_tests::config::Precondition::KeyValueStore(_) => {}
1923
}
2024
}
@@ -42,7 +46,15 @@ fn run_test(test: conformance_tests::Test, spin_binary: &std::path::Path) -> any
4246
let actual = invocation
4347
.request
4448
.send(|request| spin.make_http_request(request))?;
45-
conformance_tests::assertions::assert_response(&invocation.response, &actual)?;
49+
50+
conformance_tests::assertions::assert_response(&invocation.response, &actual)
51+
.with_context(|| {
52+
format!(
53+
"Failed assertion.\nstdout: {}\nstderr: {}",
54+
spin.stdout().to_owned(),
55+
spin.stderr()
56+
)
57+
})?;
4658
}
4759
Ok(())
4860
}

tests/runtime-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ anyhow = "1.0"
1313
env_logger = "0.10.0"
1414
log = "0.4"
1515
testing-framework = { path = "../testing-framework" }
16-
test-environment = { git = "https://github.com/fermyon/conformance-tests", branch = "libtest_mimic" }
16+
test-environment = { git = "https://github.com/fermyon/conformance-tests", branch = "main" }
1717
test-components = { path = "../test-components" }

tests/testing-framework/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ nix = "0.26.1"
1313
regex = "1.10.2"
1414
reqwest = { workspace = true }
1515
temp-dir = "0.1.11"
16-
test-environment = { git = "https://github.com/fermyon/conformance-tests", branch = "libtest_mimic" }
16+
test-environment = { git = "https://github.com/fermyon/conformance-tests", branch = "main" }
1717
spin-trigger-http = { path = "../../crates/trigger-http" }
1818
spin-http = { path = "../../crates/http" }
1919
spin-trigger = { path = "../../crates/trigger" }

0 commit comments

Comments
 (0)