Skip to content

Conversation

@gfdb
Copy link
Contributor

@gfdb gfdb commented Jul 24, 2024

What does this PR do?

The integration tests for the data augmentation portion of the code base are broken. I assume at some point code was changed and due to pure coincidence, and the way the tests were written, they still pass. The main function in all the tests is never called, which means results are never generated. Since there are no results in the results directory, the tests run for filename in glob(os.path.join(output_folder, "save", "*.flac")) however this folder will be empty, meaning the tests will all pass because the test function will return after having done nothing.

This PR fixes and improves these tests. I intend to add the integration tests for the other augmentations not currently covered in another PR.

Main Changes

  • Fixed yaml imports i.e. time_domain/freq_domain instead of speech_augment
  • changed path related code to use os.path.join
  • fixed test/augmentation logic where applicable
  • removed babble noise test as there is no babble noise class, and this is generally implemented using the AddNoise augmentation which is already covered
  • run the main function in the test function so that results are actually generated during testing
  • run test function if script is run using python example_.py instead of main function
  • updated all expected files to reflect most recent implementation of all augmentations
  • changed absolute tolerance on tensor.allclose to 1e-4 (tested on 3 different machines and this seemed to be reasonable in order to account for variability between execution environments) however I invite and encourage reviewers to test locally to further confirm

Fixes #<issue_number>

Before submitting
  • Did you read the contributor guideline?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Does your code adhere to project-specific code style and conventions?

PR review

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified
  • Confirm that the changes adhere to compatibility requirements (e.g., Python version, platform)
  • Review the self-review checklist to ensure the code is ready for review

@gfdb gfdb marked this pull request as draft July 24, 2024 21:10
@gfdb gfdb force-pushed the fix-augmentation-integration-tests branch 3 times, most recently from 2a8996c to 5cc35cc Compare July 25, 2024 14:50
@gfdb gfdb marked this pull request as ready for review July 25, 2024 15:01
@asumagic asumagic self-assigned this Aug 19, 2024
@gfdb gfdb force-pushed the fix-augmentation-integration-tests branch from ad2d584 to 5cc35cc Compare August 28, 2024 14:40
@gfdb
Copy link
Contributor Author

gfdb commented Aug 29, 2024

@asumagic apologies, I merged changes from dev where tests seem to be broken...

@asumagic asumagic added this to the v1.1.0 milestone Sep 4, 2024
@gfdb gfdb force-pushed the fix-augmentation-integration-tests branch from c0fded1 to 55d60d8 Compare September 9, 2024 18:56
@gfdb
Copy link
Contributor Author

gfdb commented Sep 9, 2024

@asumagic, I re-triggered the CI and tests are now passing again

@asumagic asumagic merged commit af6cb06 into speechbrain:develop Sep 17, 2024
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