Skip to content

Commit

Permalink
debug 2
Browse files Browse the repository at this point in the history
  • Loading branch information
amofakhar committed Jul 18, 2024
1 parent 2892613 commit 37d853a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def test_resync_mariadb_to_sf_if_table_size_greater_than_limit(self): # pylint:

[return_code, _, _] = tasks.run_command(command)

with open(f'{CONFIG_DIR}/config.json', 'r', encoding='utf-8') as config_file:
aa = config_file.readlines()
for ii in aa:
print(ii)


assert return_code == 1

def test_resync_mariadb_to_sf_if_table_size_less_than_limit(self): # pylint: disable = no-self-use
Expand All @@ -49,10 +55,6 @@ def test_resync_mariadb_to_sf_if_table_size_less_than_limit(self): # pylint: di
command = f'pipelinewise sync_tables --tap {TAP_ID} --target {TARGET_ID}'
[return_code, _, _] = tasks.run_command(command)

with open(f'{CONFIG_DIR}/config.json', 'r', encoding='utf-8') as config_file:
a = config_file.readlines()
for i in a:
print(i)
assert return_code == 0

def test_resync_mariadb_to_sf_if_table_size_greater_than_limit_and_force(self): # pylint: disable = no-self-use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from tests.end_to_end.target_snowflake.tap_postgres import TapPostgres
from tests.end_to_end.helpers import tasks
from tests.end_to_end.target_snowflake import TEST_PROJECTS_DIR_PATH
from tests.end_to_end.target_snowflake import TEST_PROJECTS_DIR_PATH, CONFIG_DIR


TAP_ID = 'postgres_to_sf'
Expand Down Expand Up @@ -32,12 +32,16 @@ def tearDown(self):
def test_resync_pg_to_sf_if_table_size_greater_than_limit(self): # pylint: disable = no-self-use
"""test resync pg to SF returns error 1 if table size is greater than the limit"""

a_small_number = -1 # Mb
a_small_number = 0.001 # Mb
_create_ppw_config_file(table_mb=a_small_number)

command = f'pipelinewise sync_tables --tap {TAP_ID} --target {TARGET_ID}'

[return_code, _, _] = tasks.run_command(command)
with open(f'{CONFIG_DIR}/config.json', 'r', encoding='utf-8') as config_file:
aa = config_file.readlines()
for ii in aa:
print(ii)

assert return_code == 1

Expand All @@ -54,7 +58,7 @@ def test_resync_pg_to_sf_if_table_size_less_than_limit(self): # pylint: disabl
def test_resync_pg_to_sf_if_table_size_greater_than_limit_and_force(self): # pylint: disable = no-self-use

"""test resync pg to SF returns error if table size is greater than the limit and --force is used"""
a_small_number = -1 # Mb
a_small_number = 0.001 # Mb
_create_ppw_config_file(table_mb=a_small_number)

command = f'pipelinewise sync_tables --tap {TAP_ID} --target {TARGET_ID} --force'
Expand All @@ -65,7 +69,7 @@ def test_resync_pg_to_sf_if_table_size_greater_than_limit_and_force(self): # p

def test_run_tap_pg_to_sf_if_size_greater_than_limit(self): # pylint: disable = no-self-use
"""test run_tap postgres to sf if table size is greater than the limit"""
a_small_number = -1 # Mb
a_small_number = 0.001 # Mb
_create_ppw_config_file(table_mb=a_small_number)

command = f'pipelinewise run_tap --tap {TAP_ID} --target {TARGET_ID}'
Expand Down

0 comments on commit 37d853a

Please sign in to comment.