Skip to content

snowflakedb/universal-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

239 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

universal-driver

codecov

Disclaimer

This repository contains experimental content provided as-is. Support applies only to functionality that is embedded in an officially supported Snowflake driver and used as part of that driver. All other files, modules, examples, and utilities in this repository are unsupported, may change or be removed without notice, and should be used at your own risk.

Running Tests

This project contains multiple test suites across different driver implementations. Before running any tests, you'll need to set up common credentials and build the required components.

Prerequisites

NOTE: For snowflake cloud workspace users: Run ./scripts/install_prerequisites_cloud_ws.sh to install required global dependencies

1. Decode Secrets

All integration tests require access to Snowflake credentials. To set up the required parameters.json file:

# Install 1Password CLI if not already installed
# Then decode the encrypted parameters file:
./scripts/decode_secrets.sh

This will create a parameters.json file in the project root containing test credentials.

Environment: PARAMETER_PATH

Some test suites read credentials from parameters.json via the PARAMETER_PATH environment variable.

export PARAMETER_PATH="$(pwd)/parameters.json"

Alternative: If you don't have 1Password CLI installed you can provide encryption password via environment variable:

PARAMETERS_SECRET=<encryption-password> ./scripts/decode_secrets.sh 

Alternative: If you want provide different credentials that the standard ones, you can provide parameters.json yourself:

{
  "testconnection": {
    "SNOWFLAKE_TEST_ACCOUNT": "your-account",
    "SNOWFLAKE_TEST_USER": "your-username",
    "SNOWFLAKE_TEST_PASSWORD": "your-password",
    "SNOWFLAKE_TEST_DATABASE": "your-database",
    "SNOWFLAKE_TEST_SCHEMA": "your-schema",
    "SNOWFLAKE_TEST_WAREHOUSE": "your-warehouse",
    "SNOWFLAKE_TEST_HOST": "your-host.snowflakecomputing.com",
    "SNOWFLAKE_TEST_ROLE": "your-role"
  }
}

2. Build Core Components

The tests require the Rust core library to be built:

# Build all Rust components
cargo build

# Or build specific packages
cargo build --package sf_core
cargo build --package jdbc_bridge

3. Java (required for Wiremock-based tests)

Some integration tests use the Wiremock standalone JAR (started via java -jar ...) to mock Snowflake endpoints. To run those tests, make sure Java is installed and java is available on your PATH:

java -version

On macOS with Homebrew:

brew install --cask temurin

Driver-Specific Testing

Each driver implementation has its own testing setup and requirements. See the individual README files for detailed instructions:

Test Validation

The project includes a test format validator that ensures Gherkin feature files have corresponding implementations:

# Run validator
./tests/tests_format_validator/run_validator.sh

# Or run directly
cd tests/tests_format_validator/
cargo run

CI/Local Environment Differences

  • Local: Tests auto-build missing Rust components
  • CI: Requires pre-built components and explicit environment variables
  • Docker: Reference tests use containerized official drivers

Troubleshooting

  1. Missing parameters.json: Run ./scripts/decode_secrets.sh or create manually
  2. Missing Rust library: Run cargo build --package sf_core

License

Copyright (c) Snowflake Inc. All rights reserved.

Licensed under the Apache License 2.0.

About

Universal driver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 16