https://github.com/accenture/dbtestcompare

Application to compare results of two SQL queries

https://github.com/accenture/dbtestcompare

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.9%) to scientific vocabulary

Keywords

compare-data database database-migrations jdbc-drivers mariadb mysql postgresql snowflake sql-queries sqlserver teamcity teradata testng tests
Last synced: 6 months ago · JSON representation

Repository

Application to compare results of two SQL queries

Basic Info
  • Host: GitHub
  • Owner: Accenture
  • License: mit
  • Language: Java
  • Default Branch: master
  • Homepage:
  • Size: 13.5 MB
Statistics
  • Stars: 29
  • Watchers: 35
  • Forks: 13
  • Open Issues: 0
  • Releases: 17
Topics
compare-data database database-migrations jdbc-drivers mariadb mysql postgresql snowflake sql-queries sqlserver teamcity teradata testng tests
Created over 9 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.md

DBTestCompare

Application to compare results of two SQL queries

.github/workflows/github-actions.yml

It reads tests definitions in XML format form specified directory and than runs them (as TestNG test).

You can generate automated tests for your database using DBTestCompareGenerator

AI generated documentation DeepWiki

If two SQL returns different results -> test fails.

Application supports TeamCity Service Messages (##teamcity messages) so if teamcityLogsEnabled is set to "true" (config file or command line parameter), you will see nice test tree in TeamCity logs.

To execute tests run program (Java 8 must be installed first (JDK or JRE)):

If you set JAVAHOME variable: java -jar DBTestCompare-1.0-SNAPSHOT-jar-with-dependencies.jar or to add automatically all drivers from the directory to the classspath (jdbcdrivers/) Windows ``` java -cp "DBTestCompare-1.0-SNAPSHOT-jar-with-dependencies.jar;jdbc_drivers/" uk.co.objectivity.test.db.RunTests Linux java -cp "DBTestCompare-1.0-SNAPSHOT-jar-with-dependencies.jar:jdbcdrivers/*" uk.co.objectivity.test.db.RunTests or e.g. "C:\Program Files\Java\jdk1.8.092\bin\java" -jar DBTestCompare-1.0-SNAPSHOT-jar-with-dependencies.jar ```

The application provides the following features: - Platform independence - possibility to run on Windows and Linux as well (Java Runtime Environment 8 needed) - Supports all databases with JDBC drivers provided (tested with Microsoft SQL Server, Teradata, Snowflake, PostgreSQL and MySQL\MariaDB) - Supports all Continuous Integration tools thanks to TestNG Java unit test framework - Possibility to compare data between two different database engines even for huge data sets without "Out of memory problem" thanks to an incremental solution, more details here - Possibility to compare query to expected data defined in csv file and generate Excel test report, more details here - Possibility to compare data in one database engine in the fastest way using MINUS/EXCEPT Sql operator, more details here - No need to compile program in order to add new tests - thanks to Test Adapter DataDriven mechanism from TestNG - Possibility to execute tests in parallel by setting Threads parameter in the connection file. - Possibility to build multilevel tests structure - Possibility to save query results to flat files - Real-time test execution progress in TeamCity, more details here - Possibility to store Queries in separated files or inline in xml test definitions, more details here - Connection pool used for executing tests - connections to databases are not closed after each tests, but when all tests are finished - Possibility to compare query to expected data defined in csv file, more details here - Possibility to compare query to expected number of rows defined in XML test definition, more details here - Possibility to choose exit code in case of test failure - Possibility to connect to OLAP - compare mdx queries, more details here - Possibility to define "delta" precision of comparing floating-point numbers - Possibility to filter tests for execution by including or excluding, more details here - Standard TestNG html test report in "test-output" folder, more details here

How DBTestCompare works:

Comparing databases:

DBTestCompare

With test data delivered by file:

DBTestCompare

The program searches for test definitions by default in folder "test-definitions".

JDBC drivers must be present in "jdbcdrivers" folder. Licensed database drivers are NOT included, only open source like MySQL, MariaDB and PostgreSQL. Download licensed database drivers from the producer of the database e.g. Microsoft and put them in "jdbcdrivers" folder (on the same level as *.jar file).

More details here

You can override some of the application configuration properties, run app with:

-DtestsDir=path -set tests directory (default: test-definitions)

-DteamcityLogsEnabled=true -log test output in TeamCity format

-DfilterInclude=a.b,g.z.f -comma separated directories or test files which you want to include

-DfilterExclude=a.b.test -comma separated directories or test files which you want to exclude

for example:

java -DtestsDir=my_tests -jar DBTestCompare-1.0-SNAPSHOT-jar-with-dependencies.jar More details here

3'rd party libraries: Software: - SIROCCO :: Text Table Formatter - Apache Log4j - com.sun.xml.bind :: JAXB Runtime - com.mchange :: c3p0 - a JDBC Connection pooling / Statement caching library

More details here

Where to start?


Checkout the code or get compiled jar file from releases page


To compile app to a runnable fat jar file, run (Maven must be installed first): mvn clean compile assembly:single jar will be created in target directory.


You can manage the application by attached ANT (ANT must be installed first) build.xml file (in folder \deploy), the script allows to :

-compile app

-replace tokens in connection definition

-replace tokens in SQL queries

more details here and here

Owner

  • Name: Accenture
  • Login: Accenture
  • Kind: organization

Accenture Github site

GitHub Events

Total
  • Create event: 4
  • Release event: 2
  • Issues event: 2
  • Watch event: 6
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 26
  • Pull request event: 11
Last Year
  • Create event: 4
  • Release event: 2
  • Issues event: 2
  • Watch event: 6
  • Delete event: 2
  • Issue comment event: 1
  • Push event: 26
  • Pull request event: 11

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 21
  • Total pull requests: 32
  • Average time to close issues: over 1 year
  • Average time to close pull requests: 11 days
  • Total issue authors: 4
  • Total pull request authors: 6
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.19
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 13
Past Year
  • Issues: 0
  • Pull requests: 5
  • Average time to close issues: N/A
  • Average time to close pull requests: 17 minutes
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • raczeja (14)
  • maciejrudy-zz (4)
  • pniewiadowski (2)
  • Oliver2421 (1)
  • VivekBasidoni (1)
Pull Request Authors
  • dependabot[bot] (13)
  • raczeja (12)
  • pniewiadowski (3)
  • snyk-bot (3)
  • maciejjerzyantosiak (2)
  • maciejrudy-zz (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (13) java (1)

Dependencies

pom.xml maven
  • com.mchange:c3p0 0.9.5.5
  • com.sun.xml.bind:jaxb-impl 2.2.7
  • javax.activation:activation 1.1.1
  • org.apache.commons:commons-lang3 3.9
  • org.apache.logging.log4j:log4j-api 2.17.1
  • org.apache.logging.log4j:log4j-core 2.17.1
  • org.apache.poi:poi 4.1.1
  • org.ow2.sirocco:sirocco-text-table-formatter 1.0
  • org.testng:testng 7.0.0
docker/docker-compose.yml docker
  • mcr.microsoft.com/mssql/server 2019-latest
  • mysql latest
  • postgres latest
docker/my-mysql/Dockerfile docker
  • mysql latest build
docker/my-postgres/Dockerfile docker
  • library/postgres latest build
docker/my_sqlserver/Dockerfile docker
  • mcr.microsoft.com/mssql/server 2019-latest build
.github/workflows/github-actions.yml actions
  • actions/checkout v4 composite
  • actions/setup-java v3 composite
  • actions/upload-artifact v4 composite
  • cedx/setup-ant v2 composite
  • mikepenz/action-junit-report v4 composite
  • ncipollo/release-action v1 composite
.github/workflows/codeql.yml actions
  • actions/checkout v4 composite
  • github/codeql-action/analyze v3 composite
  • github/codeql-action/init v3 composite