Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved unit tests for FFmpegRunner #1364

Merged
merged 27 commits into from
Dec 20, 2024
Merged

Improved unit tests for FFmpegRunner #1364

merged 27 commits into from
Dec 20, 2024

Conversation

tombogle
Copy link
Contributor

@tombogle tombogle commented Nov 8, 2024

With this change, these tests do not:

  • take over display
  • depend on an installed media player
  • leave junk on the screen
  • leave orphaned temp files

This change is Reviewable

@tombogle tombogle requested a review from andrew-polk November 8, 2024 20:24
@tombogle tombogle self-assigned this Nov 8, 2024
…endent on an installed media player, leave junk on the screen, and leave orphaned temp files.
Copy link

github-actions bot commented Nov 8, 2024

LibPalaso Tests

   36 files   -     9     36 suites   - 9   4m 34s ⏱️ - 7m 21s
2 477 tests  - 2 353  2 318 ✅  - 2 281  158 💤  -  73  1 ❌ +1 
6 901 runs   - 7 107  6 531 ✅  - 6 850  369 💤  - 258  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 1642a26. ± Comparison against base commit de37405.

This pull request removes 2353 tests.
SIL.DictionaryServices.Tests.Lift.EmbeddedXmlCollectionCloneableTests ‑ CloneCopiesAllNeededMembers
SIL.DictionaryServices.Tests.Lift.EmbeddedXmlCollectionCloneableTests ‑ Equal_ItemsAreEqual_ReturnsTrue
SIL.DictionaryServices.Tests.Lift.EmbeddedXmlCollectionCloneableTests ‑ Equal_OneFieldDiffers_ReturnsFalse
SIL.DictionaryServices.Tests.Lift.EmbeddedXmlCollectionCloneableTests ‑ Equal_SecondFieldIsNull_ReturnsFalse
SIL.DictionaryServices.Tests.Lift.EmbeddedXmlCollectionCloneableTests ‑ Equals_OtherIsNull_ReturnsFalse
SIL.DictionaryServices.Tests.Lift.EmbeddedXmlCollectionCloneableTests ‑ ObjectEquals_OtherIsNull_ReturnsFalse
SIL.DictionaryServices.Tests.Lift.FlagStateCloneableTests ‑ CloneCopiesAllNeededMembers
SIL.DictionaryServices.Tests.Lift.FlagStateCloneableTests ‑ Equal_ItemsAreEqual_ReturnsTrue
SIL.DictionaryServices.Tests.Lift.FlagStateCloneableTests ‑ Equal_OneFieldDiffers_ReturnsFalse
SIL.DictionaryServices.Tests.Lift.FlagStateCloneableTests ‑ Equal_SecondFieldIsNull_ReturnsFalse
…

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @tombogle)

Copy link

github-actions bot commented Nov 14, 2024

Palaso Tests

     3 files       3 suites   15m 41s ⏱️
 4 885 tests  4 652 ✅ 233 💤 0 ❌
14 118 runs  13 487 ✅ 631 💤 0 ❌

Results for commit a045012.

♻️ This comment has been updated with latest results.

Also cleaned up some outdated comments and did minor refactoring.
Copy link
Contributor

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

made the tests pass as it's now finding ffmpeg. Left a comment about the TeamCity category comment being inaccurate.

SIL.Media.Tests/AudioPlayerTests.cs Outdated Show resolved Hide resolved
SIL.Media.Tests/FFmpegRunnerTests.cs Show resolved Hide resolved
SIL.Media/FFmpegRunner.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @hahn-kev and @tombogle)

SIL.Media/FFmpegRunner.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r3, 9 of 9 files at r4, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @hahn-kev and @tombogle)

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @hahn-kev and @tombogle)

SIL.Media/FFmpegRunner.cs Outdated Show resolved Hide resolved
…quiresAudioInputDevice to make it clear what requirement might not be met when tests fail.

In FFmpegRunner, changed methods to use LocateAndRememberFFmpeg instead of LocateFFmpeg.
Made the Windows implementation of ISimpleAudioSession attempt to create an irrKlang-based recorder even if there is no audio output device enabled.
Improved some of the AudioSession unit tests to not require an audio input device if they are only testing playback.
Made AudioRecorderTests fail at the fixture level if an audio input device is not present rather than throwing an obscure exception inside OnHandleCrated.
SIL.Media/FFmpegRunner.cs Outdated Show resolved Hide resolved
… (not sure why installing FFmpeg worked once and now can't be found on the path.)
@tombogle
Copy link
Contributor Author

I see now that there is separate logic for locating FFmpeg and FFprobe, and they are not in sync. I'll finish getting them on the same page tomorrow.

…ation as FFmpeg and also on the system path).

Made FFmpegRunner explicitly a static class (technically a breaking change, though all methods were already static).
Made FFmpegRunner look for FFmpeg on the path before trying to find a version installed for Audacity (which is unlikely to succeed anyway).
Renamed FFmpegRunner.FfmpegMinimumVersion property to MinimumVersion.
Significant refactoring in FFmpegRunner and MediaInfo
Made private utility functions in FFmpegRunner and MediaInfo into local functions so they would not accidentally be called by other methods in those classes.
Added some test cases for MediaInfo.FFprobeFolder setter
@tombogle tombogle force-pushed the improve-tests branch 2 times, most recently from 0eaa2e9 to 2a5390f Compare December 3, 2024 14:38
Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 8 files at r8, 7 of 8 files at r10, 1 of 1 files at r11, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @hahn-kev)

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

Dismissed @hahn-kev from 3 discussions.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @hahn-kev and @tombogle)

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

Dismissed @hahn-kev from 2 discussions.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @tombogle)

Copy link
Contributor

@andrew-polk andrew-polk left a comment

Choose a reason for hiding this comment

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

Dismissed @tombogle from 3 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @tombogle)

@andrew-polk andrew-polk dismissed hahn-kev’s stale review December 20, 2024 20:44

I think Kevin's concerns are addressed, and Tom is trying to get this out. I think Kevin is out for the holidays.

@tombogle tombogle merged commit f5524b6 into master Dec 20, 2024
7 checks passed
@tombogle tombogle deleted the improve-tests branch December 20, 2024 20:46
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.

3 participants