Skip to content

Commit 8c1db22

Browse files
committed
Moving all system test scripts in system_tests/.
Also removing system_tests/__init__.py so it is no longer a package and making all imports happen locally (rather than from the root of the project). Changes originally inspired by emulator script breakages in googleapis#1373.
1 parent bc718d3 commit 8c1db22

File tree

9 files changed

+20
-33
lines changed

9 files changed

+20
-33
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
include README.rst
22
graft gcloud
33
global-exclude *.pyc
4-
recursive-exclude system_tests *

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[nosetests]
2-
ignore-files = run_system_test\.py
2+
exclude-dir = system_tests
33

44
[bdist_wheel]
55
universal = 1

system_tests/__init__.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

scripts/attempt_system_tests.py renamed to system_tests/attempt_system_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import subprocess
2727
import sys
2828

29+
from run_system_test import run_module_tests
30+
31+
2932
MODULES = (
3033
'datastore',
3134
'storage',
@@ -102,9 +105,6 @@ def prepare_to_run():
102105
def main():
103106
"""Run all the system tests if necessary."""
104107
prepare_to_run()
105-
106-
sys.path.append(ROOT_DIR)
107-
from system_tests.run_system_test import run_module_tests
108108
for module in MODULES:
109109
run_module_tests(module)
110110

system_tests/datastore.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
from gcloud.exceptions import Conflict
2828
# This assumes the command is being run via tox hence the
2929
# repository root is the current directory.
30-
from system_tests import clear_datastore
31-
from system_tests import populate_datastore
32-
from system_tests.system_test_utils import EmulatorCreds
30+
import clear_datastore
31+
import populate_datastore
32+
from system_test_utils import EmulatorCreds
3333

3434

3535
class Config(object):

system_tests/pubsub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from gcloud.environment_vars import PUBSUB_EMULATOR
2323
from gcloud.environment_vars import TESTS_PROJECT
2424
from gcloud import pubsub
25-
from system_tests.system_test_utils import EmulatorCreds
25+
from system_test_utils import EmulatorCreds
2626

2727

2828
DEFAULT_TOPIC_NAME = 'subscribe-me%d' % (1000 * time.time(),)

scripts/run_emulator.py renamed to system_tests/run_emulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from gcloud.environment_vars import GCD_DATASET
2929
from gcloud.environment_vars import GCD_HOST
3030
from gcloud.environment_vars import PUBSUB_EMULATOR
31-
from system_tests.run_system_test import run_module_tests
31+
from run_system_test import run_module_tests
3232

3333

3434
PACKAGE_INFO = {

system_tests/run_system_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818

1919
# This assumes the command is being run via tox hence the
2020
# repository root is the current directory.
21-
from system_tests import bigquery
22-
from system_tests import datastore
23-
from system_tests import pubsub
24-
from system_tests import storage
25-
from system_tests import system_test_utils
21+
import bigquery
22+
import datastore
23+
import pubsub
24+
import storage
25+
import system_test_utils
2626

2727

2828
REQUIREMENTS = {

tox.ini

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ commands =
77
nosetests
88
deps =
99
nose
10+
nose-exclude
1011
unittest2
1112
setenv =
1213
PYTHONPATH = {toxinidir}/_testing
1314
covercmd =
1415
nosetests \
15-
--ignore-files=run_system_test\.py \
16+
--exclude-dir=system_tests \
1617
--with-coverage \
1718
--cover-package=gcloud \
1819
--cover-erase \
@@ -84,21 +85,21 @@ passenv = {[testenv:system-tests]passenv}
8485
basepython =
8586
python2.7
8687
commands =
87-
python {toxinidir}/scripts/attempt_system_tests.py
88+
python {toxinidir}/system_tests/attempt_system_tests.py
8889
passenv = GOOGLE_* GCLOUD_* TRAVIS* encrypted_*
8990

9091
[testenv:system-tests3]
9192
basepython =
9293
python3.4
9394
commands =
94-
python {toxinidir}/scripts/attempt_system_tests.py
95+
python {toxinidir}/system_tests/attempt_system_tests.py
9596
passenv = {[testenv:system-tests]passenv}
9697

9798
[testenv:datastore-emulator]
9899
basepython =
99100
python2.7
100101
commands =
101-
python {toxinidir}/scripts/run_emulator.py --package=datastore
102+
python {toxinidir}/system_tests/run_emulator.py --package=datastore
102103
setenv =
103104
PYTHONPATH = {toxinidir}/_testing
104105
GCLOUD_NO_PRINT=true
@@ -110,6 +111,6 @@ deps =
110111
basepython =
111112
python2.7
112113
commands =
113-
python {toxinidir}/scripts/run_emulator.py --package=pubsub
114+
python {toxinidir}/system_tests/run_emulator.py --package=pubsub
114115
passenv = GCLOUD_*
115116
deps = {[testenv:datastore-emulator]deps}

0 commit comments

Comments
 (0)