Skip to content

test: add async playback regression coverage for aiwidget#7441

Open
mahesh-09-12 wants to merge 1 commit into
sugarlabs:masterfrom
mahesh-09-12:test/aiwidget-async-playback
Open

test: add async playback regression coverage for aiwidget#7441
mahesh-09-12 wants to merge 1 commit into
sugarlabs:masterfrom
mahesh-09-12:test/aiwidget-async-playback

Conversation

@mahesh-09-12

Copy link
Copy Markdown
Contributor

Summary

Adds regression-focused tests for async playback sequencing and analyser-routing flows in js/widgets/aiwidget.js.

This PR focuses on deterministic playback behavior, async lifecycle sequencing, and synth/analyser routing paths that are more prone to regressions during future playback or audio-runtime changes.

Covered regression scenarios

The added tests validate:

  • delayed sample playback execution,
  • async playback completion behavior,
  • playback lifecycle delegation flows,
  • custom sample playback guards,
  • reference sample analyser routing,
  • and custom sample analyser routing behavior.

Why these tests

aiwidget.js coordinates:

  • async playback sequencing,
  • synth routing,
  • analyser connections,
  • and playback lifecycle behavior.

These execution paths are more regression-prone because they combine async timing behavior with runtime synth/analyser coordination.

The added tests focus on:

  • deterministic async execution,
  • playback lifecycle consistency,
  • runtime routing correctness,
  • and contributor-facing reliability improvements.

This PR intentionally targets async playback and analyser-routing execution paths instead of broad coverage expansion across the entire file.

Additional targeted regression coverage for remaining aiwidget.js execution paths can continue incrementally in follow-up PRs to keep testing changes maintainable and focused.

Testing

npm test

Closes #7440

PR Category

  • Bug Fix
  • Feature
  • Performance
  • Tests
  • Documentation

@github-actions github-actions Bot added tests Adds or updates test coverage size/M Medium: 50-249 lines changed area/javascript Changes to JS source files area/tests Changes to test files labels May 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Jest Test Results

✅ All Jest tests passed! This PR is ready to merge.

Coverage: Statements: 48.15% | Branches: 39.67% | Functions: 53.07% | Lines: 48.55%
Master Coverage: Statements: 48.09% | Branches: 39.61% | Functions: 52.88% | Lines: 48.49%

@mahesh-09-12

Copy link
Copy Markdown
Contributor Author

Hi @omsuneri, this PR focuses on async playback and analyser-routing regression coverage for aiwidget.js. Whenever you're free, I'd appreciate a review.

@Chaitu7032 Chaitu7032 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

solid test coverage contribution.
I don't see any correctness issue, missing assertion

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

Labels

area/javascript Changes to JS source files area/tests Changes to test files size/M Medium: 50-249 lines changed tests Adds or updates test coverage

Projects

Development

Successfully merging this pull request may close these issues.

[Test] Improve async playback and analyser regression coverage for AI widget flows

2 participants