Skip to content

Commit

Permalink
make default to fail if it can't run locally
Browse files Browse the repository at this point in the history
  • Loading branch information
buremba committed Jan 8, 2025
1 parent 731b89e commit b4dee88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ jobs:
env:
SNOWFLAKE_CONNECTIONS_BASE64: ${{ secrets.SNOWFLAKE_CONNECTIONS_BASE64 }}
run: |
rm /home/runner/.config/snowflake/connections.toml
export SNOWFLAKE_CONNECTIONS=$(echo $SNOWFLAKE_CONNECTIONS_BASE64 | base64 --decode)
poetry run pytest tests/integration/*
8 changes: 4 additions & 4 deletions tests/integration/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ def generate_select_statement_combos(table, schema = None, database = None):

class TestSelect:
def test_simple_select(self):
with universql_connection(warehouse="local()") as conn:
with universql_connection() as conn:
universql_result = execute_query(conn, SIMPLE_QUERY)
print(universql_result)

def test_from_stage(self):
with universql_connection(warehouse="local()") as conn:
with universql_connection() as conn:
universql_result = execute_query(conn, "select count(*) from @stage/iceberg_stage")
print(universql_result)

def test_complex_select(self):
with universql_connection(warehouse="local()") as conn:
with universql_connection() as conn:
universql_result = execute_query(conn, ALL_COLUMNS_QUERY)
print(universql_result)

def test_switch_schema(self):
with universql_connection(warehouse="local()") as conn:
with universql_connection() as conn:
execute_query(conn, "USE DATABASE snowflake")
universql_result = execute_query(conn, "SHOW SCHEMAS")
assert universql_result.num_rows > 0, f"The query did not return any rows!"
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class TestCreate:
def test_create_iceberg_table(self):
with universql_connection(warehouse="local()") as conn:
with universql_connection() as conn:
universql_result = execute_query(conn, f"""
CREATE OR REPLACE ICEBERG TABLE test_table
external_volume = iceberg_external_volume
Expand All @@ -16,7 +16,7 @@ def test_create_iceberg_table(self):
print(universql_result)

def test_create_temp_table(self):
with universql_connection(warehouse="local()") as conn:
with universql_connection() as conn:
execute_query(conn, f"CREATE TEMP TABLE test_table AS {SIMPLE_QUERY}")
execute_query(conn, "SELECT * FROM test_table")

Expand Down

0 comments on commit b4dee88

Please sign in to comment.