Skip to content
This repository was archived by the owner on Sep 22, 2026. It is now read-only.

test: assert the channel-link contract once instead of four times - #1554

Merged
njbrake merged 1 commit into
mainfrom
simplify/11-test-consolidation
Sep 21, 2026
Merged

njbrake merged 1 commit into
mainfrom
simplify/11-test-consolidation

Conversation

@njbrake

@njbrake njbrake commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fifth of six stacked PRs. Targets #1553.

Telegram, Linq, BlueBubbles, and Twilio expose the same GET / PUT / DELETE contract over one identifier. test_channels_router.py spelled all of it out four times: 61 test functions, of which 36 were the same nine tests with a different path and field name.

The shared contract is now one class parametrized over the four channels. Each channel keeps a class for its own format rules: numeric ids for Telegram, E.164 for Linq and Twilio, E.164 or an iCloud email for BlueBubbles. ids=str keeps failure attribution per channel.

Same 61 cases collected, 338 fewer lines, and two assertions gained: Telegram, Linq, and BlueBubbles pick up the connected is True check on a linked GET that only Twilio had, and Twilio's remove-when-not-linked test picks up the null-identifier check the other three had.

CHANNEL_CASES is the only roster of link-capable channels, so a channel added to the router and not to the table would ship with no contract coverage and a green build. One test compares the table against the router's own link endpoints.

Type

  • Test

Checklist

  • Tests pass (uv run pytest -v): 4268 passed, 6 skipped
  • Lint passes (ruff check backend/ && ruff format --check backend/)
  • New tests added for new functionality: the roster guard
  • Bug fixes include regression tests

AI Usage

  • AI-assisted: written by Claude Opus 5 via back-and-forth with @njbrake.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: mozilla-ai/clawbolt/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b6fec48e-b2d1-4e1d-a814-d9506230ca66

📥 Commits

Reviewing files that changed from the base of the PR and between 4e3f1d0 and a7a7a6f.

📒 Files selected for processing (1)
  • tests/multi_user/test_channels_router.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@njbrake
njbrake force-pushed the simplify/10-frontend-generated-types branch from 1e430a6 to 864da2c Compare September 21, 2026 15:12
@njbrake
njbrake force-pushed the simplify/11-test-consolidation branch from 8535dfd to 312b5e2 Compare September 21, 2026 15:12
@njbrake
njbrake force-pushed the simplify/10-frontend-generated-types branch from 864da2c to 1cfcd65 Compare September 21, 2026 18:47
@njbrake
njbrake force-pushed the simplify/11-test-consolidation branch from 312b5e2 to 21369f4 Compare September 21, 2026 18:47
@njbrake
njbrake force-pushed the simplify/10-frontend-generated-types branch from 1cfcd65 to 2e3f2d3 Compare September 21, 2026 18:49
@njbrake
njbrake force-pushed the simplify/11-test-consolidation branch from 21369f4 to cb0774d Compare September 21, 2026 18:49
@njbrake
njbrake force-pushed the simplify/10-frontend-generated-types branch from 2e3f2d3 to 245bcea Compare September 21, 2026 19:00
@njbrake
njbrake force-pushed the simplify/11-test-consolidation branch from cb0774d to 9af0d19 Compare September 21, 2026 19:00
@njbrake
njbrake force-pushed the simplify/10-frontend-generated-types branch from 245bcea to 063ef19 Compare September 21, 2026 19:10
@njbrake
njbrake force-pushed the simplify/11-test-consolidation branch from 9af0d19 to b9b0ded Compare September 21, 2026 19:10
@njbrake
njbrake force-pushed the simplify/10-frontend-generated-types branch from 063ef19 to c71a8aa Compare September 21, 2026 19:18
@njbrake
njbrake force-pushed the simplify/11-test-consolidation branch from b9b0ded to 6bbd533 Compare September 21, 2026 19:19
Base automatically changed from simplify/10-frontend-generated-types to main September 21, 2026 19:29
Telegram, Linq, BlueBubbles, and Twilio expose the same GET / PUT /
DELETE contract over one identifier, and the file spelled all of it out
four times: 61 test functions, of which 36 were the same nine tests with
a different path and field name.

The shared contract is now one class parametrized over the four channels,
and each channel keeps a class for its own format rules (numeric ids for
Telegram, E.164 for Linq and Twilio, E.164 or an iCloud email for
BlueBubbles). ids=str keeps failure attribution per channel.

Same 61 cases collected, 338 fewer lines, and two assertions gained:
Telegram, Linq, and BlueBubbles pick up the `connected is True` check on
a linked GET that only Twilio had, and Twilio's remove-when-not-linked
test picks up the null-identifier check the other three had.

CHANNEL_CASES is the only roster of link-capable channels, so a channel
added to the router and not to the table would ship with no contract
coverage and a green build. One test now compares the table against the
router's own link endpoints. Fields are passed by keyword: three of the
five are same-typed strings, and reordering them would silently repurpose
which value stands for "already claimed by another user".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@njbrake
njbrake force-pushed the simplify/11-test-consolidation branch from 6bbd533 to a7a7a6f Compare September 21, 2026 19:29
@njbrake
njbrake merged commit 41e9ec2 into main Sep 21, 2026
10 checks passed
@njbrake
njbrake deleted the simplify/11-test-consolidation branch September 21, 2026 19:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant