test(bbm): assert graceful degradation in the live-API tests - #47
Merged
Conversation
Addresses the actionable part of #36. The ignored live-API tests unwrapped a success, so they panicked whenever an upstream endpoint was down -- which several breitbandmessung.de endpoints currently are, returning HTTP 200 with an HTML error page (Table 'fixedspeed' doesn't exist, various SQLSTATE errors). They now assert the library's own contract instead of upstream uptime: a call either parses, or fails with a clean typed error -- and specifically must never surface as BbmError::Json, which would mean a non-JSON body reached the deserializer (the panic path #24 fixed). The happy-path assertions still run when an endpoint is up. All five pass against the live API today even though three endpoints are broken: the broken ones return BbmError::Api and degrade gracefully; the working ones (provider list, plans) validate their data. The upstream outage itself remains outside our control; #36 stays open to track it.
This was referenced Jul 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the actionable part of #36. (The upstream outage itself isn't fixable by us — #36 stays open to track it.)
Problem
The
#[ignore]d live-API tests.unwrap()'d a success, so they panicked whenever an upstream endpoint was down. Severalbreitbandmessung.deendpoints currently are — they return HTTP 200 with an HTML error page:So
cargo test -- --ignoredpanicked on three tests, testing upstream uptime rather than our own behaviour.Change
The tests now assert the library's contract, not upstream availability: a call either parses, or fails with a clean typed error — and must never surface as
BbmError::Json, which would mean a non-JSON body reached the deserializer (the panic path #24 fixed). Happy-path validation still runs when an endpoint is up.A shared
assert_gracefulhelper intestutilcaptures this.Verified against the live API
All five pass today, with three endpoints broken:
The broken endpoints return
BbmError::Apiand degrade gracefully; the working ones (provider list, plans) validate their data.cargo test --workspace→ 114 passed ·cargo test -- --ignored→ 5 passed ·clippy -D warnings→ 0 ·fmt --checkclean