Add unit tests for codec inference#6332
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds unit tests for gan_codec_inference.py. The tests cover the main functionalities, including argument parsing, the main entry point, and the AudioCoding class for encoding and decoding. My main feedback is to strengthen the tests for the AudioCoding class by adding assertions to verify the output, which will make the tests more robust. I've provided a suggestion to combine and improve the existing tests.
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6332 +/- ##
==========================================
+ Coverage 69.39% 69.41% +0.01%
==========================================
Files 759 759
Lines 69851 69853 +2
==========================================
+ Hits 48473 48487 +14
+ Misses 21378 21366 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@elnaske, Thank you for your PR. could you please look the comment from gemini? |
|
I added the suggested assertions, but decided to keep the test separate to mark the different use cases. |
|
Many thanks for your contribution. The test generally looks great. Would be glad to merge after the CIs are passed |
|
Thanks, @elnaske! |
What did you change?
Added unit tests for
espnet2/bin/gan_codec_inference.py. Includes tests for end-to-end usage and separate encoding and decoding via theAudioCodingclass. Coverage is similar to test scripts for other inference tasks.Why did you make this change?
Is your PR small enough?
Yes (1 file, 50 lines).
Additional Context
#6326