From fc2b3b8c3f80efc4bf5864b186944c6150ed9845 Mon Sep 17 00:00:00 2001 From: tdhooghe Date: Mon, 21 Oct 2024 17:57:14 +0200 Subject: [PATCH] update testing documentation Signed-off-by: tdhooghe --- .github/workflows/kedro-datasets.yml | 2 +- kedro-datasets/tests/snowflake/README.md | 25 ++---------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/kedro-datasets.yml b/.github/workflows/kedro-datasets.yml index d5aae0282..202e4d04b 100644 --- a/.github/workflows/kedro-datasets.yml +++ b/.github/workflows/kedro-datasets.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest ] - python-version: [ "3.10", "3.11", "3.12" ] + python-version: [ "3.10", "3.11" ] uses: ./.github/workflows/unit-tests.yml with: plugin: kedro-datasets diff --git a/kedro-datasets/tests/snowflake/README.md b/kedro-datasets/tests/snowflake/README.md index 69fde3fd9..d4802a51a 100644 --- a/kedro-datasets/tests/snowflake/README.md +++ b/kedro-datasets/tests/snowflake/README.md @@ -1,26 +1,8 @@ # Snowpark connector testing -Execution of automated tests for Snowpark connector requires real Snowflake instance access. Therefore tests located in this folder are **disabled** by default from pytest execution scope using [conftest.py](conftest.py). +Execution of connection tests for Snowpark connector requires real Snowflake instance access. -[Makefile](/Makefile) provides separate argument ``test-snowflake-only`` to run only tests related to Snowpark connector. To run tests one need to provide Snowflake connection parameters via environment variables: -* SNOWSQL_ACCOUNT - Snowflake account name with region. Ex `ab12345.eu-central-2` -* SNOWSQL_WAREHOUSE - Snowflake virtual warehouse to use -* SNOWSQL_DATABASE - Database to use -* SNOWSQL_SCHEMA - Schema to use when creating tables for tests -* SNOWSQL_ROLE - Role to use for connection -* SNOWSQL_USER - Username to use for connection -* SNOWSQL_PWD - Plain password to use for connection - -All environment variables need to be provided for tests to run. - -Here is example shell command to run snowpark tests via make utility: -```bash -SNOWSQL_ACCOUNT='ab12345.eu-central-2' SNOWSQL_WAREHOUSE='DEV_WH' SNOWSQL_DATABASE='DEV_DB' SNOWSQL_ROLE='DEV_ROLE' SNOWSQL_USER='DEV_USER' SNOWSQL_SCHEMA='DATA' SNOWSQL_PWD='supersecret' make test-snowflake-only -``` - -Currently running tests supports only simple username & password authentication and not SSO/MFA. - -As of Mar-2023, the snowpark connector only works with Python 3.8. +As of Oct-2024, the snowpark connector works with Python 3.9, 3.10 and 3.11. 3.12 is not supported yet. ## Snowflake permissions required Credentials provided via environment variables should have following permissions granted to run tests successfully: @@ -29,6 +11,3 @@ Credentials provided via environment variables should have following permissions * Insert rows into tables in a given schema * Query tables in a given schema * Query `INFORMATION_SCHEMA.TABLES` of respective database - -## Extending tests -Contributors adding new tests should add `@pytest.mark.snowflake` decorator to each test. Exclusion of Snowpark-related pytests from overall execution scope in [conftest.py](conftest.py) works based on markers.