Skip to content

tests: cover audio buffer decoding#3911

Open
jamesachurchill wants to merge 1 commit into
ggml-org:masterfrom
jamesachurchill:add-audio-buffer-decode-test
Open

tests: cover audio buffer decoding#3911
jamesachurchill wants to merge 1 commit into
ggml-org:masterfrom
jamesachurchill:add-audio-buffer-decode-test

Conversation

@jamesachurchill

Copy link
Copy Markdown

Adds a small regression test for the in-memory audio decoding path used by server multipart uploads without ffmpeg conversion.

The test reads samples/jfk.wav into a byte buffer, decodes it through read_audio_data(const char *, size_t, ...), decodes the same sample through the existing filename path, and asserts the PCM outputs match.

This covers the core regression behind #3819 without requiring a server lifecycle, network harness, ffmpeg, or model download.

Local verification on aarch64:

  • cmake --build build-3819-test --target test-read-audio-data-buffer -j2
  • ctest --test-dir build-3819-test -R test-read-audio-data-buffer --output-on-failure

Result: 100% tests passed.

Comment thread tests/CMakeLists.txt
target_compile_definitions(${AUDIO_BUFFER_TEST} PRIVATE
SAMPLE_PATH="${PROJECT_SOURCE_DIR}/samples/jfk.wav")
add_test(NAME ${AUDIO_BUFFER_TEST} COMMAND ${AUDIO_BUFFER_TEST})
set_tests_properties(${AUDIO_BUFFER_TEST} PROPERTIES LABELS "unit")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be run in CI? (it would need to have the gh label if so):

Suggested change
set_tests_properties(${AUDIO_BUFFER_TEST} PROPERTIES LABELS "unit")
set_tests_properties(${AUDIO_BUFFER_TEST} PROPERTIES LABELS "unit;gh")

With that change it should have both labels:

$ cmake --workflow --preset cpu-debug
$ ctest --test-dir build-cpu-debug/ -R test-read-audio-data-buffer --output-on-failure --print-labels
Internal ctest changing into directory: /home/danbev/work/ai/whisper-work/build-cpu-debug
Test project /home/danbev/work/ai/whisper-work/build-cpu-debug
All Labels:
  gh
  unit

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