-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
testing: multi project noxfile-template.py #3700
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
7c1786c
testing: prototpe for multi project noxfile.py
eebf78f
correct project names
d723b7d
introduce TEST_CONFIG
1dc0332
modify noxfile-template, add default config
6ad4328
changed how we import user config
fd7412a
fix stale comments
308454b
use different project for python 3.6 and 3.7
e23b853
fix a bug
c2861c6
changed the filename
488c0aa
add BUILD_SPECIFIC_GCLOUD_PROJECT
9804c20
use session.skip
850abe7
print debuggin
a9418b6
more print debuggin
46dadd3
adding cwd to sys.path
f0c2761
removed debug print, display details of ImportError
16e95d9
use the usual test project
a2684bc
stop setting gcloud project
e754a2a
simplified the noxfile-template
484a02f
Merge branch 'master' into multi-proj
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# 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. | ||
|
||
# Default TEST_CONFIG_OVERRIDE for python repos. | ||
|
||
# You can copy this file into your directory, then it will be inported from | ||
# the noxfile.py. | ||
|
||
# The source of truth: | ||
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py | ||
|
||
TEST_CONFIG_OVERRIDE = { | ||
# You can opt out from the test for specific Python versions. | ||
'ignored_versions': ["2.7"], | ||
|
||
# Declare optional test sessions you want to opt-in. Currently we | ||
# have the following optional test sessions: | ||
# 'cloud_run' # Test session for Cloud Run application. | ||
'opt_in_sessions': [], | ||
|
||
# An envvar key for determining the project id to use. Change it | ||
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a | ||
# build specific Cloud project. You can also use your own string | ||
# to use your own Cloud project. | ||
# 'gcloud_project_env': 'GCLOUD_PROJECT', | ||
'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', | ||
|
||
# A dictionary you want to inject into your test. Don't put any | ||
# secrets here. These values will override predefined values. | ||
'envs': {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# 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. | ||
|
||
# Default TEST_CONFIG_OVERRIDE for python repos. | ||
|
||
# You can copy this file into your directory, then it will be inported from | ||
# the noxfile.py. | ||
|
||
# The source of truth: | ||
# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py | ||
|
||
TEST_CONFIG_OVERRIDE = { | ||
# You can opt out from the test for specific Python versions. | ||
'ignored_versions': ["2.7"], | ||
|
||
# Declare optional test sessions you want to opt-in. Currently we | ||
# have the following optional test sessions: | ||
# 'cloud_run' # Test session for Cloud Run application. | ||
'opt_in_sessions': [], | ||
|
||
# An envvar key for determining the project id to use. Change it | ||
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a | ||
# build specific Cloud project. You can also use your own string | ||
# to use your own Cloud project. | ||
'gcloud_project_env': 'GCLOUD_PROJECT', | ||
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', | ||
|
||
# A dictionary you want to inject into your test. Don't put any | ||
# secrets here. These values will override predefined values. | ||
'envs': {}, | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: IMO, I don't think we should let style checks be configurable, but we can discuss on the next sync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree in general, but it's required for the cloud-run case.
Example:
The lint session for the parent my_proj will report that
import main
is in the wrong place because it doesn't recognize the local import files correctly.So in this case having following
pytest.ini
is the cleanest solution IMO:This file allows to skip subdirectories both for pytest and flake8.