-
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
1 parent
f4a79d7
commit ad8b394
Showing
6 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
21 changes: 21 additions & 0 deletions
21
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#[cfg(test)] | ||
mod deployment_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 | ||
// 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"); | ||
|
||
let deployment_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()) | ||
.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ pub mod cockroach; | |
pub mod postgres; | ||
|
||
pub mod capabilities_tests; | ||
pub mod deployment_snapshot_tests; |
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