Skip to content
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

Revert flaky integration test change #906

Merged
merged 1 commit into from
Nov 16, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 0 additions & 9 deletions tests/http/assets-test/config/site.toml

This file was deleted.

4 changes: 0 additions & 4 deletions tests/http/assets-test/content/index.md

This file was deleted.

7 changes: 0 additions & 7 deletions tests/http/assets-test/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ name = "spin-assets-test"
trigger = {type = "http", base = "/"}
version = "1.0.0"

[[component]]
source = { url = "https://github.com/fermyon/bartholomew/releases/download/v0.6.0/bartholomew.wasm", digest = "sha256:b64bc17da4484ff7fee619ba543f077be69b3a1f037506e0eeee1fb020d42786" }
id = "bartholomew"
files = [ "content/**/*" , "templates/*", "config/*"]
[component.trigger]
route = "/..."

[[component]]
id = "fs"
# should we just use git submodules to avoid having binary test files here?
Expand Down
7 changes: 0 additions & 7 deletions tests/http/assets-test/templates/home.hbs

This file was deleted.

27 changes: 0 additions & 27 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ mod integration_tests {
let s = SpinTestController::with_bindle(RUST_HTTP_STATIC_ASSETS_REST_REF, &b.url, &[])
.await?;

assert_status(&s, "/", 200).await?;
assert_response_contains(&s, "/", "<h1>Hello</h1>").await?;

assert_status(&s, "/static/thisshouldbemounted/1", 200).await?;
assert_status(&s, "/static/thisshouldbemounted/2", 200).await?;
assert_status(&s, "/static/thisshouldbemounted/3", 200).await?;
Expand Down Expand Up @@ -665,9 +662,6 @@ mod integration_tests {
)
.await?;

assert_status(&s, "/", 200).await?;
assert_response_contains(&s, "/", "<h1>Hello</h1>").await?;

assert_status(&s, "/static/thisshouldbemounted/1", 200).await?;
assert_status(&s, "/static/thisshouldbemounted/2", 200).await?;
assert_status(&s, "/static/thisshouldbemounted/3", 200).await?;
Expand Down Expand Up @@ -812,27 +806,6 @@ mod integration_tests {
Ok(())
}

async fn assert_response_contains(
s: &SpinTestController,
absolute_uri: &str,
expected: &str,
) -> Result<()> {
let res = req(s, absolute_uri).await?;
let body = hyper::body::to_bytes(res.into_body())
.await
.expect("read body");
let body_text =
String::from_utf8(body.into_iter().collect()).expect("convert body to string");
assert!(
body_text.contains(expected),
"expected to contain {}, got {}",
expected,
body_text
);

Ok(())
}

async fn req(s: &SpinTestController, absolute_uri: &str) -> Result<Response<Body>> {
let c = Client::new();
let url = format!("http://{}{}", s.url, absolute_uri)
Expand Down