Skip to content

Add tests of autoprocessing#5

Open
rpanderson wants to merge 9 commits into
philipstarkey:masterfrom
rpanderson:test_example_screencast
Open

Add tests of autoprocessing#5
rpanderson wants to merge 9 commits into
philipstarkey:masterfrom
rpanderson:test_example_screencast

Conversation

@rpanderson

Copy link
Copy Markdown
Collaborator

Tests autoscrub autoprocess command (by calling the CLI) on example_screencast.mp4, a file previously used for benchmarking and troubleshooting.

  • Check for successful completion of command.
  • Compare filtergraph to known valid ouput.
  • Check duration of processed file.
  • Check loudness statistics of processed file.

@rpanderson

rpanderson commented May 10, 2020

Copy link
Copy Markdown
Collaborator Author

Using Github Actions to run pytest on ubuntu-latest (actually 18.04.4), which passed.

Notes:

  • The latest FFmpeg on Ubuntu 18.04 is 3.4.4. This results in slightly different processing than FFmpeg 4.x, e.g. duration is 50.19s instead of 48.57s, some loudness values differ by 0.1 dB, and the filtergraph is therefore quite different.
  • I install 4.x using ppa:jonathonf/ffmpeg-4, which currently gets 4.2.2. There are others, e.g. ppa:savoury1/ffmpeg4.
  • This might have to revised when ubuntu-latest installs Ubuntu 20.04, or use snappy.
  • The line endings for the temporary filtergraph written by autoprocess differ on Windows (CRLF) and Linux (LF), so the strict filecmp.cmp call will currently only work for one of these (Linux).

TODO

p = autoscrub._agnostic_Popen(
["autoscrub", "autoprocess", "--debug", input, output]
)
_, stderr = autoscrub._agnostic_communicate(p)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Per #2 in which processing continued indefinitely, a timeout is essential here, akin to subprocess.Popen.communicate. @philipstarkey, is this something that could/should be added to autoscrub._agnostic_communicate or should I be using something else. here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For now I've set a timeout on the test runner, using pytest-timeout.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not sure why, but the test is stalling on Windows at this point (both locally and on Python 2.7 and 3.8).

@rpanderson rpanderson marked this pull request as draft May 10, 2020 07:37
@rpanderson rpanderson changed the title WIP: Add tests of autoprocessing Add tests of autoprocessing May 10, 2020
@rpanderson rpanderson marked this pull request as ready for review May 10, 2020 07:37
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.

1 participant