-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move CLI introspection tests to DB tests.
- Loading branch information
1 parent
7c40d12
commit 56617a7
Showing
9 changed files
with
61 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
crates/tests/databases-tests/src/postgres/cli_version3_tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::collections::HashMap; | ||
|
||
use ndc_postgres_configuration::version3::connection_settings::DEFAULT_CONNECTION_URI_VARIABLE; | ||
use ndc_postgres_configuration::version3::{introspect, RawConfiguration}; | ||
|
||
const CONNECTION_URI: &str = "postgresql://postgres:password@localhost:64002"; | ||
|
||
#[tokio::test] | ||
async fn postgres_current_only_configure_initial_configuration_is_unchanged() { | ||
let args = RawConfiguration::empty(); | ||
let connection_string = CONNECTION_URI; | ||
let environment = HashMap::from([( | ||
DEFAULT_CONNECTION_URI_VARIABLE.into(), | ||
connection_string.into(), | ||
)]); | ||
|
||
let default_configuration = introspect(args, environment) | ||
.await | ||
.expect("configuration::introspect"); | ||
|
||
insta::assert_json_snapshot!(default_configuration); | ||
} |
22 changes: 22 additions & 0 deletions
22
crates/tests/databases-tests/src/postgres/cli_version4_tests.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::collections::HashMap; | ||
|
||
use ndc_postgres_configuration::version4::connection_settings::DEFAULT_CONNECTION_URI_VARIABLE; | ||
use ndc_postgres_configuration::version4::{introspect, ParsedConfiguration}; | ||
|
||
const CONNECTION_URI: &str = "postgresql://postgres:password@localhost:64002"; | ||
|
||
#[tokio::test] | ||
async fn postgres_current_only_configure_initial_configuration_is_unchanged() { | ||
let args = ParsedConfiguration::empty(); | ||
let connection_string = CONNECTION_URI; | ||
let environment = HashMap::from([( | ||
DEFAULT_CONNECTION_URI_VARIABLE.into(), | ||
connection_string.into(), | ||
)]); | ||
|
||
let default_configuration = introspect(args, environment) | ||
.await | ||
.expect("configuration::introspect"); | ||
|
||
insta::assert_json_snapshot!(default_configuration); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e_initial_configuration_is_unchanged.snap → ...e_initial_configuration_is_unchanged.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e_initial_configuration_is_unchanged.snap → ...e_initial_configuration_is_unchanged.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters