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

Add makefile runner for tests #29

Merged
merged 3 commits into from Jan 13, 2020

Conversation

@gerph
Copy link
Contributor

gerph commented Jan 12, 2020

This change introduces a makefile which can be invoked by users, or by CI systems. It sets up a virtualenv for a specific python, and then using that python installs the package using python setup.py install which confirms that it is installable, then installs components that are needed by the tests themselves, and finally executes the tests. It also provides a clean and shell target, which may help developers to test in the same environment as the tests are run.

The changes here are:

  • Created a requirements-test.txt file which is 'the things that we need for testing'.
  • Tidied up the crash test so that it both checks that we found the /right/ failure, and cleans up after itself.
  • Created a Makefile to automate the invocation of the tests in a suitable test environment.

Makefile targets:

  • make tests to run the tests, or make tests PYTHON_TOOL=<your python> to tests with a specific python (eg python2).
  • make shell drops you to a bash shell in the environment it was testing in, so you can work with what the makefile thinks its testing against.
  • make clean removes the junk and the test environment so you can hopefully be sure it's going to work reliably for others.
gerph added 3 commits Jan 11, 2020
The requirements-test.txt file describes what the tests need in order
to run. That's distinct from the requirements to install - and it's
needed because the unittest.mock interface isn't present on Python 2.7,
so we need to use a backport.

This module is then used conditionally in the two tests we currently
have, so that we can run in either version.

The test classes have also had comments added to describe what they're
trying to test and the invariants they assume.
The test for a crash now checks that the file was actually created
and that we clean that file up afterward, so that we don't affect
other runs.
A small makefile allows the invocation of the test modules, so that
we can exercise the system and make sure that it does sensible things
when it's run - or at least that it doesn't regress.
@yevgenypats yevgenypats merged commit c089d8f into fuzzitdev:master Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.