Skip to content

test(moq): add unit tests for vendored OrderedProducer and CatalogConsumer#457

Merged
streamer45 merged 3 commits into
mainfrom
devin/1778945039-moq-vendored-module-tests
May 16, 2026
Merged

test(moq): add unit tests for vendored OrderedProducer and CatalogConsumer#457
streamer45 merged 3 commits into
mainfrom
devin/1778945039-moq-vendored-module-tests

Conversation

@staging-devin-ai-integration
Copy link
Copy Markdown
Contributor

@staging-devin-ai-integration staging-devin-ai-integration Bot commented May 16, 2026

Summary

Adds 16 unit tests for the vendored OrderedProducer and CatalogConsumer modules introduced in #453 to improve patch coverage on these files (previously at 0%).

OrderedProducer tests (12): construction, with_max_group_duration, From trait, Deref, first-frame group creation, multi-frame counter, keyframe no-op on empty, keyframe closing active group, keyframe-then-write new group, max-duration auto-close, finish with active group, finish on empty.

CatalogConsumer tests (4): construction, From trait, next() returns None when track is finished, next() returns a catalog from a written frame (round-trip through moq_lite producer/consumer).

Review & Testing Checklist for Human

  • Verify tests exercise meaningful behavior (not just superficial coverage)
  • Run cargo test -p streamkit-nodes --features moq to confirm all 507 tests pass

Notes

Test-only PR, no production code changes. Follows existing test conventions in pull.rs (clippy suppressions for unwrap_used/expect_used, #[tokio::test] for moq_lite runtime requirement).

Link to Devin session: https://staging.itsdev.in/sessions/802a16b8707f4c50916049aaa55c6fc2
Requested by: @streamer45


Devin Review

Status Commit
🕐 Outdated d70c1eb (HEAD is f76d010)

Run Devin Review

Open in Devin Review (Staging)

…sumer

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
@staging-devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review (Staging)
Debug

Playground

Comment on lines +236 to +237
// Frame at the max duration boundary closes the old group and
// starts a fresh one for this frame.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Redundant test comment violates the repository comment rules

The added comment narrates the exact scenario and expected state that the following op.write(&make_frame(10_000)) call and assertions exercise. AGENTS.md makes the comment guidelines mandatory and explicitly forbids line-narration/restating how code works, so this new comment should be removed or replaced with a non-obvious why if one exists.

Prompt for agents
Remove the redundant comment in crates/nodes/src/transport/moq/ordered_producer.rs within the max_duration_auto_closes_old_group_and_starts_new test. The test name, write call, and assertions already express the behavior being verified; keeping the comment violates the repository's AGENTS.md guidance against line narration and comments that restate how code works.
Open in Devin Review (Staging)

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 663d8ca. The test name and assertions are sufficient.

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.97%. Comparing base (86a405f) to head (f76d010).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #457      +/-   ##
==========================================
+ Coverage   65.68%   65.97%   +0.28%     
==========================================
  Files         217      217              
  Lines       57357    57496     +139     
  Branches     1597     1597              
==========================================
+ Hits        37674    37932     +258     
+ Misses      19677    19558     -119     
  Partials        6        6              
Flag Coverage Δ
backend 65.05% <100.00%> (+0.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 84.57% <ø> (+0.27%) ⬆️
engine 75.57% <ø> (ø)
api 84.73% <ø> (ø)
nodes 67.52% <100.00%> (+0.64%) ⬆️
server 57.16% <ø> (ø)
plugin-native 70.93% <ø> (ø)
plugin-wasm 6.37% <ø> (ø)
ui-services 74.73% <ø> (ø)
ui-components 60.49% <ø> (ø)
Files with missing lines Coverage Δ
crates/nodes/src/transport/moq/catalog_consumer.rs 100.00% <100.00%> (+100.00%) ⬆️
crates/nodes/src/transport/moq/ordered_producer.rs 96.98% <100.00%> (+96.98%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
@streamer45 streamer45 merged commit bddff06 into main May 16, 2026
29 checks passed
@streamer45 streamer45 deleted the devin/1778945039-moq-vendored-module-tests branch May 16, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants