Skip to content

Conversation

@Cuda-Chen
Copy link
Collaborator

@Cuda-Chen Cuda-Chen commented Dec 26, 2025

  • Create .ci/test-sound.sh to validate playback on host OS via expect.
  • Integrate sound test into Ubuntu and macOS GitHub workflows.
  • Set higher timeout for macOS (900s) to account for slower CI runners.

Summary by cubic

Add virtio-snd CI to automatically validate sound playback in semu on Linux and macOS, catching audio regressions early.

  • New Features
    • Added .ci/test-sound.sh that boots buildroot, logs in, plays ALSA sample via aplay, and checks for “Mono” output using expect.
    • OS-specific timeouts (30s Linux, 900s macOS) and pre-test cleanup.
    • Integrated the sound test into GitHub Actions for Ubuntu (5 min) and macOS (20 min) workflows.

Written for commit 1ba71a0. Summary will update automatically on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".ci/test-sound.sh">

<violation number="1" location=".ci/test-sound.sh:27">
P1: Unreachable error handling code. The `ASSERT` function from `common.sh` exits the script directly on failure, so `ret=&quot;$?&quot;` and the subsequent `MESSAGES` array logic will never execute for error cases. The descriptive error messages (&#39;Fail to boot&#39;, &#39;Fail to login&#39;, etc.) will never be displayed.

Consider capturing the exit code without using ASSERT, or modify `test_sound` to not use ASSERT for this case.</violation>
</file>

Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.

Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Improve descriptions about this pull request.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".ci/test-sound.sh">

<violation number="1" location=".ci/test-sound.sh:43">
P1: `ret=&quot;$?&quot;` now captures the exit code of `echo` (always 0) instead of `test_sound`. This breaks the error message handling logic below. The success message should be printed after capturing the return code.</violation>
</file>

Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".ci/test-sound.sh">

<violation number="1" location=".ci/test-sound.sh:27">
P2: Using `ASSERT` here makes the error handling code below unreachable. When `expect` returns a non-zero exit code (1-4), `ASSERT` will immediately exit the script with a generic &quot;Assert failed: expect&quot; message, bypassing the specific error messages in the MESSAGES array. Either remove `ASSERT` to preserve the detailed error messages, or remove the now-dead MESSAGES handling code.</violation>
</file>

Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name=".ci/test-sound.sh">

<violation number="1" location=".ci/test-sound.sh:27">
P1: Removing `ASSERT` breaks error handling. Since the script uses `set -euo pipefail`, when `expect` fails, the script will exit immediately before `ret=&quot;$?&quot;` can capture the exit status. The error message logic (`MESSAGES` array) becomes dead code and users won&#39;t see helpful failure diagnostics. Other CI scripts (`test-netdev.sh`, `autorun.sh`) correctly use `ASSERT expect`.</violation>
</file>

Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.

@Cuda-Chen Cuda-Chen force-pushed the add-virtio-snd-ci branch 2 times, most recently from 69e4e1d to 11ca7c3 Compare December 27, 2025 07:39
@Cuda-Chen Cuda-Chen requested a review from jserv December 27, 2025 07:39
Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Improve git commit messages.

@Cuda-Chen Cuda-Chen changed the title Add virtio-snd CI Add sound playback automated integration test Dec 27, 2025
@Cuda-Chen Cuda-Chen requested a review from jserv December 27, 2025 15:27
Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Improve git commit messages!

- Create '.ci/test-sound.sh' to validate playback on host OS via expect.
- Integrate sound test into Ubuntu and macOS GitHub workflows.
- Set higher timeout for macOS (900s) to account for slower CI runners.
@Cuda-Chen Cuda-Chen changed the title Add sound playback automated integration test CI: add automated sound playback integration test Dec 30, 2025
@jserv jserv merged commit e509ffd into sysprog21:master Dec 30, 2025
5 checks passed
@jserv
Copy link
Collaborator

jserv commented Dec 30, 2025

Thank @Cuda-Chen for contributing!

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