This repository was archived by the owner on Mar 13, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
test: enable tests to run on kokoro #134
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
27f331e
test: get project from env var
skuruppu 8e87e1b
chore: remove RUN_SYSTEM_TEST env var
skuruppu a70169e
test: longer timeout for creating instances/dbs
skuruppu f4044bc
Update sqlalchemy_spanner.py
8ff6e43
Update requirements.py
bc6d945
Delete config.yml
a4db7f9
fix: refactored according to review feedback
skuruppu 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1 @@ | ||
| # Format: //devtools/kokoro/config/proto/build.proto | ||
|
|
||
| # Disable system tests. | ||
| env_vars: { | ||
| key: "RUN_SYSTEM_TESTS" | ||
| value: "false" | ||
| } |
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
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 |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| import configparser | ||
| from datetime import timezone | ||
| import decimal | ||
| import operator | ||
|
|
@@ -115,6 +116,24 @@ | |
| config.test_schema = "" | ||
|
|
||
|
|
||
| PROJECT = os.getenv( | ||
| "GOOGLE_CLOUD_PROJECT", os.getenv("PROJECT_ID", "emulator-test-project"), | ||
| ) | ||
| DB_URL = ( | ||
| f"spanner:///projects/{PROJECT}/instances/" | ||
| "sqlalchemy-dialect-test/databases/compliance-test" | ||
| ) | ||
|
|
||
|
|
||
| def get_db_url(): | ||
|
skuruppu marked this conversation as resolved.
Outdated
|
||
| config = configparser.ConfigParser() | ||
| if os.path.exists("test.cfg"): | ||
| config.read("test.cfg") | ||
| else: | ||
| config.read("setup.cfg") | ||
| return config.get("db", "default", fallback=DB_URL) | ||
|
|
||
|
|
||
| class EscapingTest(_EscapingTest): | ||
| @provide_metadata | ||
| def test_percent_sign_round_trip(self): | ||
|
|
@@ -678,7 +697,7 @@ def define_temp_tables(cls, metadata): | |
| Column("foo", sqlalchemy.INT), | ||
| sqlalchemy.Index("user_tmp_uq", "name", unique=True), | ||
| sqlalchemy.Index("user_tmp_ix", "foo"), | ||
| **kw | ||
| **kw, | ||
| ) | ||
| if ( | ||
| testing.requires.view_reflection.enabled | ||
|
|
@@ -1508,10 +1527,7 @@ class InterleavedTablesTest(fixtures.TestBase): | |
| """ | ||
|
|
||
| def setUp(self): | ||
| self._engine = create_engine( | ||
| "spanner:///projects/appdev-soda-spanner-staging/instances/" | ||
| "sqlalchemy-dialect-test/databases/compliance-test" | ||
| ) | ||
| self._engine = create_engine(get_db_url()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An argument could be made to make a base test class that sets up the engine and metadata that these other test classes inherit but I don't think it's necessary for this PR |
||
| self._metadata = MetaData(bind=self._engine) | ||
|
|
||
| def test_interleave(self): | ||
|
|
@@ -1560,10 +1576,7 @@ class UserAgentTest(fixtures.TestBase): | |
| """Check that SQLAlchemy dialect uses correct user agent.""" | ||
|
|
||
| def setUp(self): | ||
| self._engine = create_engine( | ||
| "spanner:///projects/appdev-soda-spanner-staging/instances/" | ||
| "sqlalchemy-dialect-test/databases/compliance-test" | ||
| ) | ||
| self._engine = create_engine(get_db_url()) | ||
| self._metadata = MetaData(bind=self._engine) | ||
|
|
||
| def test_user_agent(self): | ||
|
|
@@ -1583,10 +1596,7 @@ class ExecutionOptionsTest(fixtures.TestBase): | |
| """ | ||
|
|
||
| def setUp(self): | ||
| self._engine = create_engine( | ||
| "spanner:///projects/appdev-soda-spanner-staging/instances/" | ||
| "sqlalchemy-dialect-test/databases/compliance-test" | ||
| ) | ||
| self._engine = create_engine(get_db_url()) | ||
| self._metadata = MetaData(bind=self._engine) | ||
|
|
||
| self._table = Table( | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.