Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
  •  
  •  
  •  
138 changes: 138 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
version: 2
jobs:
build:
docker:
- image: googleapis/nox:0.10.0
steps:
- 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: Add GitHub public key to known hosts
command: |
mkdir -p ~/.ssh/
if [[ ! -f ~/.ssh/known_hosts ]] || ! grep "github.com" ~/.ssh/known_hosts; then
echo "
github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
" >> ~/.ssh/known_hosts
fi
- run:
name: INFO - Declare target packages (changed packages and dependencies).
command: |
python3.6 test_utils/scripts/get_target_packages.py > ~/target_packages
- run:
name: Run tests - google.cloud.core
command: |
if [[ -n $(grep core ~/target_packages) ]]; then
nox -f core/nox.py
fi
- run:
name: Run tests - google.cloud.bigquery
command: |
if [[ -n $(grep bigquery ~/target_packages) ]]; then
nox -f bigquery/nox.py
fi
- run:
name: Run tests - google.cloud.bigtable
command: |
if [[ -n $(grep bigtable ~/target_packages) ]]; then
nox -f bigtable/nox.py
fi
- run:
name: Run tests - google.cloud.datastore
command: |
if [[ -n $(grep datastore ~/target_packages) ]]; then
nox -f datastore/nox.py
fi
- run:
name: Run tests - google.cloud.dns
command: |
if [[ -n $(grep dns ~/target_packages) ]]; then
nox -f dns/nox.py
fi
- run:
name: Run tests - google.cloud.error_reporting
command: |
if [[ -n $(grep error_reporting ~/target_packages) ]]; then
nox -f error_reporting/nox.py
fi
- run:
name: Run tests - google.cloud.language
command: |
if [[ -n $(grep language ~/target_packages) ]]; then
nox -f language/nox.py
fi
- run:
name: Run tests - google.cloud.logging
command: |
if [[ -n $(grep logging ~/target_packages) ]]; then
nox -f logging/nox.py
fi
- run:
name: Run tests - google.cloud.monitoring
command: |
if [[ -n $(grep monitoring ~/target_packages) ]]; then
nox -f monitoring/nox.py
fi
- run:
name: Run tests - google.cloud.pubsub
command: |
if [[ -n $(grep pubsub ~/target_packages) ]]; then
nox -f pubsub/nox.py
fi
- run:
name: Run tests - google.cloud.resource_manager
command: |
if [[ -n $(grep resource_manager ~/target_packages) ]]; then
nox -f resource_manager/nox.py
fi
- run:
name: Run tests - google.cloud.runtimeconfig
command: |
if [[ -n $(grep runtimeconfig ~/target_packages) ]]; then
nox -f runtimeconfig/nox.py
fi
- run:
name: Run tests - google.cloud.spanner
command: |
if [[ -n $(grep spanner ~/target_packages) ]]; then
nox -f spanner/nox.py
fi
- run:
name: Run tests - google.cloud.speech
command: |
if [[ -n $(grep speech ~/target_packages) ]]; then
nox -f speech/nox.py
fi
- run:
name: Run tests - google.cloud.storage
command: |
if [[ -n $(grep storage ~/target_packages) ]]; then
nox -f storage/nox.py
fi
- run:
name: Run tests - google.cloud.translate
command: |
if [[ -n $(grep translate ~/target_packages) ]]; then
nox -f translate/nox.py
fi
- run:
name: Run tests - google.cloud.vision
command: |
if [[ -n $(grep vision ~/target_packages) ]]; then
nox -f vision/nox.py
fi
- run:
name: Update the docs
type: deploy
command: nox -e docs
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.realpath(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.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.realpath(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.realpath(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.realpath(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']
Loading