-
Notifications
You must be signed in to change notification settings - Fork 1.6k
CI rehash #3135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI rehash #3135
Changes from 41 commits
093a6da
710511e
d5c8410
c3d3164
d602885
2e130d0
d9c8c49
908806c
d724b5f
3a7a90f
574dfda
76eaee3
5969e79
f71f56c
a3e8001
3e948e3
36d894c
3752c96
a6aa7bf
cac1f06
54756a7
271ce29
3653c86
6455f74
50e121e
a96c53a
3c08ab5
42d7459
372baa5
75c3125
90e8f2a
2d847b7
99ac94a
4dd075c
426aa63
2d17a41
207dba4
486c57a
5f7e9f0
c4d455d
d7e0217
2ff2952
d99c894
a03fe83
a286ce3
c1a7a1e
50c8073
ac5efaf
8bc40a6
ff2bd3f
e5945e6
e9d3bad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ pip-log.txt | |
|
|
||
| # Unit test / coverage reports | ||
| .coverage | ||
| .nox | ||
| .tox | ||
| .cache | ||
|
|
||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [flake8] | ||
| exclude = | ||
| __pycache__, | ||
| .git, | ||
| *.pyc, | ||
| conf.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__)) | ||
| 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') | ||
This file was deleted.
| 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 |
| 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.
Sorry, something went wrong.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
Sorry, something went wrong. |
||
| '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') | ||
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.