From 9c3c073d09333b9260b33bca635db4e95017a590 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Wed, 12 Apr 2017 15:14:35 -0700 Subject: [PATCH] Fix reference to our testing tools --- appengine/standard/conftest.py | 2 +- bigquery/api/export_data_to_cloud_storage_test.py | 2 +- bigquery/api/load_data_by_post_test.py | 2 +- bigquery/api/load_data_from_csv_test.py | 2 +- .../blog_test.py | 2 +- .../wiki_test.py | 2 +- compute/api/create_instance_test.py | 2 +- dataproc/dataproc_e2e_test.py | 2 +- datastore/cloud-client/snippets_test.py | 4 ++-- datastore/cloud-client/tasks_test.py | 4 ++-- dns/api/main_test.py | 2 +- iap/iap_test.py | 2 +- logging/cloud-client/export_test.py | 2 +- logging/cloud-client/snippets_test.py | 2 +- monitoring/api/v3/api-client/custom_metric_test.py | 4 ++-- monitoring/api/v3/api-client/list_resources_test.py | 2 +- monitoring/api/v3/cloud-client/snippets_test.py | 2 +- nox.py | 11 +++-------- pubsub/cloud-client/publisher_test.py | 2 +- pubsub/cloud-client/subscriber_test.py | 2 +- spanner/cloud-client/snippets_test.py | 2 +- storage/api/customer_supplied_keys_test.py | 2 +- testing/requirements.txt | 1 + 23 files changed, 28 insertions(+), 32 deletions(-) diff --git a/appengine/standard/conftest.py b/appengine/standard/conftest.py index 8a770af7a43d..f600c548ee91 100644 --- a/appengine/standard/conftest.py +++ b/appengine/standard/conftest.py @@ -15,7 +15,7 @@ import os # Import py.test hooks and fixtures for App Engine -from gcp.testing.appengine import ( +from gcp_devrel.testing.appengine import ( login, pytest_configure, pytest_runtest_call, diff --git a/bigquery/api/export_data_to_cloud_storage_test.py b/bigquery/api/export_data_to_cloud_storage_test.py index 88743d53a085..9d0e19b33f18 100644 --- a/bigquery/api/export_data_to_cloud_storage_test.py +++ b/bigquery/api/export_data_to_cloud_storage_test.py @@ -13,7 +13,7 @@ import os -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky from export_data_to_cloud_storage import main diff --git a/bigquery/api/load_data_by_post_test.py b/bigquery/api/load_data_by_post_test.py index 1fe7f1804d97..a3378a074689 100644 --- a/bigquery/api/load_data_by_post_test.py +++ b/bigquery/api/load_data_by_post_test.py @@ -14,7 +14,7 @@ import os import re -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky from load_data_by_post import load_data diff --git a/bigquery/api/load_data_from_csv_test.py b/bigquery/api/load_data_from_csv_test.py index 908c908f0506..1f559f6b4e63 100644 --- a/bigquery/api/load_data_from_csv_test.py +++ b/bigquery/api/load_data_from_csv_test.py @@ -13,7 +13,7 @@ import os -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky from load_data_from_csv import main diff --git a/blog/introduction_to_data_models_in_cloud_datastore/blog_test.py b/blog/introduction_to_data_models_in_cloud_datastore/blog_test.py index f0c7960673cf..3ed52eada50b 100644 --- a/blog/introduction_to_data_models_in_cloud_datastore/blog_test.py +++ b/blog/introduction_to_data_models_in_cloud_datastore/blog_test.py @@ -13,7 +13,7 @@ import os -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky from blog import main diff --git a/blog/introduction_to_data_models_in_cloud_datastore/wiki_test.py b/blog/introduction_to_data_models_in_cloud_datastore/wiki_test.py index 4b0fed1f759e..3f70e5c5be9c 100644 --- a/blog/introduction_to_data_models_in_cloud_datastore/wiki_test.py +++ b/blog/introduction_to_data_models_in_cloud_datastore/wiki_test.py @@ -13,7 +13,7 @@ import os -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky from wiki import main diff --git a/compute/api/create_instance_test.py b/compute/api/create_instance_test.py index dcff01224888..95244e95d6ba 100644 --- a/compute/api/create_instance_test.py +++ b/compute/api/create_instance_test.py @@ -14,7 +14,7 @@ import os import re -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky from create_instance import main diff --git a/dataproc/dataproc_e2e_test.py b/dataproc/dataproc_e2e_test.py index 4e86fdcb5391..dcb836c306bb 100644 --- a/dataproc/dataproc_e2e_test.py +++ b/dataproc/dataproc_e2e_test.py @@ -18,7 +18,7 @@ import os -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky import create_cluster_and_submit_job diff --git a/datastore/cloud-client/snippets_test.py b/datastore/cloud-client/snippets_test.py index 257e1da2a22b..64f19f6f81a7 100644 --- a/datastore/cloud-client/snippets_test.py +++ b/datastore/cloud-client/snippets_test.py @@ -13,8 +13,8 @@ import os -from gcp.testing import eventually_consistent -from gcp.testing.flaky import flaky +from gcp_devrel.testing import eventually_consistent +from gcp_devrel.testing.flaky import flaky from google.cloud import datastore import pytest diff --git a/datastore/cloud-client/tasks_test.py b/datastore/cloud-client/tasks_test.py index 72f7fceff170..e8fa3629178d 100644 --- a/datastore/cloud-client/tasks_test.py +++ b/datastore/cloud-client/tasks_test.py @@ -13,8 +13,8 @@ import os -from gcp.testing import eventually_consistent -from gcp.testing.flaky import flaky +from gcp_devrel.testing import eventually_consistent +from gcp_devrel.testing.flaky import flaky from google.cloud import datastore import pytest diff --git a/dns/api/main_test.py b/dns/api/main_test.py index bf1677f95fcb..63c5056a2e43 100644 --- a/dns/api/main_test.py +++ b/dns/api/main_test.py @@ -13,7 +13,7 @@ import os -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky from google.cloud import dns import pytest diff --git a/iap/iap_test.py b/iap/iap_test.py index 3a51d770a33d..0b620bbe90c5 100644 --- a/iap/iap_test.py +++ b/iap/iap_test.py @@ -14,7 +14,7 @@ """Test script for Identity-Aware Proxy code samples.""" -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky import make_iap_request import validate_jwt diff --git a/logging/cloud-client/export_test.py b/logging/cloud-client/export_test.py index 99b78f8e43bf..b53b8978f7b8 100644 --- a/logging/cloud-client/export_test.py +++ b/logging/cloud-client/export_test.py @@ -16,7 +16,7 @@ import random import string -from gcp.testing import eventually_consistent +from gcp_devrel.testing import eventually_consistent from google.cloud import logging import pytest diff --git a/logging/cloud-client/snippets_test.py b/logging/cloud-client/snippets_test.py index 86eac1180a04..f22fbc8f1bfb 100644 --- a/logging/cloud-client/snippets_test.py +++ b/logging/cloud-client/snippets_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from gcp.testing import eventually_consistent +from gcp_devrel.testing import eventually_consistent from google.cloud import logging import pytest diff --git a/monitoring/api/v3/api-client/custom_metric_test.py b/monitoring/api/v3/api-client/custom_metric_test.py index 76f328a3dbe2..e2b0d8f366ca 100644 --- a/monitoring/api/v3/api-client/custom_metric_test.py +++ b/monitoring/api/v3/api-client/custom_metric_test.py @@ -24,8 +24,8 @@ import random import time -from gcp.testing import eventually_consistent -from gcp.testing.flaky import flaky +from gcp_devrel.testing import eventually_consistent +from gcp_devrel.testing.flaky import flaky import googleapiclient.discovery import pytest diff --git a/monitoring/api/v3/api-client/list_resources_test.py b/monitoring/api/v3/api-client/list_resources_test.py index c17f09bcbbcb..f2a9bbf035dc 100644 --- a/monitoring/api/v3/api-client/list_resources_test.py +++ b/monitoring/api/v3/api-client/list_resources_test.py @@ -23,7 +23,7 @@ import os import re -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky import googleapiclient.discovery import pytest diff --git a/monitoring/api/v3/cloud-client/snippets_test.py b/monitoring/api/v3/cloud-client/snippets_test.py index e5ad69f3b7c6..4507f1df69ac 100644 --- a/monitoring/api/v3/cloud-client/snippets_test.py +++ b/monitoring/api/v3/cloud-client/snippets_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from gcp.testing import eventually_consistent +from gcp_devrel.testing import eventually_consistent import snippets diff --git a/nox.py b/nox.py index fe8159405ccd..158c29b4cb08 100644 --- a/nox.py +++ b/nox.py @@ -116,6 +116,7 @@ def _determine_local_import_names(start_dir): # App Engine specific helpers # + _GAE_ROOT = os.environ.get('GAE_ROOT') if _GAE_ROOT is None: _GAE_ROOT = tempfile.mkdtemp() @@ -143,10 +144,6 @@ def _setup_appengine_sdk(session): '--exclude', '.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py', ] -# Location of our common testing utilities. This isn't published to PyPI. -GCP_REPO_TOOLS_REQ =\ - 'git+https://github.com/GoogleCloudPlatform/python-repo-tools.git' - # Collect sample directories. ALL_TESTED_SAMPLES = sorted(list(_collect_dirs('.'))) @@ -177,7 +174,6 @@ def _setup_appengine_sdk(session): def _session_tests(session, sample): """Runs py.test for a particular sample.""" session.install('-r', 'testing/requirements.txt') - session.install(GCP_REPO_TOOLS_REQ) session.chdir(sample) @@ -197,7 +193,6 @@ def _session_tests(session, sample): def session_gae(session, sample): """Runs py.test for an App Engine standard sample.""" session.interpreter = 'python2.7' - session.install(GCP_REPO_TOOLS_REQ) _setup_appengine_sdk(session) # Create a lib directory if needed, otherwise the App Engine vendor library @@ -271,7 +266,7 @@ def session_check_requirements(session): This is intentionally not parametric, as it's desired to never have two samples with differing versions of dependencies. """ - session.install(GCP_REPO_TOOLS_REQ) + session.install('-r', 'testing/requirements.txt') if 'update' in session.posargs: command = 'update-requirements' @@ -281,4 +276,4 @@ def session_check_requirements(session): reqfiles = list(_list_files('.', 'requirements*.txt')) for reqfile in reqfiles: - session.run('gcprepotools', command, reqfile) + session.run('gcp-devrel-py-tools check-requirements', command, reqfile) diff --git a/pubsub/cloud-client/publisher_test.py b/pubsub/cloud-client/publisher_test.py index 6c0a9be004df..d7ca67098057 100644 --- a/pubsub/cloud-client/publisher_test.py +++ b/pubsub/cloud-client/publisher_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from gcp.testing import eventually_consistent +from gcp_devrel.testing import eventually_consistent from google.cloud import pubsub import pytest diff --git a/pubsub/cloud-client/subscriber_test.py b/pubsub/cloud-client/subscriber_test.py index e1fe2d482114..9f7f5a1bf81d 100644 --- a/pubsub/cloud-client/subscriber_test.py +++ b/pubsub/cloud-client/subscriber_test.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from gcp.testing import eventually_consistent +from gcp_devrel.testing import eventually_consistent from google.cloud import pubsub import pytest diff --git a/spanner/cloud-client/snippets_test.py b/spanner/cloud-client/snippets_test.py index 3feec3e6e9f3..8a50e0714819 100644 --- a/spanner/cloud-client/snippets_test.py +++ b/spanner/cloud-client/snippets_test.py @@ -16,7 +16,7 @@ import random import string -from gcp.testing import eventually_consistent +from gcp_devrel.testing import eventually_consistent from google.cloud import spanner import pytest diff --git a/storage/api/customer_supplied_keys_test.py b/storage/api/customer_supplied_keys_test.py index 00bb48245cc0..d6ff3cefd40c 100644 --- a/storage/api/customer_supplied_keys_test.py +++ b/storage/api/customer_supplied_keys_test.py @@ -14,7 +14,7 @@ import os import re -from gcp.testing.flaky import flaky +from gcp_devrel.testing.flaky import flaky from customer_supplied_keys import main diff --git a/testing/requirements.txt b/testing/requirements.txt index b5037a03e40d..67ad983e78d2 100644 --- a/testing/requirements.txt +++ b/testing/requirements.txt @@ -14,3 +14,4 @@ WebTest==2.0.25 webapp2==2.5.2 google-api-python-client==1.6.2 google-cloud-core==0.23.0 +gcp-devrel-py-tools==0.0.1