-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add CI action to test endpoints from whitelisted chains and providers #5427
Conversation
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.
Nice work! I only had minor defense-in-depth recommendations but overall LGTM!
_tests/test_endpoints.py
Outdated
with open(filename) as f: | ||
data = json.load(f) | ||
chain_name = data.get('chain_name', 'unknown') | ||
if 'apis' in data: |
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.
Might be helpful to print some warnings if this condition is false in case the structure changes and we start skipping the entries.
Applies to other if statements below too
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.
Added
_tests/test_endpoints.py
Outdated
return test_cases | ||
|
||
test_cases = generate_endpoint_tests() | ||
if test_cases: |
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 do we need this check? Is it ever expected to not pass?
_tests/test_endpoints.py
Outdated
"axelar", | ||
"celestia", | ||
"composable", | ||
"cosmoshub", | ||
"dydx", | ||
"dymension", | ||
"evmos", | ||
"injective", | ||
"neutron", | ||
"noble", | ||
"osmosis", | ||
"stargaze", | ||
"stride" |
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.
If we want to ensure that our CI passes only when all providers are processed, we could also keep a tally of the number of successful chains validated, checking that it matches the length of the whitelisted chains at the end.
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.
Visualization is pretty sweet
This PR adds a github action to do a simple smoke test of the RPC and LCD endpoints offered in the chain registry.
This is how it looks like:
https://github.com/pablin-10/chain-registry/actions/runs/11265464331
By now only tests providers whitelisted in the test itself:
We may configure it to run every day or every week since it may take a lot of time to run for all the chains and providers if whitelist disabled.