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

Rewriting the integration tests to make them reliable and easier to understand #198

Merged
merged 122 commits into from May 4, 2015

Conversation

MaZderMind
Copy link

These changes introduce a cleaner, reliable and more complete set of integration tests increasing unit test coverage to >99%.

It creates a new common testing base system, which does not rely on sleeping n-seconds (to give the server time to start) but instead closely monitors the server's stdout to know when the server is ready for a specific test to begin. This way the tests run much faster and don't rely on the speed of the running machine. This should greatly improve overall test reliability, especially on highly variable environments like Travis-CI.

Tests which continue to have problems after this change are marked as @xfail and reference GitHub-Issues about why the tests fail.

This pull request closes the following open issues;

  • Closes #179 - The test test_get_preview_ports sporadically fails.
  • Closes #178 - Failure in test_set_composite_mode_preview.
  • Closes #180 - Server exiting with exit code -5
  • Closes #173 - Errors when running make test
  • Closes #170 - NUM and FACTOR stuff in test_controller is incomprehensible
  • Closes #166 - Integration tests should use pyvirtualdisplay or similar module
  • Closes #37 - Replace ffmpeg / avcon usage in the integration tests with gstreamer.
  • Closes #159 - Cleanup Python-API unit test output
  • Closes #17 - Move to some type of pre-built test runner
  • Closes #2 - Test timer should use average test run time

# can either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
disable=E0611,E0202,R0801,E1101,E1002,R0201,F0401,W0141,R0904,too-few-public-methods
Copy link
Member

Choose a reason for hiding this comment

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

Do you need all these disables? If so can you please describe why. It would also be good to use the "short-names" rather than the numbers.

Copy link
Author

Choose a reason for hiding this comment

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

no, i just copied the .pylint_integrationtests to .pylint_integrationtests2, I did not take a look at pylint compatibility for the new tests yet.

@@ -182,85 +206,86 @@ class MockConnection(object):

"""A class which mocks the Connection class"""

def __init__(self, mode):
self.mode = mode
def __init__(self, return_variant, should_fail=False):
Copy link
Member

Choose a reason for hiding this comment

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

What is return_variant used for? Docstring would be good :)

Copy link
Author

Choose a reason for hiding this comment

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

I documented that.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.02%) to 99.91% when pulling 89fb0b5 on MaZderMind:int-tests-rewrite2 into a0f8a38 on timvideos:master.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.12% when pulling 89fb0b5 on MaZderMind:int-tests-rewrite2 into a0f8a38 on timvideos:master.

@mithro
Copy link
Member

mithro commented May 4, 2015

Generally a very awesome pull request! Thank you so much for you work on this.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.13% when pulling b7ad780 on MaZderMind:int-tests-rewrite2 into a0f8a38 on timvideos:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.02%) to 99.91% when pulling b7ad780 on MaZderMind:int-tests-rewrite2 into a0f8a38 on timvideos:master.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.13% when pulling d5a1ffb on MaZderMind:int-tests-rewrite2 into a0f8a38 on timvideos:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.02%) to 99.91% when pulling d5a1ffb on MaZderMind:int-tests-rewrite2 into a0f8a38 on timvideos:master.

mithro added a commit that referenced this pull request May 4, 2015
Rewriting the integration tests to make them reliable and easier to understand
@mithro mithro merged commit 9ad792a into timvideos:master May 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants