Skip to content

A lightweight framework to allow tests for ETL scenarios and comparing table to table sql outputs. The results are presented in a html file that gives a row by row compare between source and target

License

Notifications You must be signed in to change notification settings

PramodKumarYadav/db-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

db-test

db-test is a lightweight framework that allows to do a functional test compare of sql statement outputs. The test results for each test are then presented in a html file that gives a csv style, row by row compare between source and target records.

Note

Build is expected to fail to showcase failure test reports.

CI

Why db-test?

Comparing results of two SQL statements is easy using open source solutions such as JDBC. Asserting them with standard test libraries such as Junit5 or TestNg is also possible. However, if we use traditional test reports such as surefire or allure for these kind of tests, the output result from such assertions is hardly intutive or useful.

In context of sql output comparisons, a csv representation that highlights the differences for each row/cell feels intutive.

db-test framework does exactly that.

Getting Started

Prerequisites

  • Java 17 or higher
  • Maven

Setup

Clone the repository:

git clone https://github.com/PramodKumarYadav/db-test.git
cd db-test

Run Tests

To run all tests:

mvn clean test

Test Results

To serve the full test report run:

mvn -q allure:serve

Important

From each test, you can go to detailed reports by clicking on the icons as shown in below image.

detailed-reports

Tip

The detailed html test results are also accessible directly from the test-reports directory.

Here are a few samples of how the reports can look like with different settings.

  1. Report with all fields compared. test-report
  2. Report with a few fields skipped from comparison. test-report

About

A lightweight framework to allow tests for ETL scenarios and comparing table to table sql outputs. The results are presented in a html file that gives a row by row compare between source and target

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages