This repository was archived by the owner on Apr 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
chore(tests): system tests for autogen API #1151
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
68ad87d
tests: system tests for autogen API
gkevinzheng ebe730a
Fixed async system tests
gkevinzheng 5891cc7
addressed review feedback
gkevinzheng 4c78093
Fixed system test failure at the end of a test run
gkevinzheng f3fa1e9
Linting
gkevinzheng 648a1a1
more linting
gkevinzheng 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Empty file.
This file contains hidden or 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,36 @@ | ||
| import google.auth | ||
|
|
||
| import os | ||
| import pytest | ||
| import uuid | ||
|
|
||
|
|
||
| INSTANCE_PREFIX = "admin-overlay-instance" | ||
| BACKUP_PREFIX = "admin-overlay-backup" | ||
| ROW_PREFIX = "test-row" | ||
|
|
||
| DEFAULT_CLUSTER_LOCATIONS = ["us-east1-b"] | ||
| REPLICATION_CLUSTER_LOCATIONS = ["us-east1-b", "us-west1-b"] | ||
| TEST_TABLE_NAME = "system-test-table" | ||
| TEST_BACKUP_TABLE_NAME = "system-test-backup-table" | ||
| TEST_COLUMMN_FAMILY_NAME = "test-column" | ||
| TEST_COLUMN_NAME = "value" | ||
| NUM_ROWS = 500 | ||
| INITIAL_CELL_VALUE = "Hello" | ||
| NEW_CELL_VALUE = "World" | ||
|
|
||
|
|
||
| @pytest.fixture(scope="session") | ||
| def admin_overlay_project_id(): | ||
| _, default_project = google.auth.default() | ||
| yield os.getenv("ADMIN_TEST_PROJECT") or default_project | ||
|
|
||
|
|
||
| def generate_unique_suffix(name): | ||
| """ | ||
| Generates a unique suffix for the name. | ||
|
|
||
| Uses UUID4 because using time.time doesn't guarantee | ||
| uniqueness when the time is frozen in containers. | ||
| """ | ||
| return f"{name}-{uuid.uuid4().hex[:7]}" | ||
Oops, something went wrong.
Oops, something went wrong.
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.
You should check for GOOGLE_CLOUD_PROJECT, since that's the standard (and is used in the data client)
If you want, you can check for both, but if AMIN_TEST_PROJECT isn't set, it should fall back to the standard one