Skip to content

Commit

Permalink
Moving all system test scripts in system_tests/.
Browse files Browse the repository at this point in the history
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 #1373.
  • Loading branch information
dhermes committed Feb 19, 2016
1 parent bc718d3 commit 8c1db22
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 33 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include README.rst
graft gcloud
global-exclude *.pyc
recursive-exclude system_tests *
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[nosetests]
ignore-files = run_system_test\.py
exclude-dir = system_tests

[bdist_wheel]
universal = 1
13 changes: 0 additions & 13 deletions system_tests/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import subprocess
import sys

from run_system_test import run_module_tests


MODULES = (
'datastore',
'storage',
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions system_tests/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion system_tests/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),)
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_emulator.py → system_tests/run_emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
10 changes: 5 additions & 5 deletions system_tests/run_system_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
11 changes: 6 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ commands =
nosetests
deps =
nose
nose-exclude
unittest2
setenv =
PYTHONPATH = {toxinidir}/_testing
covercmd =
nosetests \
--ignore-files=run_system_test\.py \
--exclude-dir=system_tests \
--with-coverage \
--cover-package=gcloud \
--cover-erase \
Expand Down Expand Up @@ -84,21 +85,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
Expand All @@ -110,6 +111,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}

0 comments on commit 8c1db22

Please sign in to comment.