Skip to content

AudioPlayback Always Reports total=0 When Run Without Arguments #516

Description

Description
When ./run.sh is invoked with no arguments (or without --formats/--durations), the test always exits with total=0 pass=0 fail=0 skip=0 and a vacuous [PASS]. No audio tests are actually executed. This is a silent false pass — the CI/test pipeline reports success while having tested nothing.

Root Cause
There is a variable initialization ordering bug in run.sh. The block that sets default values for FORMATS and DURATIONS executes before the auto-detection of USE_CLIP_DISCOVERY, so the condition is never true:

BUG: USE_CLIP_DISCOVERY is still "auto" here — this block is NEVER entered

if [ "$USE_CLIP_DISCOVERY" = "false" ]; then
FORMATS="${FORMATS:-wav}" # ← skipped
DURATIONS="${DURATIONS:-short}" # ← skipped
fi

Auto-detection runs AFTER — sets USE_CLIP_DISCOVERY=false too late

if [ "$USE_CLIP_DISCOVERY" = "auto" ]; then
# no AudioClips dir found...
USE_CLIP_DISCOVERY=false # ← FORMATS/DURATIONS already unset
fi
The legacy matrix loop then iterates over empty strings:

for fmt in $FORMATS; # fmt="" → loop never executes
for dur in $DURATIONS; # dur="" → loop never executes
Steps to Reproduce
On a device with no AudioClips/ directory present
Run:

./run.sh
Observe output
Expected Behavior
[INFO] Using backend: pipewire
[INFO] Args: formats='wav' durations='short' ...
[INFO] Summary: total=1 pass=1 fail=0 skip=0
[PASS] AudioPlayback PASS
Actual Behavior
[INFO] Auto-detected legacy matrix mode (no clips directory found)
[INFO] Args: formats='' durations='' ... ← empty!
[INFO] Summary: total=0 pass=0 fail=0 skip=0 ← nothing ran
[PASS] AudioPlayback PASS ← false pass!
Proposed Fix
Move the defaults block to after the auto-detection block so USE_CLIP_DISCOVERY is fully resolved before it is evaluated:

1. Auto-detect first

if [ "$USE_CLIP_DISCOVERY" = "auto" ]; then
clips_dir="${AUDIO_CLIPS_BASE_DIR:-AudioClips}"
if [ -d "$clips_dir" ] && ; then
USE_CLIP_DISCOVERY=true
else
USE_CLIP_DISCOVERY=false
fi
fi

2. THEN set defaults — USE_CLIP_DISCOVERY is now resolved

if [ "$USE_CLIP_DISCOVERY" = "false" ]; then
FORMATS="${FORMATS:-wav}"
DURATIONS="${DURATIONS:-short}"
fi
Workaround
Pass formats and durations explicitly until the fix is applied:

./run.sh --formats "wav" --durations "short"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions