You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is still an idea I'd like to pursue. What it means is we currently typically have a single test, this issue describes getting test vectors from Core i.e., having a whole bunch of tests for each method instead of 1.
I'm still not convinced. I think the effort should go into other improvements in the tests that check if the structs in this crate are correct, e.g. #137, #291 and #365.
Using test vectors from Core might be a way to do this in some RPCs, but I just think that the main reason to test all RPCs with a range of inputs using the test vectors is to test the functionality of core.
For this crate we really only have 3 cases we care about, the returned field is empty, valid, or there's an error.
I just think that the main reason to test all RPCs with a range of inputs using the test vectors is to test the functionality of core.
You are correct. However there is a reason I think its worth doing .Its a quick and easy (hopefully) way to get a bunch of different things out of Core without having to make up RPC calls ourselves. In particular, to get good coverage for a method requires understanding exactly when and why Core returns what ever it does. And this requires a bunch of thought, where as just using all the test vectors we can do it mechanically with no thought into why the exact data is returned.
I agree that all makes sense and you've now convinced me, assuming the test vectors do have cases for both returning and not returning all optional fields.
to get good coverage for a method requires understanding exactly when and why Core returns whatever it does
Agreed. I'm working on this issue, copying from core's functional tests. I think we should use them to append existing tests (I'm not planning on making them a separate folder or labeling where they came from in core).
One concern I have is: our tests only wrap around core and need only to produce a sufficient coverage of response shapes. It can get really noisy porting all of them in their original state because core tests restart nodes, check error messages, test CLI behavior, etc. See this test:
What would you specifically want to stay? What should be dropped for being excessively noisy? I imagine keeping the specific RPC call setup + field assertions so more optional fields get exercised.
EDIT: I'm making them as constrained as possible without being brittle.
Activity
GideonBature commentedon Mar 29, 2025
The idea is great, as it will help us ensure that:
We can Start the implementation, I will be like to take on the task if it's okay.
tcharding commentedon Apr 3, 2025
Go wild.
jamillambert commentedon Sep 10, 2025
I think this issue is now dead? We have a pretty thorough test suite now and I don't want to go down this route personally.
tcharding commentedon Sep 10, 2025
This is still an idea I'd like to pursue. What it means is we currently typically have a single test, this issue describes getting test vectors from Core i.e., having a whole bunch of tests for each method instead of 1.
jamillambert commentedon Sep 12, 2025
I'm still not convinced. I think the effort should go into other improvements in the tests that check if the structs in this crate are correct, e.g. #137, #291 and #365.
Using test vectors from Core might be a way to do this in some RPCs, but I just think that the main reason to test all RPCs with a range of inputs using the test vectors is to test the functionality of core.
For this crate we really only have 3 cases we care about, the returned field is empty, valid, or there's an error.
tcharding commentedon Sep 14, 2025
You are correct. However there is a reason I think its worth doing .Its a quick and easy (hopefully) way to get a bunch of different things out of Core without having to make up RPC calls ourselves. In particular, to get good coverage for a method requires understanding exactly when and why Core returns what ever it does. And this requires a bunch of thought, where as just using all the test vectors we can do it mechanically with no thought into why the exact data is returned.
jamillambert commentedon Sep 15, 2025
I agree that all makes sense and you've now convinced me, assuming the test vectors do have cases for both returning and not returning all optional fields.
tcharding commentedon Sep 16, 2025
Yeah, I haven't looked at them yet.
satsfy commentedon May 12, 2026
Agreed. I'm working on this issue, copying from core's functional tests. I think we should use them to append existing tests (I'm not planning on making them a separate folder or labeling where they came from in core).
One concern I have is: our tests only wrap around core and need only to produce a sufficient coverage of response shapes. It can get really noisy porting all of them in their original state because core tests restart nodes, check error messages, test CLI behavior, etc. See this test:
Corepc doesn't need it.
What would you specifically want to stay? What should be dropped for being excessively noisy? I imagine keeping the specific RPC call setup + field assertions so more optional fields get exercised.
EDIT: I'm making them as constrained as possible without being brittle.
Merge rust-bitcoin#606: tests: add curated list of client test invari…