|
25 | 25 | N_THREADS, |
26 | 26 | BENCHMARK, |
27 | 27 | GIT_REVISION, |
| 28 | + TEST_ACROSS_ALL_DBS, |
28 | 29 | get_conn, |
29 | 30 | random_table_suffix, |
30 | 31 | ) |
@@ -418,22 +419,42 @@ def __iter__(self): |
418 | 419 | "uuid": UUID_Faker(N_SAMPLES), |
419 | 420 | } |
420 | 421 |
|
| 422 | + |
| 423 | +def _get_test_db_pairs(): |
| 424 | + if str(TEST_ACROSS_ALL_DBS).lower() == "full": |
| 425 | + for source_db in DATABASE_TYPES: |
| 426 | + for target_db in DATABASE_TYPES: |
| 427 | + yield source_db, target_db |
| 428 | + elif int(TEST_ACROSS_ALL_DBS): |
| 429 | + for db_cls in DATABASE_TYPES: |
| 430 | + yield db_cls, db.PostgreSQL |
| 431 | + yield db.PostgreSQL, db_cls |
| 432 | + yield db_cls, db.Snowflake |
| 433 | + yield db.Snowflake, db_cls |
| 434 | + else: |
| 435 | + yield db.PostgreSQL, db.PostgreSQL |
| 436 | + |
| 437 | + |
| 438 | +def get_test_db_pairs(): |
| 439 | + active_pairs = {(db1, db2) for db1, db2 in _get_test_db_pairs() if db1 in CONN_STRINGS and db2 in CONN_STRINGS} |
| 440 | + for db1, db2 in active_pairs: |
| 441 | + yield db1, DATABASE_TYPES[db1], db2, DATABASE_TYPES[db2] |
| 442 | + |
| 443 | + |
421 | 444 | type_pairs = [] |
422 | | -for source_db, source_type_categories in DATABASE_TYPES.items(): |
423 | | - for target_db, target_type_categories in DATABASE_TYPES.items(): |
424 | | - if CONN_STRINGS.get(source_db, False) and CONN_STRINGS.get(target_db, False): |
425 | | - for type_category, source_types in source_type_categories.items(): # int, datetime, .. |
426 | | - for source_type in source_types: |
427 | | - for target_type in target_type_categories[type_category]: |
428 | | - type_pairs.append( |
429 | | - ( |
430 | | - source_db, |
431 | | - target_db, |
432 | | - source_type, |
433 | | - target_type, |
434 | | - type_category, |
435 | | - ) |
436 | | - ) |
| 445 | +for source_db, source_type_categories, target_db, target_type_categories in get_test_db_pairs(): |
| 446 | + for type_category, source_types in source_type_categories.items(): # int, datetime, .. |
| 447 | + for source_type in source_types: |
| 448 | + for target_type in target_type_categories[type_category]: |
| 449 | + type_pairs.append( |
| 450 | + ( |
| 451 | + source_db, |
| 452 | + target_db, |
| 453 | + source_type, |
| 454 | + target_type, |
| 455 | + type_category, |
| 456 | + ) |
| 457 | + ) |
437 | 458 |
|
438 | 459 |
|
439 | 460 | def sanitize(name): |
|
0 commit comments