Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit f5790a9

Browse files
ikuleshovparthea
andauthored
ci: update test configuration (#129)
* update test configuration * remove custom noxfile configs for now * remove MaximumUserAccess rom sample * add comment in noxfile_config.py * run blacken session * lint * add pytest * Update noxfile_config.py * Update noxfile_config.py * delete enhanced measurement settings samples as this functionality is no longer supported in v1alpha * fix the samples tests * do not use the `maximum_user_access` field and `update` operation in properties.firebase_links tests as this is no longer supported in v1alpha * use `creator_email_address` instead of `email_address` field in properties.google_ads_links_list() test as the field has been renamed in v1alpha * fix the samples test Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent c91f2ce commit f5790a9

16 files changed

Lines changed: 30 additions & 349 deletions

samples/noxfile_config.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
TEST_CONFIG_OVERRIDE = {
2-
# You can opt out from the test for specific Python versions.
3-
"ignored_versions": ["2.7"],
4-
# Old samples are opted out of enforcing Python type hints
5-
# All new samples should feature them
6-
"enforce_type_hints": True,
72
# An envvar key for determining the project id to use. Change it
83
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
94
# build specific Cloud project. You can also use your own string
105
# to use your own Cloud project.
11-
"gcloud_project_env": "GOOGLE_CLOUD_PROJECT",
6+
"gcloud_project_env": "BUILD_SPECIFIC_GCLOUD_PROJECT",
127
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
138
# A dictionary you want to inject into your test. Don't put any
149
# secrets here. These values will override predefined values.
1510
"envs": {
16-
"GA_TEST_PROPERTY_ID": "222596558",
17-
"GA_TEST_ACCOUNT_ID": "123",
18-
"GA_TEST_USER_LINK_ID": "123",
19-
"GA_TEST_ANDROID_APP_DATA_STREAM_ID": "123",
20-
"GA_TEST_IOS_APP_DATA_STREAM_ID": "123",
21-
"GA_TEST_WEB_DATA_STREAM_ID": "123",
11+
"GA_TEST_PROPERTY_ID": "276206997",
12+
"GA_TEST_ACCOUNT_ID": "199820965",
13+
"GA_TEST_USER_LINK_ID": "103401743041912607932",
14+
"GA_TEST_PROPERTY_USER_LINK_ID": "105231969274497648555",
15+
"GA_TEST_ANDROID_APP_DATA_STREAM_ID": "2828100949",
16+
"GA_TEST_IOS_APP_DATA_STREAM_ID": "2828089289",
17+
"GA_TEST_WEB_DATA_STREAM_ID": "2828068992",
2218
},
2319
}

samples/properties_firebase_links_create.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ def create_firebase_link(property_id, firebase_project_id):
4949
client = AnalyticsAdminServiceClient()
5050
firebase_link = client.create_firebase_link(
5151
parent=f"properties/{property_id}",
52-
firebase_link=FirebaseLink(
53-
project=f"projects/{firebase_project_id}",
54-
maximum_user_access="READ_AND_ANALYZE",
55-
),
52+
firebase_link=FirebaseLink(project=f"projects/{firebase_project_id}"),
5653
)
5754

5855
print("Result:")

samples/properties_firebase_links_list.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"""
2323
# [START analyticsadmin_properties_firebase_links_list]
2424
from google.analytics.admin import AnalyticsAdminServiceClient
25-
from google.analytics.admin_v1alpha.types import MaximumUserAccess
2625

2726

2827
def run_sample():
@@ -49,10 +48,6 @@ def print_firebase_link(firebase_link):
4948
"""Prints the Firebase link details."""
5049
print(f"Resource name: {firebase_link.name}")
5150
print(f"Firebase project: {firebase_link.project}")
52-
print(
53-
f"Maximum user access to the GA4 property: "
54-
f"{MaximumUserAccess(firebase_link.maximum_user_access).name}"
55-
)
5651
print(f"Create time: {firebase_link.create_time}")
5752

5853

samples/properties_firebase_links_update.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

samples/properties_firebase_links_update_test.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

samples/properties_google_ads_links_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def print_google_ads_link(google_ads_link):
5050
print(f"Google Ads customer ID: {google_ads_link.customer_id}")
5151
print(f"Can manage clients: {google_ads_link.can_manage_clients}")
5252
print(f"Ads personalization enabled: {google_ads_link.ads_personalization_enabled}")
53-
print(f"Email address of the link creator: {google_ads_link.email_address}")
53+
print(f"Email address of the link creator: {google_ads_link.creator_email_address}")
5454
print(f"Create time: {google_ads_link.create_time}")
5555
print(f"Update time: {google_ads_link.update_time}")
5656

samples/properties_google_ads_links_list_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
TEST_PROPERTY_ID = os.getenv("GA_TEST_PROPERTY_ID")
2020

2121

22-
def test_properties_firebase_links_list(capsys):
22+
def test_properties_google_ads_links_list(capsys):
2323
properties_google_ads_links_list.list_google_ads_links(TEST_PROPERTY_ID)
2424
out, _ = capsys.readouterr()
2525
assert "Result" in out

samples/properties_ios_app_data_streams_get.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def print_ios_app_data_stream(ios_app_data_stream):
5353
print(f"Resource name: {ios_app_data_stream.name}")
5454
print(f"Display name: {ios_app_data_stream.display_name}")
5555
print(f"Firebase app ID: {ios_app_data_stream.firebase_app_id}")
56-
print(f"Bundle ID: {ios_app_data_stream.bundleId}")
56+
print(f"Bundle ID: {ios_app_data_stream.bundle_id}")
5757
print(f"Create time: {ios_app_data_stream.create_time}")
5858
print(f"Update time: {ios_app_data_stream.update_time}")
5959

samples/properties_user_links_batch_get_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import properties_user_links_batch_get
1818

1919
TEST_PROPERTY_ID = os.getenv("GA_TEST_PROPERTY_ID")
20-
TEST_USER_LINK_ID = os.getenv("GA_USER_LINK_ID")
20+
TEST_USER_LINK_ID = os.getenv("GA_TEST_PROPERTY_USER_LINK_ID")
2121

2222

2323
def test_properties_user_links_batch_get(capsys):

samples/properties_user_links_get_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import properties_user_links_get
1818

1919
TEST_PROPERTY_ID = os.getenv("GA_TEST_PROPERTY_ID")
20-
TEST_USER_LINK_ID = os.getenv("GA_USER_LINK_ID")
20+
TEST_USER_LINK_ID = os.getenv("GA_TEST_PROPERTY_USER_LINK_ID")
2121

2222

2323
def test_properties_user_links_get(capsys):

0 commit comments

Comments
 (0)