|
1 |
| -//! Tests that configuration generation has not changed. |
2 |
| -//! |
3 |
| -//! If you have changed it intentionally, run `just generate-chinook-configuration`. |
| 1 | +// //! Tests that configuration generation has not changed. |
| 2 | +// //! |
| 3 | +// //! If you have changed it intentionally, run `just generate-chinook-configuration`. |
4 | 4 |
|
5 |
| -pub mod common; |
| 5 | +// pub mod common; |
6 | 6 |
|
7 |
| -use std::{collections::HashMap, fs}; |
| 7 | +// use std::{collections::HashMap, fs}; |
8 | 8 |
|
9 |
| -use similar_asserts::assert_eq; |
| 9 | +// use similar_asserts::assert_eq; |
10 | 10 |
|
11 |
| -use ndc_bigquery_configuration::{ |
12 |
| - values::Secret, |
13 |
| - version1::{self, DEFAULT_SERVICE_KEY_VARIABLE}, |
14 |
| - ServiceKey, |
15 |
| -}; |
| 11 | +// use ndc_bigquery_configuration::{ |
| 12 | +// values::Secret, |
| 13 | +// version1::{self, DEFAULT_SERVICE_KEY_VARIABLE}, |
| 14 | +// ServiceKey, |
| 15 | +// }; |
16 | 16 |
|
17 |
| -use tests_common::deployment::helpers::get_path_from_project_root; |
| 17 | +// use tests_common::deployment::helpers::get_path_from_project_root; |
18 | 18 |
|
19 |
| -const POSTGRESQL_CONNECTION_STRING: &str = "postgresql://postgres:password@localhost:64002"; |
20 |
| -const CHINOOK_DEPLOYMENT_PATH: &str = "static/chinook-deployment.json"; |
21 |
| -const _CONFIGURATION_QUERY: &str = include_str!("../src/config2.sql"); |
| 19 | +// const POSTGRESQL_CONNECTION_STRING: &str = "postgresql://postgres:password@localhost:64002"; |
| 20 | +// const CHINOOK_DEPLOYMENT_PATH: &str = "static/"; |
| 21 | +// const _CONFIGURATION_QUERY: &str = include_str!("../src/config2.sql"); |
22 | 22 |
|
23 |
| -#[tokio::test] |
24 |
| -#[ignore] |
25 |
| -async fn test_configure() { |
26 |
| - let expected_value: serde_json::Value = { |
27 |
| - let file = fs::File::open(get_path_from_project_root(CHINOOK_DEPLOYMENT_PATH)) |
28 |
| - .expect("fs::File::open"); |
29 |
| - let result: serde_json::Value = |
30 |
| - serde_json::from_reader(file).expect("serde_json::from_reader"); |
31 |
| - |
32 |
| - result |
33 |
| - }; |
| 23 | +// #[tokio::test] |
| 24 | +// #[ignore] |
| 25 | +// async fn test_configure() { |
| 26 | +// let expected_value: serde_json::Value = { |
| 27 | +// let file = fs::File::open(get_path_from_project_root(CHINOOK_DEPLOYMENT_PATH)) |
| 28 | +// .expect("fs::File::open"); |
| 29 | +// let result: serde_json::Value = |
| 30 | +// serde_json::from_reader(file).expect("serde_json::from_reader"); |
34 | 31 |
|
35 |
| - let mut args: version1::ParsedConfiguration = serde_json::from_value(expected_value.clone()) |
36 |
| - .expect("Unable to deserialize as RawConfiguration"); |
| 32 | +// result |
| 33 | +// }; |
37 | 34 |
|
38 |
| - let environment = HashMap::from([( |
39 |
| - version1::DEFAULT_SERVICE_KEY_VARIABLE.into(), |
40 |
| - POSTGRESQL_CONNECTION_STRING.into(), |
41 |
| - )]); |
| 35 | +// let mut args: version1::ParsedConfiguration = serde_json::from_value(expected_value.clone()) |
| 36 | +// .expect("Unable to deserialize as RawConfiguration"); |
42 | 37 |
|
43 |
| - args.connection_settings.service_key = |
44 |
| - ServiceKey(Secret::Plain(DEFAULT_SERVICE_KEY_VARIABLE.to_string())); |
| 38 | +// let environment = HashMap::from([( |
| 39 | +// version1::DEFAULT_SERVICE_KEY_VARIABLE.into(), |
| 40 | +// POSTGRESQL_CONNECTION_STRING.into(), |
| 41 | +// )]); |
45 | 42 |
|
46 |
| - let actual = version1::configure(&args, environment) |
47 |
| - .await |
48 |
| - .expect("configuration::configure"); |
| 43 | +// args.connection_settings.service_key = |
| 44 | +// ServiceKey(Secret::Plain(DEFAULT_SERVICE_KEY_VARIABLE.to_string())); |
49 | 45 |
|
50 |
| - let actual_value = serde_json::to_value(actual).expect("serde_json::to_value"); |
| 46 | +// let actual = version1::configure(&args, environment) |
| 47 | +// .await |
| 48 | +// .expect("configuration::configure"); |
51 | 49 |
|
52 |
| - assert_eq!(expected_value, actual_value); |
53 |
| -} |
| 50 | +// let actual_value = serde_json::to_value(actual).expect("serde_json::to_value"); |
54 | 51 |
|
55 |
| -#[tokio::test] |
56 |
| -#[ignore] |
57 |
| -async fn get_rawconfiguration_schema() { |
58 |
| - let schema = schemars::schema_for!(version1::ParsedConfiguration); |
59 |
| - insta::assert_json_snapshot!(schema); |
60 |
| -} |
| 52 | +// assert_eq!(expected_value, actual_value); |
| 53 | +// } |
61 | 54 |
|
62 | 55 | // #[tokio::test]
|
63 |
| -// async fn get_configuration_schema() { |
64 |
| -// let schema = schemars::schema_for!(version1::Configuration); |
| 56 | +// #[ignore] |
| 57 | +// async fn get_rawconfiguration_schema() { |
| 58 | +// let schema = schemars::schema_for!(version1::ParsedConfiguration); |
65 | 59 | // insta::assert_json_snapshot!(schema);
|
66 | 60 | // }
|
| 61 | + |
| 62 | +// // #[tokio::test] |
| 63 | +// // async fn get_configuration_schema() { |
| 64 | +// // let schema = schemars::schema_for!(version1::Configuration); |
| 65 | +// // insta::assert_json_snapshot!(schema); |
| 66 | +// // } |
0 commit comments