Skip to content

Commit

Permalink
fix: supergraph fetch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EverlastingBugstopper committed May 6, 2021
1 parent 363e48e commit 160ab1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions crates/rover-client/src/query/supergraph/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ mod tests {
let data: fetch_supergraph_query::ResponseData =
serde_json::from_value(json_response).unwrap();
let output = get_supergraph_sdl_from_response_data(data, graph.clone(), variant.clone());
let expected_error = RoverClientError::MalformedResponse {
null_field: "compositionResult".to_string(),
}
.to_string();
let expected_error = RoverClientError::ExpectedFederatedGraph { graph }.to_string();
let actual_error = output.unwrap_err().to_string();
assert_eq!(actual_error, expected_error);
}
Expand Down
3 changes: 3 additions & 0 deletions src/utils/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ impl RoverEnv {
/// returns the value of the environment variable if it exists
pub fn get(&self, key: RoverEnvKey) -> io::Result<Option<String>> {
let key_str = key.to_string();
tracing::debug!("Checking for ${}", &key_str);
let result = match &self.mock_store {
Some(mock_store) => Ok(mock_store.get(&key_str).map(|v| v.to_owned())),
None => match env::var(&key_str) {
Expand All @@ -52,6 +53,8 @@ impl RoverEnv {

if let Some(result) = &result {
tracing::debug!("read {}", self.get_debug_value(key, result));
} else {
tracing::debug!("could not find #{}", &key_str);
}

Ok(result)
Expand Down

0 comments on commit 160ab1e

Please sign in to comment.