-
Notifications
You must be signed in to change notification settings - Fork 886
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
pytest: Add grpc based CLN client to test grpc coverage #5362
pytest: Add grpc based CLN client to test grpc coverage #5362
Commits on Jul 20, 2022
-
msggen: Do not override method names when loading Schema
We were overriding the name right when loading, which is bad since in some languages we use the method name as tag in the requests, thus renaming causes us to call something that isn't defined. Changelog-Fixed: cln-rpc: Fixed a naming mismatch for `ConnectPeer` causing `connectpeer` to be called on the JSON-RPC
Configuration menu - View commit details
-
Copy full SHA for 7545671 - Browse repository at this point
Copy the full SHA 7545671View commit details -
pytest: Move generated grpc bindings to pyln-testing
These may eventually end up in pyln-client, as they allow talking to the GRPC interface exposed by cln-grpc, however for now they are used for testing only. Once we have sufficient API and test coverage we can move them and leave imports in their place.
Configuration menu - View commit details
-
Copy full SHA for 1df054e - Browse repository at this point
Copy the full SHA 1df054eView commit details -
msggen: Add a new generator for grpc -> python converter
To test the grpc interface we'll want to emulate the JSON-RPC interface as best we can, hence when talking to the grpc interface we want to convert back into a parsed JSON format as LightningRpc would have returned it. This is just the simplest way of closing the loop here: ``` pyln-testing --grpc-> cln-grpc --grpc2json ^ | | v | JSON-RPC | | TEST v ^ CLN | | | v pyln-testing <-grpc2py-- cln-grpc <- json2grpc ```
Configuration menu - View commit details
-
Copy full SHA for 7f46d74 - Browse repository at this point
Copy the full SHA 7f46d74View commit details -
pytest: Add a new RPC interface to talk to grpc
This allows us to re-use existing tests (assuming the call and fields are covered by `cln-rpc` and `cln-grpc`) to test the full roundtrip from test over the grpc interface to the json-rpc interface and back again. You can switch to the grpc interface by setting the `CLN_TEST_GRPC` environment variable to 1, but for now only very few shims are implemented (due to the non-generated nature of LightningRpc).
Configuration menu - View commit details
-
Copy full SHA for 07576bf - Browse repository at this point
Copy the full SHA 07576bfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4724cde - Browse repository at this point
Copy the full SHA 4724cdeView commit details -
cln-grpc: Skip serializing fields when Option<Vec<T>> is empty too
The CLN API is rather strict about the fact that we should skip providing a field whenever it is empty. Checking for `is_none` would still include empty arrays. Changelog-Fixed cln-rpc: Optional empty arrays will no longer be serialized in requests
Configuration menu - View commit details
-
Copy full SHA for 3bef363 - Browse repository at this point
Copy the full SHA 3bef363View commit details -
cln-plugin: Notify waiting tasks if the lightningd connection closes
This is usually a signal that lightningd is shutting down, so notify any instance that is waiting on `plugin.join()`. Changelog-Fixed: cln-plugin: Fixed an issue where plugins would hang indefinitely despite `lightningd` closing the connection
Configuration menu - View commit details
-
Copy full SHA for 8c16bfb - Browse repository at this point
Copy the full SHA 8c16bfbView commit details -
msggen: Add
stop
method to generatorsWe'll need this when testing the grpc interface in pyln-testing, otherwise tests just slowly die and wither.
Configuration menu - View commit details
-
Copy full SHA for 39891ac - Browse repository at this point
Copy the full SHA 39891acView commit details -
Configuration menu - View commit details
-
Copy full SHA for d60c264 - Browse repository at this point
Copy the full SHA d60c264View commit details -
pyln-testing: Add a couple of methods used in tests
These are the most used methods in tests, so we can start getting our test coverage up.
Configuration menu - View commit details
-
Copy full SHA for 6391cc7 - Browse repository at this point
Copy the full SHA 6391cc7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 48688ab - Browse repository at this point
Copy the full SHA 48688abView commit details -
msggen: Ignore
state_changes
in grpc2pyIt's being skipped in grpc so we don't have it later anyway.
Configuration menu - View commit details
-
Copy full SHA for 0270d7f - Browse repository at this point
Copy the full SHA 0270d7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b9d683 - Browse repository at this point
Copy the full SHA 1b9d683View commit details -
Configuration menu - View commit details
-
Copy full SHA for 80abccf - Browse repository at this point
Copy the full SHA 80abccfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ec272d - Browse repository at this point
Copy the full SHA 7ec272dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7fb54d8 - Browse repository at this point
Copy the full SHA 7fb54d8View commit details -
schema: Add missing
mindepth
argument tofundchannel
This was likely missed during the zeroconf PR. Changelog-None
Configuration menu - View commit details
-
Copy full SHA for 487c8b0 - Browse repository at this point
Copy the full SHA 487c8b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0741499 - Browse repository at this point
Copy the full SHA 0741499View commit details