Skip to content
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

test: E2E test on endpoint versions only #10441

Merged
merged 5 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AUTHORING_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ Add the new environment variables to the `envs` dictionary.
```py
TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion appengine/flexible/django_cloudsql/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# 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
Expand Down
2 changes: 1 addition & 1 deletion appengine/standard/noxfile-template.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

TEST_CONFIG = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
2 changes: 1 addition & 1 deletion appengine/standard_python3/django/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# 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
Expand Down
2 changes: 1 addition & 1 deletion asset/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
2 changes: 1 addition & 1 deletion bigquery-connection/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion bigquery-datatransfer/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
2 changes: 1 addition & 1 deletion bigquery-migration/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion bigquery/remote-function/document/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion bigquery/remote-function/translate/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion bigquery/remote-function/vision/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": False,
Expand Down
2 changes: 1 addition & 1 deletion cloud-media-livestream/keypublisher/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion cloud_scheduler/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion cloud_tasks/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion cloudbuild/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
# NOTE: We currently only run the test in Python 3.8.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion compute/auth/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion compute/encryption/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion contact-center-insights/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
# "enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion container/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion datalabeling/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# 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.
Expand Down
2 changes: 1 addition & 1 deletion dataproc/snippets/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7", "3.6"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
# "enforce_type_hints": True,
Expand Down
2 changes: 1 addition & 1 deletion dialogflow-cx/noxfile_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
"ignored_versions": ["2.7", "3.7", "3.9", "3.10"],
# 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
Expand Down
34 changes: 24 additions & 10 deletions dlp/snippets/deid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ def deidentify_table_bucketing(
def deidentify_table_primitive_bucketing(
project: str,
) -> None:
""" Uses the Data Loss Prevention API to de-identify sensitive data in
"""Uses the Data Loss Prevention API to de-identify sensitive data in
a table by replacing them with generalized bucket labels.
Args:
project: The Google Cloud project id to use as a parent resource.
Expand Down Expand Up @@ -1395,9 +1395,21 @@ def deidentify_table_primitive_bucketing(

# Construct generalised bucket configuration.
buckets_config = [
{"min_": {"integer_value": 0}, "max_": {"integer_value": 25}, "replacement_value": {"string_value": "Low"}},
{"min_": {"integer_value": 25}, "max_": {"integer_value": 75}, "replacement_value": {"string_value": "Medium"}},
{"min_": {"integer_value": 75}, "max_": {"integer_value": 100}, "replacement_value": {"string_value": "High"}},
{
"min_": {"integer_value": 0},
"max_": {"integer_value": 25},
"replacement_value": {"string_value": "Low"},
},
{
"min_": {"integer_value": 25},
"max_": {"integer_value": 75},
"replacement_value": {"string_value": "Medium"},
},
{
"min_": {"integer_value": 75},
"max_": {"integer_value": 100},
"replacement_value": {"string_value": "High"},
},
]

# Construct de-identify configuration that groups values in a table field and replace those with bucket labels.
Expand All @@ -1408,18 +1420,20 @@ def deidentify_table_primitive_bucketing(
"fields": [{"name": "happiness_score"}],
"primitive_transformation": {
"bucketing_config": {"buckets": buckets_config}
}
},
}
]
}
}

# Call the API to deidentify table data through primitive bucketing.
response = dlp.deidentify_content(request={
"parent": parent,
"deidentify_config": deidentify_config,
"item": item,
})
response = dlp.deidentify_content(
request={
"parent": parent,
"deidentify_config": deidentify_config,
"item": item,
}
)

# Print the results.
print("Table after de-identification: {}".format(response.item.table))
Expand Down
Loading