Skip to content

Comments

test: add unit tests for data simulation utility functions#15412

Open
stanley1208 wants to merge 3 commits intoNVIDIA-NeMo:mainfrom
stanley1208:test/add-data-simul-util-tests
Open

test: add unit tests for data simulation utility functions#15412
stanley1208 wants to merge 3 commits intoNVIDIA-NeMo:mainfrom
stanley1208:test/add-data-simul-util-tests

Conversation

@stanley1208
Copy link
Contributor

What does this PR do?

Address the TODO at tests/collections/asr/utils/test_data_simul_utils_asr.py:296 requesting tests for all utility functions by adding 7 new unit tests for 4 previously untested functions in data_simulation_utils.py:

  • get_speaker_ids: Test correct speaker ID selection and session index wrap-around via modulo
  • build_speaker_samples_map: Test building speaker-to-samples mapping from manifest, including empty manifest edge case
  • get_speaker_samples: Test subsetting speaker samples by given speaker IDs
  • per_speaker_normalize: Test that output audio RMS matches the target volume level (parametrized over 3 volume values)

All 7 new tests pass locally (32 total in the test class, 0 failures).

Collection: ASR

Changelog

  • Add 7 unit tests covering get_speaker_ids, build_speaker_samples_map, get_speaker_samples, and per_speaker_normalize
  • Add corresponding imports for the newly tested functions

Usage

python -m pytest tests/collections/asr/utils/test_data_simul_utils_asr.py::TestDataSimulatorUtils -v

Signed-off-by: stanley1208 <stanley.mei08@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions bot added the ASR label Feb 18, 2026
Signed-off-by: stanley1208 <stanley1208@users.noreply.github.com>
@stanley1208
Copy link
Contributor Author

@nithinraok @pzelasko Ready for review — adds 7 unit tests for 4 untested data simulation utility functions, addressing the TODO at line 296. All tests pass locally. Thanks!

@pzelasko
Copy link
Collaborator

CC @tango4j

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants