Skip to content

Commit

Permalink
Simplify noxfile setup. (GoogleCloudPlatform#2806)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency requests to v2.23.0

* Simplify noxfile and add version control.

* Configure appengine/standard to only test Python 2.7.

* Update Kokokro configs to match noxfile.

* Add requirements-test to each folder.

* Remove Py2 versions from everything execept appengine/standard.

* Remove conftest.py.

* Remove appengine/standard/conftest.py

* Remove 'no-sucess-flaky-report' from pytest.ini.

* Add GAE SDK back to appengine/standard tests.

* Fix typo.

* Roll pytest to python 2 version.

* Add a bunch of testing requirements.

* Remove typo.

* Add appengine lib directory back in.

* Add some additional requirements.

* Fix issue with flake8 args.

* Even more requirements.

* Readd appengine conftest.py.

* Add a few more requirements.

* Even more Appengine requirements.

* Add webtest for appengine/standard/mailgun.

* Add some additional requirements.

* Add workaround for issue with mailjet-rest.

* Add responses for appengine/standard/mailjet.

Co-authored-by: Renovate Bot <[email protected]>
  • Loading branch information
kurtisvg and renovate-bot authored Apr 2, 2020
1 parent 675b9ba commit 3397e6b
Show file tree
Hide file tree
Showing 245 changed files with 680 additions and 517 deletions.
2 changes: 1 addition & 1 deletion .kokoro/python2.7/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ action {
# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "gae"
value: "py-2.7"
}
2 changes: 1 addition & 1 deletion .kokoro/python3.6/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ action {
# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py3-3.6"
value: "py-3.6"
}
2 changes: 1 addition & 1 deletion .kokoro/python3.7/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ action {
# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py3-3.7"
value: "py-3.7"
}
45 changes: 45 additions & 0 deletions .kokoro/python3.8/common.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2019 Google LLC
#
# 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.

# Format: //devtools/kokoro/config/proto/build.proto

timeout_mins: 300

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
}

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-docs-samples/.kokoro/trampoline.sh"

# Download secrets from Cloud Storage.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"

# Copy results for Resultstore
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.8"
}
21 changes: 21 additions & 0 deletions .kokoro/python3.8/continuous.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 Google LLC
#
# 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.

# Format: //devtools/kokoro/config/proto/build.proto

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-docs-samples/.kokoro/tests/run_tests.sh"
}
21 changes: 21 additions & 0 deletions .kokoro/python3.8/periodic.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2020 Google LLC
#
# 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.

# Format: //devtools/kokoro/config/proto/build.proto

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-docs-samples/.kokoro/tests/run_tests.sh"
}
21 changes: 21 additions & 0 deletions .kokoro/python3.8/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2019 Google LLC
#
# 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.

# Format: //devtools/kokoro/config/proto/build.proto

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-docs-samples/.kokoro/tests/run_tests_only_diff.sh"
}
9 changes: 7 additions & 2 deletions .kokoro/tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ for file in **/requirements.txt; do

# If no local noxfile exists, copy the one from root
if [[ ! -f "noxfile.py" ]]; then
cp "$ROOT/noxfile-template.py" "./noxfile.py"
echo -e "\n Using noxfile from project root. \n"
PARENT_DIR=$(cd ../ && pwd)
while [[ "$PARENT_DIR" != "$ROOT" && ! -f "$PARENT_DIR/noxfile-template.py" ]];
do
PARENT_DIR=$(dirname "$PARENT_DIR")
done
cp "$PARENT_DIR/noxfile-template.py" "./noxfile.py"
echo -e "\n Using noxfile-template from parent folder ($PARENT_DIR). \n"
fi

# Use nox to execute the tests for the project.
Expand Down
2 changes: 2 additions & 0 deletions appengine/flexible/analytics/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==5.3.2
responses==0.10.12
2 changes: 1 addition & 1 deletion appengine/flexible/analytics/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==1.1.1
gunicorn==20.0.4
requests[security]==2.22.0
requests[security]==2.23.0
1 change: 1 addition & 0 deletions appengine/flexible/cloudsql/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/datastore/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/disk/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/django_cloudsql/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/extending_runtime/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/hello_world/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
2 changes: 2 additions & 0 deletions appengine/flexible/mailgun/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==5.3.2
responses==0.10.12
2 changes: 1 addition & 1 deletion appengine/flexible/mailgun/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==1.1.1
gunicorn==20.0.4
requests[security]==2.22.0
requests[security]==2.23.0
2 changes: 2 additions & 0 deletions appengine/flexible/mailjet/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==5.3.2
responses==0.10.12
2 changes: 1 addition & 1 deletion appengine/flexible/mailjet/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==1.1.1
gunicorn==20.0.4
requests[security]==2.22.0
requests[security]==2.23.0
mailjet-rest==1.3.3
1 change: 1 addition & 0 deletions appengine/flexible/memcache/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/metadata/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
2 changes: 1 addition & 1 deletion appengine/flexible/metadata/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==1.1.1
gunicorn==20.0.4
requests[security]==2.22.0
requests[security]==2.23.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==1.1.1
gunicorn==20.0.4
requests==2.22.0
requests==2.23.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==1.1.1
gunicorn==20.0.4
requests==2.22.0
requests==2.23.0
1 change: 1 addition & 0 deletions appengine/flexible/numpy/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/pubsub/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/redis/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/scipy/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
2 changes: 2 additions & 0 deletions appengine/flexible/sendgrid/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==5.3.2
mock==3.0.5
1 change: 1 addition & 0 deletions appengine/flexible/static_files/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/storage/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
1 change: 1 addition & 0 deletions appengine/flexible/tasks/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==5.3.2
2 changes: 2 additions & 0 deletions appengine/flexible/twilio/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==5.3.2
responses==0.10.12
3 changes: 3 additions & 0 deletions appengine/flexible/websockets/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==5.3.2
retrying==1.3.3
websocket-client==0.56.0
2 changes: 1 addition & 1 deletion appengine/flexible/websockets/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==1.1.1
Flask-Sockets==0.2.1
gunicorn==20.0.4
requests==2.22.0
requests==2.23.0
3 changes: 3 additions & 0 deletions appengine/standard/analytics/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
responses==0.10.12
2 changes: 1 addition & 1 deletion appengine/standard/analytics/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Flask==1.1.1
requests==2.22.0
requests==2.23.0
requests-toolbelt==0.9.1
3 changes: 3 additions & 0 deletions appengine/standard/blobstore/blobreader/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
WebTest==2.0.34
3 changes: 3 additions & 0 deletions appengine/standard/blobstore/gcs/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
WebTest==2.0.34
2 changes: 2 additions & 0 deletions appengine/standard/django/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
mock==3.0.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
mock==3.0.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
mock==3.0.5
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Flask==1.1.1
pyjwt==1.7.1
flask-cors==3.0.8
google-auth==1.11.2
requests==2.22.0
requests==2.23.0
requests-toolbelt==0.9.1
3 changes: 3 additions & 0 deletions appengine/standard/firebase/firetactoe/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
WebTest==2.0.34
2 changes: 1 addition & 1 deletion appengine/standard/firebase/firetactoe/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
flask==1.1.1
requests==2.22.0
requests==2.23.0
requests_toolbelt==0.9.1
oauth2client==4.1.3
functools32==3.2.3.post2; python_version < "3"
2 changes: 2 additions & 0 deletions appengine/standard/flask/tutorial/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
3 changes: 3 additions & 0 deletions appengine/standard/iap/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
WebTest==2.0.34
5 changes: 5 additions & 0 deletions appengine/standard/mailgun/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
google-api-python-client==1.7.11
mock==3.0.5
WebTest==2.0.34
3 changes: 3 additions & 0 deletions appengine/standard/mailjet/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
responses==0.10.12
2 changes: 1 addition & 1 deletion appengine/standard/mailjet/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==1.1.1
requests==2.22.0
requests==2.23.0
requests-toolbelt==0.9.1
mailjet-rest==1.3.3
2 changes: 2 additions & 0 deletions appengine/standard/ndb/transactions/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest==4.6.9
gcp-devrel-py-tools==0.0.15
Loading

0 comments on commit 3397e6b

Please sign in to comment.