Skip to content

Commit a553b22

Browse files
author
Jon Wayne Parrott
committed
Adding flaky tests plugin
There were various datastore tests that were failing due to serviceunavailable errors. Now, all the integration tests are marked with the flaky plugin but will only retry for "gcloud.exceptions.ServiceUnavailable" exceptions.
1 parent 1647001 commit a553b22

File tree

21 files changed

+96
-10
lines changed

21 files changed

+96
-10
lines changed

2-structured-data/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ flake8
55
coverage
66
BeautifulSoup4
77
mock
8+
flaky

2-structured-data/tests/test_crud.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@
1616

1717
import bookshelf
1818
import config
19+
from flaky import flaky
20+
from gcloud.exceptions import ServiceUnavailable
1921
from nose.plugins.attrib import attr
2022

2123

24+
def flaky_filter(e, *args):
25+
return isinstance(e, ServiceUnavailable)
26+
27+
28+
@flaky(rerun_filter=flaky_filter)
2229
class IntegrationBase(unittest.TestCase):
2330

2431
def createBooks(self, n=1):

2-structured-data/tox.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ deps =
88
-rrequirements.txt
99
-rrequirements-dev.txt
1010
commands =
11-
nosetests --with-coverage --cover-package bookshelf {posargs:-a '!e2e'}
11+
nosetests \
12+
--with-flaky \
13+
--no-success-flaky-report \
14+
--with-coverage \
15+
--cover-package bookshelf \
16+
{posargs:-a '!e2e'}
1217
passenv = GOOGLE_APPLICATION_CREDENTIALS
1318

1419
[testenv:py34]

3-binary-data/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ flake8
55
coverage
66
BeautifulSoup4
77
mock
8+
flaky

3-binary-data/tests/test_crud.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,16 @@
1616

1717
import bookshelf
1818
import config
19+
from flaky import flaky
20+
from gcloud.exceptions import ServiceUnavailable
1921
from nose.plugins.attrib import attr
2022

2123

24+
def flaky_filter(e, *args):
25+
return isinstance(e, ServiceUnavailable)
26+
27+
28+
@flaky(rerun_filter=flaky_filter)
2229
class IntegrationBase(unittest.TestCase):
2330

2431
def createBooks(self, n=1):

3-binary-data/tox.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ deps =
88
-rrequirements.txt
99
-rrequirements-dev.txt
1010
commands =
11-
nosetests --with-coverage --cover-package bookshelf {posargs:-a '!e2e'}
11+
nosetests \
12+
--with-flaky \
13+
--no-success-flaky-report \
14+
--with-coverage \
15+
--cover-package bookshelf \
16+
{posargs:-a '!e2e'}
1217
passenv = GOOGLE_APPLICATION_CREDENTIALS
1318

1419
[testenv:py34]

4-auth/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ flake8
55
coverage
66
BeautifulSoup4
77
mock
8+
flaky

4-auth/tests/test_crud.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,17 @@
1616

1717
import bookshelf
1818
import config
19+
from flaky import flaky
20+
from gcloud.exceptions import ServiceUnavailable
1921
from nose.plugins.attrib import attr
22+
from oauth2client.client import OAuth2Credentials
2023

2124

22-
from oauth2client.client import OAuth2Credentials
25+
def flaky_filter(e, *args):
26+
return isinstance(e, ServiceUnavailable)
2327

2428

29+
@flaky(rerun_filter=flaky_filter)
2530
class IntegrationBase(unittest.TestCase):
2631

2732
def createBooks(self, n=1):

4-auth/tox.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ deps =
88
-rrequirements.txt
99
-rrequirements-dev.txt
1010
commands =
11-
nosetests --with-coverage --cover-package bookshelf {posargs:-a '!e2e'}
11+
nosetests \
12+
--with-flaky \
13+
--no-success-flaky-report \
14+
--with-coverage \
15+
--cover-package bookshelf \
16+
{posargs:-a '!e2e'}
1217
passenv = GOOGLE_APPLICATION_CREDENTIALS
1318

1419
[testenv:py34]

5-logging/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ flake8
55
coverage
66
BeautifulSoup4
77
mock
8+
flaky

0 commit comments

Comments
 (0)