Skip to content

Commit

Permalink
ci: add test for pd minifront serving
Browse files Browse the repository at this point in the history
Already confirmed this test fails on main, which is good, because main
is broken. Let's see if it passes on CI on the PR fixing it...
  • Loading branch information
conorsch committed Mar 29, 2024
1 parent d612fc9 commit 74ca6e3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/bin/pd/tests/network_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
//! headers in all contexts. Does NOT evaluate application logic; see the
//! integration tests for pcli/pclientd for that.
use http::StatusCode;

#[ignore]
#[tokio::test]
/// Confirm that permissive CORS headers are returned in HTTP responses
Expand All @@ -21,3 +23,19 @@ async fn check_cors_headers() -> anyhow::Result<()> {
);
Ok(())
}

#[ignore]
#[tokio::test]
/// Confirm that the a naive GET on the gRPC route returns a 200,
/// as a sanity check that we haven't badly broken the minifront static asset bundling.
/// This check does *not* confirm that page works correctly, but it does confirm
/// it's at least loading, which guards against path regressions in the asset building.
/// See GH4139 for context.
async fn check_minifront_http_ok() -> anyhow::Result<()> {
let client = reqwest::Client::new();
let pd_url =
std::env::var("PENUMBRA_NODE_PD_URL").unwrap_or("http://localhost:8080".to_string());
let r = client.get(pd_url).send().await?;
assert_eq!(r.status(), StatusCode::OK);
Ok(())
}

0 comments on commit 74ca6e3

Please sign in to comment.