Skip to content

Commit

Permalink
Add "offline" positional argument to system tests
Browse files Browse the repository at this point in the history
This is a temporary measure for offline testing of certain libraries.
  • Loading branch information
bmccutchon committed Sep 14, 2018
1 parent 1364a39 commit 58ae3b7
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 72 deletions.
33 changes: 17 additions & 16 deletions bigquery/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,23 @@ def system(session, py):
# Set the virtualenv dirname.
session.virtualenv_dirname = 'sys-' + py

# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install local packages in place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', os.path.join('..', 'storage'))
session.install('-e', os.path.join('..', 'test_utils'))
session.install('-e', '.[pandas]')

# IPython does not support Python 2 after version 5.x
if session.interpreter == 'python2.7':
session.install('ipython==5.5')
else:
session.install('ipython')
if 'offline' not in session.posargs:
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install local packages in place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', os.path.join('..', 'storage'))
session.install('-e', os.path.join('..', 'test_utils'))
session.install('-e', '.[pandas]')

# IPython does not support Python 2 after version 5.x
if session.interpreter == 'python2.7':
session.install('ipython==5.5')
else:
session.install('ipython')

# Run py.test against the system tests.
session.run(
Expand Down
22 changes: 11 additions & 11 deletions bigtable/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def unit(session, py):

default(session)


@nox.session
@nox.parametrize('py', ['2.7', '3.6'])
def system(session, py):
Expand All @@ -83,16 +82,17 @@ def system(session, py):
# Set the virtualenv dirname.
session.virtualenv_dirname = 'sys-' + py

# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')
if 'offline' not in session.posargs:
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
session.run('py.test', '--quiet', 'tests/system.py', *session.posargs)
Expand Down
9 changes: 5 additions & 4 deletions dataproc/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ def system(session, py):

session.virtualenv_dirname = 'sys-' + py

# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')
if 'offline' not in session.posargs:
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

session.install('pytest')
session.install('-e', '.')
session.install('pytest')
session.install('-e', '.')

session.run('py.test', '--quiet', os.path.join('tests', 'system'),
*session.posargs)
Expand Down
35 changes: 18 additions & 17 deletions logging/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,24 @@ def system(session, py):
# Set the virtualenv dirname.
session.virtualenv_dirname = 'sys-' + py

# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
systest_deps = [
'../bigquery/',
'../pubsub/',
'../storage/',
'../test_utils/',
]
for systest_dep in systest_deps:
session.install('-e', systest_dep)
session.install('-e', '.')
if 'offline' not in session.posargs:
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
systest_deps = [
'../bigquery/',
'../pubsub/',
'../storage/',
'../test_utils/',
]
for systest_dep in systest_deps:
session.install('-e', systest_dep)
session.install('-e', '.')

# Run py.test against the system tests.
session.run(
Expand Down
19 changes: 10 additions & 9 deletions pubsub/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ def system(session, py):
# Set the virtualenv dirname.
session.virtualenv_dirname = 'sys-' + py

# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')
if 'offline' not in session.posargs:
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
session.run(
Expand Down
31 changes: 16 additions & 15 deletions storage/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,22 @@ def system(session, py):
# Set the virtualenv dirname.
session.virtualenv_dirname = 'sys-' + py

# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
systest_deps = [
'../test_utils/',
'../pubsub',
'../kms',
]
for systest_dep in systest_deps:
session.install('-e', systest_dep)
session.install('-e', '.')
if 'offline' not in session.posargs:
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
systest_deps = [
'../test_utils/',
'../pubsub',
'../kms',
]
for systest_dep in systest_deps:
session.install('-e', systest_dep)
session.install('-e', '.')

# Run py.test against the system tests.
session.run('py.test', '--quiet', 'tests/system.py', *session.posargs)
Expand Down

0 comments on commit 58ae3b7

Please sign in to comment.