Skip to content

test(S2): coverage back above main's, before the badge counts S2 - #284

Merged
Flix6x merged 2 commits into
dev/s2-frbc-completefrom
test/s2-coverage
Nov 8, 2026
Merged

Flix6x merged 2 commits into
dev/s2-frbc-completefrom
test/s2-coverage

Conversation

@Flix6x

@Flix6x Flix6x commented Nov 8, 2026

Copy link
Copy Markdown
Member

Into the integration branch dev/s2-frbc-complete (#279), not main.

Answers the review request on #278: before the badge also covers S2, raise coverage to at least what main had.

Coverage, combined over the core and S2 test jobs (lines, as Coveralls counts them):

Covered Lines Coverage
main (S2 omitted) 997 1042 95.68%
dev/s2-frbc-complete before this PR 3018 3171 95.17%
this PR 3042 3171 95.93%

S2 alone goes to 96.0%.

New tests, each shown to fail when the code it covers is broken (6 of 6 mutants killed):

  • test_handler_base.py: an invalid message is answered as INVALID_DATA and never reaches its handler; messages given as JSON are handled and recognised; failure callbacks are stored with their arguments; activating the control type already in force, or one the resource manager lacks, sends nothing; registering a control type again replaces its handler; an empty schedule gives no instructions.
  • test_example_server_websocket.py: the example server's producer sends what the CEM queues and stops when the connection is reset; its consumer hands messages to the CEM, logs one that is not JSON and carries on, closes on close, and closes the CEM on a connection error.

One test made robust: test_a_long_schedule_against_a_detailed_forecast_is_translated_quickly measured wall-clock time against 0.5 s, and failed in 2 of 12 local runs on a busy machine. With the S2 job now running under coverage, it would flake in CI too. It now measures CPU time: 0.11 s, or 0.22 s under coverage, against the 1.7 s it guards against.

What stays uncovered is mostly older code: FillRateBasedControlTUNES (45 lines) and the core client's retry paths (39 lines).

🤖 Generated with Claude Code

https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW

Flix6x and others added 2 commits November 8, 2026 15:46
… leave untested

Raise combined line coverage from 95.17% to 95.93%, above main's 95.68%
before the S2 package counted: an invalid message answered as
INVALID_DATA, messages given as JSON, failure callbacks, activating the
control type in force or one the resource manager lacks, re-registering a
control type, an empty schedule, and the example server's websocket
producer and consumer (send, reset, bad JSON, close, connection error).
Each test fails when the code it covers is broken (6 of 6 mutants killed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW
Signed-off-by: F.N. Claessen <claessen@seita.nl>
It measured wall-clock time against 0.5 s, and failed in 2 of 12 runs on
a busy machine; the S2 job now also runs under coverage. In CPU time it
takes 0.11 s, and 0.22 s under coverage, still well apart from the 1.7 s
it guards against.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CcpawsJs74cSwFLXkz7ZwW
Signed-off-by: F.N. Claessen <claessen@seita.nl>
@Flix6x Flix6x added this to the 0.10.0 milestone Nov 8, 2026
@Flix6x Flix6x added the S2 label Nov 8, 2026
@Flix6x
Flix6x merged commit 4816024 into dev/s2-frbc-complete Nov 8, 2026
20 of 21 checks passed
@Flix6x
Flix6x deleted the test/s2-coverage branch November 8, 2026 14:49
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 42491472324

Warning

No base build found for commit 95cda29 on dev/s2-frbc-complete.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 95.932%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 3171
Covered Lines: 3042
Line Coverage: 95.93%
Coverage Strength: 4.58 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants