Skip to content

Commit

Permalink
Merge pull request #1633 from fermyon/debug-config-vars
Browse files Browse the repository at this point in the history
Include actual and expected values in config test error message
  • Loading branch information
rajatjindal authored Jul 6, 2023
2 parents f187ab5 + c647bf2 commit 6aa2e1a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/testcases/config-variables/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ fn handle_request(req: Request) -> Result<Response> {
.query()
.expect("Should have a password query string");
let query: std::collections::HashMap<String, String> = serde_qs::from_str(query)?;
let provided_password = query
let expected_password_value = query
.get("password")
.expect("Should have a password query string");
let expected_password = config::get("password")?;
let actual_password_value = config::get("password")?;

ensure!(
provided_password == &expected_password,
"password must match expected"
expected_password_value == &actual_password_value,
"actual password value from config store '{}' must match expected password value '{}'",
&actual_password_value,
expected_password_value
);

Ok(http::Response::builder().status(200).body(None)?)
Expand Down

0 comments on commit 6aa2e1a

Please sign in to comment.