From 327326be12f2c82eb5f057dada8793730abcebf3 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 24 Sep 2015 14:04:15 -0700 Subject: [PATCH] Annotating slower tests and excluding them from travis. --- .../api/export_data_to_cloud_storage_test.py | 2 ++ bigquery/api/load_data_from_csv_test.py | 2 ++ compute/api/create_instance_test.py | 2 ++ requirements-dev.txt | 1 + tox.ini | 34 ++++++++++++++++--- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/bigquery/api/export_data_to_cloud_storage_test.py b/bigquery/api/export_data_to_cloud_storage_test.py index e93e5d459b9..8d6a7cd207a 100644 --- a/bigquery/api/export_data_to_cloud_storage_test.py +++ b/bigquery/api/export_data_to_cloud_storage_test.py @@ -13,11 +13,13 @@ # """Tests for export_table_to_gcs.""" +from nose.plugins.attrib import attr from tests import CloudBaseTest from .export_data_to_cloud_storage import main +@attr('slow') class TestExportTableToGCS(CloudBaseTest): dataset_id = 'test_dataset' table_id = 'test_table' diff --git a/bigquery/api/load_data_from_csv_test.py b/bigquery/api/load_data_from_csv_test.py index 1b311a9ab4c..41ed703ca83 100644 --- a/bigquery/api/load_data_from_csv_test.py +++ b/bigquery/api/load_data_from_csv_test.py @@ -14,11 +14,13 @@ """Tests for load_data_from_csv.""" import os +from nose.plugins.attrib import attr from tests import CloudBaseTest from .load_data_from_csv import main +@attr('slow') class TestLoadDataFromCSV(CloudBaseTest): dataset_id = 'test_dataset' table_id = 'test_import_table' diff --git a/compute/api/create_instance_test.py b/compute/api/create_instance_test.py index 8c69d2c778e..226fef355a4 100644 --- a/compute/api/create_instance_test.py +++ b/compute/api/create_instance_test.py @@ -11,11 +11,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +from nose.plugins.attrib import attr import tests from .create_instance import main +@attr('slow') class TestComputeGettingStarted(tests.CloudBaseTest): def test_main(self): diff --git a/requirements-dev.txt b/requirements-dev.txt index fdf4be6527b..eae64a52b69 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -15,3 +15,4 @@ waitress==0.8.10 WebOb==1.4.1 WebTest==2.0.18 Werkzeug==0.10.4 +nose-timer diff --git a/tox.ini b/tox.ini index d6d0fedee76..ffeafc587f9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] skipsdist = True -envlist = gae, py27, py34, pep8 +envlist = pep8, gae, py27, py34 [testenv] passenv = PYTHONPATH GOOGLE_* GCLOUD_* TEST_* TRAVIS* @@ -8,7 +8,8 @@ basepython = python2.7 deps = -rrequirements.txt -rrequirements-dev.txt -coverargs = +commonargs = + --with-timer --with-coverage --cover-tests --cover-branches @@ -21,7 +22,7 @@ commands = nosetests --with-gae \ --gae-app=tests/resources/app.yaml \ --logging-level=INFO \ - {[testenv]coverargs} \ + {[testenv]commonargs} \ {posargs:appengine} setenv = PYTHONPATH={env:GAE_PYTHONPATH:} @@ -32,7 +33,8 @@ deps = commands = nosetests \ --exclude-dir=appengine \ - {[testenv]coverargs} \ + -a '!slow' \ + {[testenv]commonargs} \ {posargs} [testenv:py34] @@ -42,7 +44,29 @@ deps = commands = nosetests \ --exclude-dir=appengine \ - {[testenv]coverargs} \ + -a '!slow' \ + {[testenv]commonargs} \ + {posargs} + +[testenv:py27-slow] +deps = + {[testenv]deps} +commands = + nosetests \ + --exclude-dir=appengine \ + -a 'slow' \ + {[testenv]commonargs} \ + {posargs} + +[testenv:py34-slow] +basepython = python3.4 +deps = + {[testenv]deps} +commands = + nosetests \ + --exclude-dir=appengine \ + -a 'slow' \ + {[testenv]commonargs} \ {posargs} [testenv:pep8]