-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update-ndc-spec-0.1.3 #13
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,13 +50,17 @@ impl Connector for Example { | |
|
||
async fn get_capabilities() -> JsonResponse<models::CapabilitiesResponse> { | ||
models::CapabilitiesResponse { | ||
version: "0.1.1".into(), | ||
version: "0.1.3".into(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very unsure about this, I think version is supposed to be the ndc-spec version, is that correct? |
||
capabilities: models::Capabilities { | ||
relationships: None, | ||
query: models::QueryCapabilities { | ||
variables: None, | ||
aggregates: None, | ||
explain: None, | ||
nested_fields: models::NestedFieldCapabilities { | ||
filter_by: None, | ||
order_by: None, | ||
}, | ||
}, | ||
mutation: models::MutationCapabilities { | ||
transactional: None, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,8 @@ struct TestCommand { | |
configuration: PathBuf, | ||
#[arg(long, value_name = "DIRECTORY", env = "HASURA_SNAPSHOTS_DIR")] | ||
snapshots_dir: Option<PathBuf>, | ||
#[arg(long, help = "Turn off validations for query responses")] | ||
no_validate_responses: bool, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this flag copied from the ndc-test implementation |
||
} | ||
|
||
#[derive(Clone, Parser)] | ||
|
@@ -92,6 +94,8 @@ struct ReplayCommand { | |
configuration: PathBuf, | ||
#[arg(long, value_name = "DIRECTORY", env = "HASURA_SNAPSHOTS_DIR")] | ||
snapshots_dir: PathBuf, | ||
#[arg(long, help = "Turn off validations for query responses")] | ||
no_validate_responses: bool, | ||
} | ||
|
||
#[derive(Clone, Parser)] | ||
|
@@ -487,6 +491,9 @@ mod ndc_test_commands { | |
let test_configuration = ndc_test::configuration::TestConfiguration { | ||
seed: command.seed.map(|s| s.as_bytes().try_into()).transpose()?, | ||
snapshots_dir: command.snapshots_dir, | ||
options: ndc_test::configuration::TestOptions { | ||
validate_responses: !command.no_validate_responses, | ||
}, | ||
gen_config: ndc_test::configuration::TestGenerationConfiguration::default(), | ||
}; | ||
|
||
|
@@ -510,10 +517,18 @@ mod ndc_test_commands { | |
command: super::ReplayCommand, | ||
) -> Result<(), Box<dyn Error + Send + Sync>> { | ||
let connector = make_connector_adapter(setup, command.configuration).await?; | ||
let options = ndc_test::configuration::TestOptions { | ||
validate_responses: !command.no_validate_responses, | ||
}; | ||
let mut reporter = (ConsoleReporter::new(), TestResults::default()); | ||
|
||
ndc_test::test_snapshots_in_directory(&connector, &mut reporter, command.snapshots_dir) | ||
.await; | ||
ndc_test::test_snapshots_in_directory( | ||
&options, | ||
&connector, | ||
&mut reporter, | ||
command.snapshots_dir, | ||
) | ||
.await; | ||
|
||
if !reporter.1.failures.is_empty() { | ||
println!(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bumped version from 0.1.0 to 0.1.3, to keep the same version number as the corresponding ndc-spec.
Is this a good idea, should we do something else instead? The thinking is having a single number wil be less confusing.