-
Notifications
You must be signed in to change notification settings - Fork 7
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 spec for test changes, add "bench" subcommand #112
Conversation
6777068
to
cf99c15
Compare
rust-connector-sdk/Cargo.toml
Outdated
ndc-client = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.0-rc.18" } | ||
ndc-test = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.0-rc.18" } | ||
ndc-client = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.0-rc.19" } | ||
ndc-test = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.0-rc.19" } |
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.
I think that in the future, we should consider moving the ndc-test
-related stuff to a separate, optional crate.
I want this testing and benchmarking but I don't want to ship it to prod.
FWIW we don't use the test
command in ndc-postgres; we wrap the test runner in an integration test.
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.
We could put it behind a feature flag.
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.
% cargo run
Usage: ndc_hub_example <COMMAND>
Commands:
serve
check-health
help Print this message or the help of the given subcommand(s)
% cargo run --features ndc-test
Usage: ndc_hub_example <COMMAND>
Commands:
serve
test
replay
bench
check-health
help Print this message or the help of the given subcommand(s)
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.
Yeah, that's what I was thinking, but I'm fine with doing it later.
Cargo.lock
Outdated
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.
Love to see it.
println!(); | ||
println!("{}", report(results)); | ||
println!("{}", reporter.1.report()); |
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.
Why is this necessary? Doesn't the ConsoleReporter
handle this now?
(Same applies to the replay
function.)
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.
The reporter only responds to the traversal of the nodes of the test tree structure, it doesn't have a hook for when the tests are fully complete. ConsoleReporter
writes the tree out to stdout without allocating, but TestResults
collects up the failures. Another approach would be to add a finish
method to the trait, but as it is, TestResults
is useful for cases where you don't want to write to stdout at all, or immediately.
ff2bd89
to
b5f3c83
Compare
a0ba01b
to
5554a1b
Compare
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.
Let's ship this!
Updates ndc-spec and adds a bench subcommand for simple benchmarks of connectors built with the SDK: