Testing¶
There are three kinds of tests the MMMAudio is set to run (see below). All these tests run on each PR. See the GitHub Actions file for details. They can also be run locally to ensure that tests are passing before pushing (or for quickly assessing any remaining updates needed to align the code base with new features).
1. Unit Tests¶
These can be found in UnitTests.mojo. Some of these tests rely on the Librosa "results" generated by /testing/librosa_results_for_testing_against.py, so be sure to run this first.
2. "Smoke" Tests¶
Turn everything on and see if anything "catches on fire."
See testing/test_build_mojo_files.py to see how they are run. This script tries to "build" each .mojo file, generating a .o file which is then deleted. This way any syntax issues can be identified quickly and easily across all the (appropriate) .mojo files in the code base.
3. Snapshot Tests¶
Some code, such as the audio analyses, are difficult to test against a "ground truth" because different codebases have different opinions about how to implement them, have different levels of precision, or other concerns. These tests run select .mojo files, the outputs of which are compared against a "snapshot" of what they previously output (the previous snapshot is taken when the files are known to be working). These tests pass if the current outputs match the previous snapshot.