Skip to content

Commit

Permalink
fixes more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfix committed Jan 27, 2023
1 parent 5372a72 commit ab2fc30
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test_dbt_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,25 @@ jobs:
run: poetry install --no-interaction -E postgres -E dbt

- run: |
poetry run pytest tests --ignore=tests/cli --ignore=tests/common --ignore=tests/normalize --ignore=tests/load -k '(not venv)'
poetry run pytest tests/dbt_runner -k '(not venv)'
if: runner.os != 'Windows'
name: Run dbt runner with venv - Linux/MAC
name: Run dbt runner - Linux/MAC
- run: |
poetry run pytest tests --ignore=tests/cli --ignore=tests/common --ignore=tests/normalize --ignore=tests/load -m "not forked" -k "(not venv)"
poetry run pytest tests/dbt_runner -k "(not venv)"
if: runner.os == 'Windows'
name: Run dbt runner with venv - Windows
name: Run dbt runner - Windows
shell: cmd
- name: Remove dbt-core
# install dlt with postgres support
run: poetry run pip uninstall dbt-core
run: poetry run pip uninstall dbt-core -y

- run: |
poetry run pytest tests --ignore=tests/cli --ignore=tests/common --ignore=tests/normalize --ignore=tests/load --ignore=tests/dbt_runner/local -k '(not local)'
poetry run pytest tests/dbt_runner --ignore=tests/dbt_runner/local -k '(not local)'
if: runner.os != 'Windows'
name: Run dbt runner with venv - Linux/MAC
- run: |
poetry run pytest tests --ignore=tests/cli --ignore=tests/common --ignore=tests/normalize --ignore=tests/load --ignore=tests/dbt_runner/local -m "not forked" -k "(not local)"
poetry run pytest tests/dbt_runner --ignore=tests/dbt_runner/local -m "not forked" -k "(not local)"
if: runner.os == 'Windows'
name: Run dbt runner with venv - Windows
shell: cmd
2 changes: 1 addition & 1 deletion tests/load/bigquery/test_bigquery_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_bigquery_job_errors(client: BigQueryClient, file_storage: FileStorage)

@pytest.mark.parametrize('location', ["US", "EU"])
def test_bigquery_location(location: str, file_storage: FileStorage) -> None:
with cm_yield_client_with_storage("bigquery", initial_values={"credentials": {"location": location}}) as client:
with cm_yield_client_with_storage("bigquery", default_config_values={"credentials": {"location": location}}) as client:
user_table_name = prepare_table(client)
load_json = {
"_dlt_id": uniq_id(),
Expand Down
8 changes: 4 additions & 4 deletions tests/load/test_client.py → tests/load/test_load_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,19 +387,19 @@ def test_retrieve_job(client: SqlJobClientBase, file_storage: FileStorage) -> No

@pytest.mark.parametrize('destination_name', ALL_DESTINATIONS)
def test_default_schema_name_init_storage(destination_name: str) -> None:
with cm_yield_client_with_storage(destination_name, initial_values={
with cm_yield_client_with_storage(destination_name, default_config_values={
"default_schema_name": "event" # pass the schema that is a default schema. that should create dataset with the name `dataset_name`
}) as client:
assert client.sql_client.dataset_name == client.config.dataset_name
assert client.sql_client.has_dataset()

with cm_yield_client_with_storage(destination_name, initial_values={
with cm_yield_client_with_storage(destination_name, default_config_values={
"default_schema_name": None # no default_schema. that should create dataset with the name `dataset_name`
}) as client:
assert client.sql_client.dataset_name == client.config.dataset_name
assert client.sql_client.has_dataset()

with cm_yield_client_with_storage(destination_name, initial_values={
with cm_yield_client_with_storage(destination_name, default_config_values={
"default_schema_name": "event_2" # the default schema is not event schema . that should create dataset with the name `dataset_name` with schema suffix
}) as client:
assert client.sql_client.dataset_name == client.config.dataset_name + "_event"
Expand Down Expand Up @@ -427,7 +427,7 @@ def _load_something(_client: SqlJobClientBase, expected_rows: int) -> None:
db_rows = list(_client.sql_client.execute_sql("SELECT * FROM event_user"))
assert len(db_rows) == expected_rows

with cm_yield_client_with_storage(destination_name, initial_values={"default_schema_name": None}) as client:
with cm_yield_client_with_storage(destination_name, default_config_values={"default_schema_name": None}) as client:
user_table = load_table("event_user")["event_user"]
client.schema.update_schema(new_table("event_user", columns=user_table.values()))
client.schema.bump_version()
Expand Down

0 comments on commit ab2fc30

Please sign in to comment.