Skip to content
Closed
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
093a6da
[WIP] CI shuffle.
Mar 7, 2017
710511e
Potential CI strategy in progress.
Mar 8, 2017
d5c8410
Move system test utils to test_utils
Mar 8, 2017
c3d3164
Migrate from tox to nox.
Mar 8, 2017
d602885
Oops
Mar 8, 2017
2e130d0
More updates
Mar 8, 2017
d9c8c49
Order nox sessions.
Mar 8, 2017
908806c
Move logging to new structure/testing.
Mar 8, 2017
d724b5f
Convert BigQuery to new CI structure.
Mar 9, 2017
3a7a90f
Migrating BigTable to new CI.
Mar 9, 2017
574dfda
Migrating datastore to new CI.
Mar 9, 2017
76eaee3
Migrating DNS to new CI.
Mar 9, 2017
5969e79
Migrating error reporting to new CI.
Mar 9, 2017
f71f56c
Migrating monitoring to new CI.
Mar 9, 2017
a3e8001
Migrating PubSub to new CI.
Mar 9, 2017
3e948e3
Migrating Resource Manager to new CI.
Mar 9, 2017
36d894c
Migrating runtimeconfig to new CI.
Mar 9, 2017
3752c96
Merge branch 'public-master' into ci
Mar 9, 2017
a6aa7bf
Migrating Spanner to new CI.
Mar 9, 2017
cac1f06
Migrating Speech to new CI.
Mar 9, 2017
54756a7
Migrating storage to new CI.
Mar 9, 2017
271ce29
Migrating Translate to new CI.
Mar 9, 2017
3653c86
Migrate Vision to new CI.
Mar 9, 2017
6455f74
Finish migrating core to new CI.
Mar 10, 2017
50e121e
Updating nox files; moving to CircleCI 2.0.
Mar 10, 2017
a96c53a
Theoretically working CircleCI 2.0 config, maybe.
Mar 10, 2017
3c08ab5
Add working directory to CircleCI.
Mar 10, 2017
42d7459
Get the GitHub ZIP right.
Mar 10, 2017
372baa5
CircleCI iteration.
Mar 13, 2017
75c3125
Merge branch 'public-master' into ci
Mar 13, 2017
90e8f2a
More CircleCI testing.
Mar 13, 2017
2d847b7
Trying a new code directory.
lukesneeringer Mar 13, 2017
99ac94a
More CI rekagiggering
Mar 13, 2017
4dd075c
Update Spanner's Noxfile.
lukesneeringer Mar 13, 2017
426aa63
Update Vision's Noxfile.
lukesneeringer Mar 13, 2017
2d17a41
Update Translate's Noxfile.
Mar 13, 2017
207dba4
Building docs, private GitHub push.
Mar 14, 2017
486c57a
Make update_docs.sh executable
Mar 14, 2017
5f7e9f0
Declare info better.
Mar 14, 2017
c4d455d
Fix YAML parse error.
Mar 14, 2017
d7e0217
Fix YAML parse error, round 2.
Mar 14, 2017
2ff2952
Switch to custom Docker image.
Mar 15, 2017
d99c894
New Docker image; some CI thrash.
Mar 15, 2017
a03fe83
Tweaking target package stuff.
Mar 15, 2017
a286ce3
Nox fix.
Mar 15, 2017
c1a7a1e
Merge branch 'public-master' into ci
Mar 15, 2017
50c8073
Move docs to nox.
Mar 15, 2017
ac5efaf
Put some parallelism back in. Really need dynamic parallelism.
Mar 15, 2017
8bc40a6
Fix nox files; remove parallelism again.
Mar 15, 2017
ff2bd3f
Fix minor docs issue.
Mar 15, 2017
e5945e6
Make APIs separate steps.
Mar 15, 2017
e9d3bad
Config file fix.
Mar 15, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
57 changes: 57 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
version: 2
jobs:
build:
docker:
- image: mrupgrade/deadsnakes:2.7
steps:
- run:
name: Update apt packages.
command: apt-get update -qq
- run:
name: Install apt dependencies.
command: apt-get install -y git python3.4 python3.5 python3.6
- run:
name: Install nox.
command: pip install nox-automation
- checkout
- run:
name: Decrypt credentials.
command: |
if [ -n "$GOOGLE_APPLICATION_CREDENTIALS" ]; then
openssl aes-256-cbc -d -a -k "$GOOGLE_CREDENTIALS_PASSPHRASE" \
-in /home/ubuntu/gcp/test_utils/credentials.json.enc \
-out "$GOOGLE_APPLICATION_CREDENTIALS"
else
echo "No credentials. System tests will not run."
fi
- run:
name: INFO - Declare target packages (changed packages and dependencies).
command: python test_utils/scripts/get_target_packages.py
- run:
name: Run tests for each API.
command: |
for TARGET in $(python test_utils/scripts/get_target_packages.py); do
nox -f $TARGET/nox.py
done
- run:
name: Push to google-cloud-python-private.
type: deploy
command: |
if [[ "$CIRCLE_BRANCH" == "master" ]] && \
[[ -z "$CIRCLE_PR_NUMBER" ]] && \
[[ -z "$CIRCLE_TAG" ]]; then
git remote add private [email protected]:GoogleCloudPlatform/google-cloud-python-private.git
git push private master
else
echo "Not on master; skipping private push."
fi
- run:
name: Update the docs.
type: deploy
command: |
pip install sphinx sphinx_rtd_theme
./test_utils/scripts/update_docs.sh


working_directory: /var/code/gcp/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pip-log.txt

# Unit test / coverage reports
.coverage
.nox
.tox
.cache

Expand Down
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions bigquery/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
exclude =
__pycache__,
.git,
*.pyc,
conf.py
6 changes: 6 additions & 0 deletions bigquery/google/cloud/bigquery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@
from google.cloud.bigquery.dataset import Dataset
from google.cloud.bigquery.schema import SchemaField
from google.cloud.bigquery.table import Table

__all__ = [
'__version__', 'AccessGrant', 'ArrayQueryParameter', 'Client',
'Dataset', 'ScalarQueryParameter', 'SchemaField', 'StructQueryParameter',
'Table',
]
90 changes: 90 additions & 0 deletions bigquery/nox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright 2016 Google Inc.
#
# 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.

import os

import nox


@nox.session
@nox.parametrize('python_version', ['2.7', '3.4', '3.5', '3.6'])
def unit_tests(session, python_version):
"""Run the unit test suite."""

# Run unit tests against all supported versions of Python.
session.interpreter = 'python%s' % python_version

# Install all test dependencies, then install this package in-place.
session.chdir(os.path.dirname(__file__))

This comment was marked as spam.

This comment was marked as spam.

session.install('mock', 'pytest', 'pytest-cov', '../core/')
session.install('-e', '.')

# Run py.test against the unit tests.
session.run('py.test', '--quiet',
'--cov=google.cloud.bigquery', '--cov=tests.unit', '--cov-append',
'--cov-config=.coveragerc', '--cov-report=', '--cov-fail-under=97',
'tests/unit',
)


@nox.session
@nox.parametrize('python_version', ['2.7', '3.6'])
def system_tests(session, python_version):
"""Run the system test suite."""

# Sanity check: Only run system tests if the environment variable is set.
if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):
return

# Run the system tests against latest Python 2 and Python 3 only.
session.interpreter = 'python%s' % python_version

# Install all test dependencies, then install this package into the
# virutalenv's dist-packages.
session.chdir(os.path.dirname(__file__))
session.install('mock', 'pytest',
'../core/', '../test_utils/',
'../storage/')
session.install('.')

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


@nox.session
def lint(session):
"""Run flake8.

Returns a failure if flake8 finds linting errors or sufficiently
serious code quality issues.
"""
session.interpreter = 'python3.6'
session.chdir(os.path.dirname(__file__))
session.install('flake8')
session.install('.')
session.run('flake8', 'google/cloud/bigquery')


@nox.session
def cover(session):
"""Run the final coverage report.

This outputs the coverage report aggregating coverage from the unit
test runs (not system test runs), and then erases coverage data.
"""
session.interpreter = 'python3.6'
session.chdir(os.path.dirname(__file__))
session.install('coverage', 'pytest-cov')
session.run('coverage', 'report', '--show-missing', '--fail-under=100')
session.run('coverage', 'erase')
Empty file added bigquery/tests/__init__.py
Empty file.
8 changes: 4 additions & 4 deletions system_tests/bigquery.py → bigquery/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
from google.cloud import bigquery
from google.cloud.exceptions import Forbidden

from retry import RetryErrors
from retry import RetryInstanceState
from retry import RetryResult
from system_test_utils import unique_resource_id
from test_utils.retry import RetryErrors
from test_utils.retry import RetryInstanceState
from test_utils.retry import RetryResult
from test_utils.system import unique_resource_id


def _has_rows(result):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 0 additions & 35 deletions bigquery/tox.ini

This file was deleted.

11 changes: 11 additions & 0 deletions bigtable/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
exclude =
# BigTable includes generated code in the manual layer;
# do not lint this.
google/cloud/bigtable/_generated/*.py,

# Standard linting exemptions.
__pycache__,
.git,
*.pyc,
conf.py
3 changes: 3 additions & 0 deletions bigtable/google/cloud/bigtable/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
__version__ = get_distribution('google-cloud-bigtable').version

from google.cloud.bigtable.client import Client


__all__ = ['__version__', 'Client']
89 changes: 89 additions & 0 deletions bigtable/nox.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright 2016 Google Inc.
#
# 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.

import os

import nox


@nox.session
@nox.parametrize('python_version', ['2.7', '3.4', '3.5', '3.6'])
def unit_tests(session, python_version):
"""Run the unit test suite."""

# Run unit tests against all supported versions of Python.
session.interpreter = 'python%s' % python_version

# Install all test dependencies, then install this package in-place.
session.chdir(os.path.dirname(__file__))
session.install('mock', 'pytest', 'pytest-cov', '../core/')
session.install('-e', '.')

# Run py.test against the unit tests.
session.run('py.test', '--quiet',
'--cov=google.cloud.bigtable', '--cov=tests.unit', '--cov-append',
'--cov-config=.coveragerc', '--cov-report=', '--cov-fail-under=97',

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

'tests/unit',
)


@nox.session
@nox.parametrize('python_version', ['2.7', '3.6'])
def system_tests(session, python_version):
"""Run the system test suite."""

# Sanity check: Only run system tests if the environment variable is set.
if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):
return

# Run the system tests against latest Python 2 and Python 3 only.
session.interpreter = 'python%s' % python_version

# Install all test dependencies, then install this package into the
# virutalenv's dist-packages.
session.chdir(os.path.dirname(__file__))
session.install('mock', 'pytest',
'../core/', '../test_utils/')
session.install('.')

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


@nox.session
def lint(session):
"""Run flake8.

Returns a failure if flake8 finds linting errors or sufficiently
serious code quality issues.
"""
session.interpreter = 'python3.6'
session.chdir(os.path.dirname(__file__))
session.install('flake8')
session.install('.')
session.run('flake8', 'google/cloud/bigtable')


@nox.session
def cover(session):
"""Run the final coverage report.

This outputs the coverage report aggregating coverage from the unit
test runs (not system test runs), and then erases coverage data.
"""
session.interpreter = 'python3.6'
session.chdir(os.path.dirname(__file__))
session.install('coverage', 'pytest-cov')
session.run('coverage', 'report', '--show-missing', '--fail-under=100')
session.run('coverage', 'erase')
Empty file added bigtable/tests/__init__.py
Empty file.
8 changes: 4 additions & 4 deletions system_tests/bigtable.py → bigtable/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
from google.cloud.bigtable.row_data import PartialRowData
from google.cloud.environment_vars import BIGTABLE_EMULATOR

from retry import RetryErrors
from retry import RetryResult
from system_test_utils import EmulatorCreds
from system_test_utils import unique_resource_id
from test_utils.retry import RetryErrors
from test_utils.retry import RetryResult
from test_utils.system import EmulatorCreds
from test_utils.system import unique_resource_id


LOCATION_ID = 'us-central1-c'
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def test_list_instances(self):
instance_pb2 as data_v2_pb2)
from google.cloud.bigtable._generated import (
bigtable_instance_admin_pb2 as messages_v2_pb2)
from unit_tests._testing import _FakeStub
from tests.unit._testing import _FakeStub

LOCATION = 'projects/' + self.PROJECT + '/locations/locname'
FAILED_LOCATION = 'FAILED'
Expand Down
Loading