D13691 introduced the websocket dependency that may not be installed on all environments. For example it is unexpected to have this installed when chronik is not enabled in the build.
Details
- Reviewers
Fabien - Group Reviewers
Restricted Project
Without websockets installed:
ninja ./test/functional/test_runner.py chronik_*
The test should all be skipped instead of failing.
@bot build-chronik on CI
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- fix-chronik-tests-when-disabled
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 23375 Build 46369: Build Diff build-without-wallet · build-diff · build-debug · build-clang-tidy · build-clang Build 46368: arc lint + arc unit
Event Timeline
OK, this works because websocket is never used in this module at import time, only at runtime when a ChronikClient instance is created and used.
It will cause a non-descriptive error at runtime if chronik is compiled, when the tests are not skipped, though. We could add a more descriptive error message (see inline comments)
test/functional/test_framework/chronik/client.py | ||
---|---|---|
13 | (If mypy allows this) | |
141 |
That's not a good solution. We want to only include chronik/client.py if chronik is built, then whatever other dependency loaded from there is expected to be installed. This is the same for every other dev dependency: we expect the devs to be able to figure out they didn't read the doc and are missing the dependency.
The root cause is this client file being loaded if chronik is not built, and this is what needs to be fixed. This will also make the protobuf import simple (no longer needing the function wrapper).