Skip to content

Commit

Permalink
update testing documentation
Browse files Browse the repository at this point in the history
Signed-off-by: tdhooghe <[email protected]>
  • Loading branch information
tdhooghe committed Oct 21, 2024
1 parent 0133025 commit fc2b3b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kedro-datasets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 2 additions & 23 deletions kedro-datasets/tests/snowflake/README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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.

0 comments on commit fc2b3b8

Please sign in to comment.