Skip to content

Commit

Permalink
Upgrade to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
paf31 committed May 28, 2024
1 parent 3a205dd commit d2fbf31
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
26 changes: 11 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ rustls = ["reqwest/rustls"]
ndc-test = ["dep:ndc-test"]

[dependencies]
ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.2" }
ndc-test = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.2", optional = true }
ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.3" }
ndc-test = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.3", optional = true }

async-trait = "0.1.79"
axum = { version = "0.6.20", features = ["http2"] }
Expand Down
6 changes: 5 additions & 1 deletion crates/sdk/src/connector/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
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,
Expand Down
9 changes: 8 additions & 1 deletion crates/sdk/src/default_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ struct TestCommand {
configuration: PathBuf,
#[arg(long, value_name = "DIRECTORY", env = "HASURA_SNAPSHOTS_DIR")]
snapshots_dir: Option<PathBuf>,
#[arg(long)]
no_validate_responses: bool,
}

#[derive(Clone, Parser)]
Expand All @@ -92,6 +94,8 @@ struct ReplayCommand {
configuration: PathBuf,
#[arg(long, value_name = "DIRECTORY", env = "HASURA_SNAPSHOTS_DIR")]
snapshots_dir: PathBuf,
#[arg(long)]
no_validate_responses: bool,
}

#[derive(Clone, Parser)]
Expand Down Expand Up @@ -488,6 +492,7 @@ mod ndc_test_commands {
seed: command.seed.map(|s| s.as_bytes().try_into()).transpose()?,
snapshots_dir: command.snapshots_dir,
gen_config: ndc_test::configuration::TestGenerationConfiguration::default(),
options: ndc_test::configuration::TestOptions { validate_responses: !command.no_validate_responses }
};

let connector = make_connector_adapter(setup, command.configuration).await?;
Expand All @@ -512,7 +517,9 @@ mod ndc_test_commands {
let connector = make_connector_adapter(setup, command.configuration).await?;
let mut reporter = (ConsoleReporter::new(), TestResults::default());

ndc_test::test_snapshots_in_directory(&connector, &mut reporter, command.snapshots_dir)
let options = ndc_test::configuration::TestOptions { validate_responses: !command.no_validate_responses };

ndc_test::test_snapshots_in_directory(&options, &connector, &mut reporter, command.snapshots_dir)
.await;

if !reporter.1.failures.is_empty() {
Expand Down

0 comments on commit d2fbf31

Please sign in to comment.