diff --git a/MANIFEST.in b/MANIFEST.in index 8ac16676401b9..5d1af3e9f0b04 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ include README.rst graft gcloud global-exclude *.pyc -recursive-exclude system_tests * diff --git a/system_tests/__init__.py b/system_tests/__init__.py deleted file mode 100644 index 61e4b7953ceac..0000000000000 --- a/system_tests/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2015 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/scripts/attempt_system_tests.py b/system_tests/attempt_system_tests.py similarity index 97% rename from scripts/attempt_system_tests.py rename to system_tests/attempt_system_tests.py index b880755fe6b4f..ed503bebab8eb 100644 --- a/scripts/attempt_system_tests.py +++ b/system_tests/attempt_system_tests.py @@ -26,6 +26,9 @@ import subprocess import sys +from run_system_test import run_module_tests + + MODULES = ( 'datastore', 'storage', @@ -102,9 +105,6 @@ def prepare_to_run(): def main(): """Run all the system tests if necessary.""" prepare_to_run() - - sys.path.append(ROOT_DIR) - from system_tests.run_system_test import run_module_tests for module in MODULES: run_module_tests(module) diff --git a/system_tests/datastore.py b/system_tests/datastore.py index d995426d9983b..dbef49e7d857d 100644 --- a/system_tests/datastore.py +++ b/system_tests/datastore.py @@ -27,9 +27,9 @@ from gcloud.exceptions import Conflict # This assumes the command is being run via tox hence the # repository root is the current directory. -from system_tests import clear_datastore -from system_tests import populate_datastore -from system_tests.system_test_utils import EmulatorCreds +import clear_datastore +import populate_datastore +from system_test_utils import EmulatorCreds class Config(object): diff --git a/system_tests/pubsub.py b/system_tests/pubsub.py index 0924c08d381e9..b4e73f1617795 100644 --- a/system_tests/pubsub.py +++ b/system_tests/pubsub.py @@ -22,7 +22,7 @@ from gcloud.environment_vars import PUBSUB_EMULATOR from gcloud.environment_vars import TESTS_PROJECT from gcloud import pubsub -from system_tests.system_test_utils import EmulatorCreds +from system_test_utils import EmulatorCreds DEFAULT_TOPIC_NAME = 'subscribe-me%d' % (1000 * time.time(),) diff --git a/scripts/run_emulator.py b/system_tests/run_emulator.py similarity index 98% rename from scripts/run_emulator.py rename to system_tests/run_emulator.py index ea86b2c0ec9be..c77f7c2772406 100644 --- a/scripts/run_emulator.py +++ b/system_tests/run_emulator.py @@ -28,7 +28,7 @@ from gcloud.environment_vars import GCD_DATASET from gcloud.environment_vars import GCD_HOST from gcloud.environment_vars import PUBSUB_EMULATOR -from system_tests.run_system_test import run_module_tests +from run_system_test import run_module_tests PACKAGE_INFO = { diff --git a/system_tests/run_system_test.py b/system_tests/run_system_test.py index 171a0d1c85f29..9d49c57b0c862 100644 --- a/system_tests/run_system_test.py +++ b/system_tests/run_system_test.py @@ -18,11 +18,11 @@ # This assumes the command is being run via tox hence the # repository root is the current directory. -from system_tests import bigquery -from system_tests import datastore -from system_tests import pubsub -from system_tests import storage -from system_tests import system_test_utils +import bigquery +import datastore +import pubsub +import storage +import system_test_utils REQUIREMENTS = { diff --git a/tox.ini b/tox.ini index 8c8ec161284cf..616c36dbffa8e 100644 --- a/tox.ini +++ b/tox.ini @@ -84,21 +84,21 @@ passenv = {[testenv:system-tests]passenv} basepython = python2.7 commands = - python {toxinidir}/scripts/attempt_system_tests.py + python {toxinidir}/system_tests/attempt_system_tests.py passenv = GOOGLE_* GCLOUD_* TRAVIS* encrypted_* [testenv:system-tests3] basepython = python3.4 commands = - python {toxinidir}/scripts/attempt_system_tests.py + python {toxinidir}/system_tests/attempt_system_tests.py passenv = {[testenv:system-tests]passenv} [testenv:datastore-emulator] basepython = python2.7 commands = - python {toxinidir}/scripts/run_emulator.py --package=datastore + python {toxinidir}/system_tests/run_emulator.py --package=datastore setenv = PYTHONPATH = {toxinidir}/_testing GCLOUD_NO_PRINT=true @@ -110,6 +110,6 @@ deps = basepython = python2.7 commands = - python {toxinidir}/scripts/run_emulator.py --package=pubsub + python {toxinidir}/system_tests/run_emulator.py --package=pubsub passenv = GCLOUD_* deps = {[testenv:datastore-emulator]deps}