-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re-enable delta tests for read access
add rudimentary tests for destination configs fixes small problems in test setup
- Loading branch information
Showing
4 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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 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 @@ | ||
"""Tests for our test helpers""" |
Empty file.
This file contains 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,49 @@ | ||
# NOTE: these should be run with all destinations enabled | ||
# NOTE: these are very rudimentary tests, they should be extended | ||
|
||
from typing import Any | ||
|
||
from tests.load.utils import destinations_configs, DEFAULT_BUCKETS, DestinationTestConfiguration | ||
|
||
|
||
def test_empty_destinations_configs(): | ||
configs = destinations_configs() | ||
assert len(configs) == 0 | ||
|
||
|
||
def _assert_name_uniqueness(configs: Any) -> None: | ||
identifiers = [config[0][0].name for config in configs] | ||
print(identifiers) | ||
assert len(identifiers) == len(set(identifiers)), "Identifier uniqueness violated" | ||
|
||
|
||
def test_enable_filesystem_configs(): | ||
# enable local filesystem configs | ||
configs = destinations_configs(local_filesystem_configs=True) | ||
_assert_name_uniqueness(configs) | ||
assert len(configs) == 3 | ||
|
||
# enable all buckets configs | ||
configs = destinations_configs(all_buckets_filesystem_configs=True) | ||
_assert_name_uniqueness(configs) | ||
assert len(configs) == len(DEFAULT_BUCKETS) == 7 # hardcoded for now | ||
|
||
# enable with delta tables | ||
configs = destinations_configs( | ||
all_buckets_filesystem_configs=True, table_format_filesystem_configs=True | ||
) | ||
_assert_name_uniqueness(configs) | ||
assert ( | ||
len(configs) == len(DEFAULT_BUCKETS) * 2 == 7 * 2 | ||
) # we have delta now, so double the expected amount | ||
|
||
|
||
def test_uniqueness_of_names(): | ||
configs = destinations_configs( | ||
default_sql_configs=True, | ||
default_vector_configs=True, | ||
default_staging_configs=True, | ||
all_staging_configs=True, | ||
all_buckets_filesystem_configs=True, | ||
) | ||
_assert_name_uniqueness(configs) |