Skip to content

Commit

Permalink
maint: Add weekly GitHub action which runs tests against pre-release …
Browse files Browse the repository at this point in the history
…versions of dependencies (#61)
  • Loading branch information
binste authored Oct 20, 2024
1 parent 2997f2d commit dfdceac
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/weekly_test_against_prereleases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: weekly_test_against_prereleases

on:
schedule:
- cron: "0 10 * * 0"

jobs:
test-and-lint:
name: Run linters and tests ${{ matrix.python-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install latest prebuilds of packages
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]
python -m pip install --pre --upgrade dbt-core ibis-framework[duckdb]
- name: Run tests
run: |
python -m pytest tests
4 changes: 2 additions & 2 deletions dbt_ibis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ def main() -> None:
compile_ibis_to_sql(dbt_parse_arguments)
if dbt_subcommand != "precompile":
# Execute the actual dbt command
process = subprocess.run(
["dbt"] + sys.argv[1:], # noqa: S603
process = subprocess.run( # noqa: S603
["dbt"] + sys.argv[1:],
stdout=sys.stdout,
stderr=sys.stderr,
)
Expand Down
2 changes: 1 addition & 1 deletion dbt_ibis/_parse_dbt_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def disable_node_not_found_error() -> Iterator[None]:
"""
original_func = manifest.invalid_target_fail_unless_test

def _do_nothing(*args: Any, **kwargs: Any) -> None: # noqa: ARG001
def _do_nothing(*args: Any, **kwargs: Any) -> None:
pass

try:
Expand Down
12 changes: 6 additions & 6 deletions tests/test_dbt_ibis.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
TEST_IBIS_DIALECT: Final = IbisDialect("duckdb")


@pytest.fixture()
@pytest.fixture
def stg_orders_model_node():
return ModelNode(
name="stg_orders",
Expand All @@ -65,7 +65,7 @@ def stg_orders_model_node():
)


@pytest.fixture()
@pytest.fixture
def raw_payments_seed_node():
return SeedNode(
name="raw_payments",
Expand All @@ -83,7 +83,7 @@ def raw_payments_seed_node():
)


@pytest.fixture()
@pytest.fixture
def orders_source_definition():
return SourceDefinition(
name="orders",
Expand Down Expand Up @@ -111,7 +111,7 @@ def get_compiled_sql_files(project_dir: Path) -> list[Path]:
return list(project_dir.glob(f"models/**/{_IBIS_SQL_FOLDER_NAME}/*.sql"))


@pytest.fixture()
@pytest.fixture
def project_dir_and_database_file(monkeypatch) -> tuple[Path, Path]:
# Remove files which might exist from
# a previous test run which can happen if the tests are run locally, i.e.
Expand Down Expand Up @@ -524,8 +524,8 @@ def test_parse_cli_arguments(mocker):


def execute_command(cmd: list[str]) -> None:
process = subprocess.run(
cmd, # noqa: S603
process = subprocess.run( # noqa: S603
cmd,
stdout=sys.stdout,
stderr=sys.stderr,
)
Expand Down

0 comments on commit dfdceac

Please sign in to comment.