Skip to content

Commit

Permalink
ci: update test configuration (#129)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
ikuleshov and parthea authored Oct 5, 2021
1 parent 20fc3e8 commit 667c6b3
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 349 deletions.
20 changes: 8 additions & 12 deletions packages/google-analytics-admin/samples/noxfile_config.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
TEST_CONFIG_OVERRIDE = {
# You can opt out from the test for specific Python versions.
"ignored_versions": ["2.7"],
# Old samples are opted out of enforcing Python type hints
# All new samples should feature them
"enforce_type_hints": True,
# 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": "GOOGLE_CLOUD_PROJECT",
"gcloud_project_env": "BUILD_SPECIFIC_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": {
"GA_TEST_PROPERTY_ID": "222596558",
"GA_TEST_ACCOUNT_ID": "123",
"GA_TEST_USER_LINK_ID": "123",
"GA_TEST_ANDROID_APP_DATA_STREAM_ID": "123",
"GA_TEST_IOS_APP_DATA_STREAM_ID": "123",
"GA_TEST_WEB_DATA_STREAM_ID": "123",
"GA_TEST_PROPERTY_ID": "276206997",
"GA_TEST_ACCOUNT_ID": "199820965",
"GA_TEST_USER_LINK_ID": "103401743041912607932",
"GA_TEST_PROPERTY_USER_LINK_ID": "105231969274497648555",
"GA_TEST_ANDROID_APP_DATA_STREAM_ID": "2828100949",
"GA_TEST_IOS_APP_DATA_STREAM_ID": "2828089289",
"GA_TEST_WEB_DATA_STREAM_ID": "2828068992",
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ def create_firebase_link(property_id, firebase_project_id):
client = AnalyticsAdminServiceClient()
firebase_link = client.create_firebase_link(
parent=f"properties/{property_id}",
firebase_link=FirebaseLink(
project=f"projects/{firebase_project_id}",
maximum_user_access="READ_AND_ANALYZE",
),
firebase_link=FirebaseLink(project=f"projects/{firebase_project_id}"),
)

print("Result:")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""
# [START analyticsadmin_properties_firebase_links_list]
from google.analytics.admin import AnalyticsAdminServiceClient
from google.analytics.admin_v1alpha.types import MaximumUserAccess


def run_sample():
Expand All @@ -49,10 +48,6 @@ def print_firebase_link(firebase_link):
"""Prints the Firebase link details."""
print(f"Resource name: {firebase_link.name}")
print(f"Firebase project: {firebase_link.project}")
print(
f"Maximum user access to the GA4 property: "
f"{MaximumUserAccess(firebase_link.maximum_user_access).name}"
)
print(f"Create time: {firebase_link.create_time}")


Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def print_google_ads_link(google_ads_link):
print(f"Google Ads customer ID: {google_ads_link.customer_id}")
print(f"Can manage clients: {google_ads_link.can_manage_clients}")
print(f"Ads personalization enabled: {google_ads_link.ads_personalization_enabled}")
print(f"Email address of the link creator: {google_ads_link.email_address}")
print(f"Email address of the link creator: {google_ads_link.creator_email_address}")
print(f"Create time: {google_ads_link.create_time}")
print(f"Update time: {google_ads_link.update_time}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
TEST_PROPERTY_ID = os.getenv("GA_TEST_PROPERTY_ID")


def test_properties_firebase_links_list(capsys):
def test_properties_google_ads_links_list(capsys):
properties_google_ads_links_list.list_google_ads_links(TEST_PROPERTY_ID)
out, _ = capsys.readouterr()
assert "Result" in out
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def print_ios_app_data_stream(ios_app_data_stream):
print(f"Resource name: {ios_app_data_stream.name}")
print(f"Display name: {ios_app_data_stream.display_name}")
print(f"Firebase app ID: {ios_app_data_stream.firebase_app_id}")
print(f"Bundle ID: {ios_app_data_stream.bundleId}")
print(f"Bundle ID: {ios_app_data_stream.bundle_id}")
print(f"Create time: {ios_app_data_stream.create_time}")
print(f"Update time: {ios_app_data_stream.update_time}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import properties_user_links_batch_get

TEST_PROPERTY_ID = os.getenv("GA_TEST_PROPERTY_ID")
TEST_USER_LINK_ID = os.getenv("GA_USER_LINK_ID")
TEST_USER_LINK_ID = os.getenv("GA_TEST_PROPERTY_USER_LINK_ID")


def test_properties_user_links_batch_get(capsys):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import properties_user_links_get

TEST_PROPERTY_ID = os.getenv("GA_TEST_PROPERTY_ID")
TEST_USER_LINK_ID = os.getenv("GA_USER_LINK_ID")
TEST_USER_LINK_ID = os.getenv("GA_TEST_PROPERTY_USER_LINK_ID")


def test_properties_user_links_get(capsys):
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 667c6b3

Please sign in to comment.