Skip to content

Add unit tests for codec inference#6332

Merged
sw005320 merged 3 commits intoespnet:masterfrom
elnaske:test_codec_inference
Jan 15, 2026
Merged

Add unit tests for codec inference#6332
sw005320 merged 3 commits intoespnet:masterfrom
elnaske:test_codec_inference

Conversation

@elnaske
Copy link
Copy Markdown
Contributor

@elnaske elnaske commented Jan 5, 2026

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 the AudioCoding class. 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

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. Codec labels Jan 5, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.41%. Comparing base (42b49b5) to head (bb15c4a).
⚠️ Report is 74 commits behind head on master.

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     
Flag Coverage Δ
test_integration_espnet2 46.96% <ø> (ø)
test_python_espnet2 62.38% <ø> (+0.31%) ⬆️
test_python_espnet3 16.06% <ø> (-0.01%) ⬇️
test_utils 62.38% <ø> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Fhrozen Fhrozen added this to the v.202601 milestone Jan 5, 2026
@Fhrozen
Copy link
Copy Markdown
Member

Fhrozen commented Jan 5, 2026

@elnaske, Thank you for your PR. could you please look the comment from gemini?

@elnaske
Copy link
Copy Markdown
Contributor Author

elnaske commented Jan 5, 2026

I added the suggested assertions, but decided to keep the test separate to mark the different use cases.

@ftshijt
Copy link
Copy Markdown
Collaborator

ftshijt commented Jan 5, 2026

Many thanks for your contribution. The test generally looks great. Would be glad to merge after the CIs are passed

@sw005320 sw005320 merged commit 8dd980a into espnet:master Jan 15, 2026
31 checks passed
@sw005320
Copy link
Copy Markdown
Contributor

Thanks, @elnaske!

@elnaske elnaske deleted the test_codec_inference branch January 15, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Codec size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants