-
Notifications
You must be signed in to change notification settings - Fork 11
fix: databases.get_many function, add integration test for it #105
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1024b9e
fix databases.get_many function, add integration test for it
yuryfirebolt d196713
Merge branch 'main' into fix-databases-get-many
yuryfirebolt 63ef3ee
add a unit test for databases.get_many
yuryfirebolt 1464798
Merge branch 'main' into fix-databases-get-many
yuryfirebolt 9c3c131
Merge branch 'fix-databases-get-many' of github.com:firebolt-db/fireb…
yuryfirebolt 83d7aeb
add a unit test for databases.get_many
yuryfirebolt 73f845e
extend get_many integration tests
yuryfirebolt 82834f9
Merge branch 'main' into fix-databases-get-many
yuryfirebolt 530a2e8
Merge branch 'main' into fix-databases-get-many
yuryfirebolt 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| from logging import getLogger | ||
| from os import environ | ||
|
|
||
| from pytest import fixture | ||
|
|
||
| from firebolt.service.manager import Settings | ||
|
|
||
| LOGGER = getLogger(__name__) | ||
|
|
||
| ENGINE_URL_ENV = "ENGINE_URL" | ||
| ENGINE_NAME_ENV = "ENGINE_NAME" | ||
| STOPPED_ENGINE_URL_ENV = "STOPPED_ENGINE_URL" | ||
| STOPPED_ENGINE_NAME_ENV = "STOPPED_ENGINE_NAME" | ||
| DATABASE_NAME_ENV = "DATABASE_NAME" | ||
| USER_NAME_ENV = "USER_NAME" | ||
| PASSWORD_ENV = "PASSWORD" | ||
| ACCOUNT_NAME_ENV = "ACCOUNT_NAME" | ||
| API_ENDPOINT_ENV = "API_ENDPOINT" | ||
|
|
||
|
|
||
| def must_env(var_name: str) -> str: | ||
| assert var_name in environ, f"Expected {var_name} to be provided in environment" | ||
| LOGGER.info(f"{var_name}: {environ[var_name]}") | ||
| return environ[var_name] | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def rm_settings(api_endpoint, username, password) -> Settings: | ||
| return Settings( | ||
| server=api_endpoint, | ||
| user=username, | ||
| password=password, | ||
| default_region="us-east-1", | ||
| ) | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def engine_url() -> str: | ||
| return must_env(ENGINE_URL_ENV) | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def stopped_engine_url() -> str: | ||
| return must_env(STOPPED_ENGINE_URL_ENV) | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def engine_name() -> str: | ||
| return must_env(ENGINE_NAME_ENV) | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def stopped_engine_name() -> str: | ||
| return must_env(STOPPED_ENGINE_URL_ENV) | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def database_name() -> str: | ||
| return must_env(DATABASE_NAME_ENV) | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def username() -> str: | ||
| return must_env(USER_NAME_ENV) | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def password() -> str: | ||
| return must_env(PASSWORD_ENV) | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def account_name() -> str: | ||
| return must_env(ACCOUNT_NAME_ENV) | ||
|
|
||
|
|
||
| @fixture(scope="session") | ||
| def api_endpoint() -> str: | ||
| return must_env(API_ENDPOINT_ENV) |
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
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.
Please also test passing
attached_engine_name_eqandattached_engine_name_containssince we know it has engines.Also, do you think we can test
order_by?We can just see how many databases there are from the first call, and if it's more that one we also try passing
order_byThere 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.
Added tests for
attached_engine_name_eqandattached_engine_name_contains. However, I would not do additional tests onorder_by, since it looks likes we are re-implementing order_by functionality in the testThere 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.
We can still do some basic checks on
order_bywithout re-implementing the functionality. e.g. checking that the parameter is propagated correctly and is added to the http request.