Skip to content

Database Integration Tests

Ephrim Stanley edited this page Jan 5, 2022 · 8 revisions

Overview

This document describes our approach for database integration tests.

Types of tests

To verify correctness and enable safe refactoring, we want the following set of tests for each supported database.

Connection Protocol Integration Tests

These are tests that exercise Legend code related to database connection creation. This includes JDBC(other) code for connection creation, database authentication etc.

Where possible these tests should make use of database/other infra that can be instantiated and run as part of the test. E.g Using TestContainers in a Junit test to spin up a SqlServer database.

For cloud databases, we have set of AWS/GCP accounts that house dedicated test databases.

In some cases, the tests might have to be run outside of Github CI/CD. For e.g a connector might make use of features that are available only in the cloud provider. In which case, we need a way to ship and run the test in the cloud. But the test needs to be triggered from Github CI/CD.

See https://github.com/epsstan/legend-engine/blob/snowflake-integration-test/legend-engine-executionPlan-execution-store-relational-connection/src/test/java/org/finos/legend/engine/plan/execution/stores/relational/connection/test/DatabaseIntegration_TestConnectionObjectProtocol_Snowflake.java

See https://github.com/epsstan/legend-engine/blob/snowflake-integration-test/.github/workflows/db-integration-test.yml

SQL Generation Tests

These are tests that exercise various aspects of Legend's SQL generation capabilities.

TODO : vikask-gs to update this page with details.