-
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.
- Loading branch information
Showing
32 changed files
with
201 additions
and
201 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
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
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
//! Common functions used across test cases. | ||
pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/citus/v2-chinook-deployment.json"; | ||
pub const CHINOOK_NDC_METADATA_PATH: &str = "static/citus/v2-chinook-ndc-metadata.json"; | ||
|
||
pub const CONNECTION_STRING: &str = | ||
"postgresql://postgres:password@localhost:64004?sslmode=disable"; | ||
|
||
/// Creates a router with a fresh state from the test deployment. | ||
/// Creates a router with a fresh state from the test ndc_metadata. | ||
pub async fn create_router() -> axum::Router { | ||
tests_common::router::create_router(CHINOOK_DEPLOYMENT_PATH).await | ||
tests_common::router::create_router(CHINOOK_NDC_METADATA_PATH).await | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
//! Common functions used across test cases. | ||
pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/cockroach/v2-chinook-deployment.json"; | ||
pub const CHINOOK_NDC_METADATA_PATH: &str = "static/cockroach/v2-chinook-ndc-metadata.json"; | ||
|
||
pub const CONNECTION_STRING: &str = "postgresql://postgres:password@localhost:64003/defaultdb"; | ||
|
||
/// Creates a router with a fresh state from the test deployment. | ||
/// Creates a router with a fresh state from the test ndc_metadata. | ||
pub async fn create_router() -> axum::Router { | ||
tests_common::router::create_router(CHINOOK_DEPLOYMENT_PATH).await | ||
tests_common::router::create_router(CHINOOK_NDC_METADATA_PATH).await | ||
} |
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
14 changes: 7 additions & 7 deletions
14
crates/tests/databases-tests/src/deployment_snapshot_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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
#[cfg(test)] | ||
mod deployment_snapshots { | ||
mod ndc_metadata_snapshots { | ||
use ndc_postgres::configuration; | ||
use std::fs; | ||
use std::path::PathBuf; | ||
|
||
// each time we run `just generate-chinook-configuration` we save the old | ||
// Postgres deployment in `static/deployment-snapshots`. This test parses each snapshot to | ||
// Postgres ndc_metadata in `static/ndc-metadata-snapshots`. This test parses each snapshot to | ||
// ensure we are still able to understand old versions | ||
#[test_each::path(glob = "static/deployment-snapshots/*.json", name(segments = 2))] | ||
fn test_snapshot(deployment_path: PathBuf) { | ||
let file = fs::File::open(deployment_path).expect("fs::File::open"); | ||
#[test_each::path(glob = "static/ndc-metadata-snapshots/*.json", name(segments = 2))] | ||
fn test_snapshot(ndc_metadata_path: PathBuf) { | ||
let file = fs::File::open(ndc_metadata_path).expect("fs::File::open"); | ||
|
||
let deployment_json_value: serde_json::Value = | ||
let ndc_metadata_json_value: serde_json::Value = | ||
serde_json::from_reader(file).expect("serde_json::from_reader"); | ||
|
||
let _decoded_configuration: configuration::RawConfiguration = | ||
serde_json::from_value(deployment_json_value.clone()) | ||
serde_json::from_value(ndc_metadata_json_value.clone()) | ||
.expect("Unable to deserialize as RawConfiguration"); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
//! Common functions used across test cases. | ||
pub const CHINOOK_DEPLOYMENT_PATH_V2: &str = "static/postgres/v2-chinook-deployment.json"; | ||
pub const CHINOOK_DEPLOYMENT_PATH_V1: &str = "static/postgres/v1-chinook-deployment.json"; | ||
pub const CHINOOK_NDC_METADATA_PATH_V2: &str = "static/postgres/v2-chinook-ndc-metadata.json"; | ||
pub const CHINOOK_NDC_METADATA_PATH_V1: &str = "static/postgres/v1-chinook-ndc-metadata.json"; | ||
|
||
pub const CONNECTION_STRING: &str = "postgresql://postgres:password@localhost:64002"; | ||
|
||
/// Creates a router with a fresh state from the test deployment. | ||
/// Creates a router with a fresh state from the test ndc_metadata. | ||
pub async fn create_router() -> axum::Router { | ||
tests_common::router::create_router(CHINOOK_DEPLOYMENT_PATH_V2).await | ||
tests_common::router::create_router(CHINOOK_NDC_METADATA_PATH_V2).await | ||
} |
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
Oops, something went wrong.