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.
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.
- Java 17 or higher
- Maven
Clone the repository:
git clone https://github.com/PramodKumarYadav/db-test.git
cd db-testTo run all tests:
mvn clean testTo serve the full test report run:
mvn -q allure:serveImportant
From each test, you can go to detailed reports by clicking on the icons as shown in below image.
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.


