Tests: limit live API integration tests in Travis runs

To conserve our ESP test accounts' send quotas, don't run
the live API integration tests 13 times in every Travis run.
Instead, just run them twice, on a representative set
of Python/Django combinations:

* Once on Python 2.7 (currently with Django 1.8)
* Once on Python 3.x (currently 3.5 with Django 1.9)

(Prep for running weekly tests on Travis cron.)

The *non*-integration tests still run on all combos.

* Introduce RUN_LIVE_TESTS environment var to control
  whether live API integration test cases should run.
  Default True, except in Travis-CI runs default False.
* Enable RUN_LIVE_TESTS in .travis.yml matrix for the
  Python/Django combos listed above.
This commit is contained in:
medmunds
2016-06-23 15:21:40 -07:00
parent a4f43d17d2
commit 0c5911ca34
7 changed files with 39 additions and 7 deletions

View File

@@ -10,11 +10,12 @@ from django.test.utils import override_settings
from anymail.exceptions import AnymailAPIError
from anymail.message import AnymailMessage
from .utils import AnymailTestMixin, sample_image_path
from .utils import AnymailTestMixin, sample_image_path, RUN_LIVE_TESTS
SPARKPOST_TEST_API_KEY = os.getenv('SPARKPOST_TEST_API_KEY')
@unittest.skipUnless(RUN_LIVE_TESTS, "RUN_LIVE_TESTS disabled in this environment")
@unittest.skipUnless(SPARKPOST_TEST_API_KEY,
"Set SPARKPOST_TEST_API_KEY environment variable "
"to run SparkPost integration tests")