Giter Club home page Giter Club logo

Comments (11)

raczeja avatar raczeja commented on May 27, 2024

please add name of driver file to the https://github.com/ObjectivityLtd/DBTestCompare/blob/master/pom.xml#L38,
downloaded drivers copy to the folder /jdbc_drivers
and add new connection to the https://github.com/ObjectivityLtd/DBTestCompare/blob/master/test-definitions/cmpSqlResults-config.xml

from dbtestcompare.

raczeja avatar raczeja commented on May 27, 2024

please let me know if it's working ?

from dbtestcompare.

pniewiadowski avatar pniewiadowski commented on May 27, 2024

@raczeja thanks for a quick response.
I tried your solution yesterday, but wasn't able to replay you.

I have face another issue. Once I configure Snowflake DB and run test I got something like that:

[INFO ] 2021-01-28 08:19:46,684 RunTests - 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
[DEBUG] 2021-01-28 08:19:46,686 RunTests - Scanning tests directory: test-definitions...
[DEBUG] 2021-01-28 08:19:46,687 RunTests - Reading configuration: test-definitions/cmpSqlResults-config.xml
[DEBUG] 2021-01-28 08:19:47,056 RunTests - Number of Threads set in configuration: 5
[DEBUG] 2021-01-28 08:19:47,057 RunTests - Initializing all components ...
[DEBUG] 2021-01-28 08:19:47,059 DataSource - Adding shutdown hook (closing connections)...
[DEBUG] 2021-01-28 08:19:47,059 DataSource - Initializing data source connection pools...
[DEBUG] 2021-01-28 08:19:47,060 DataSource - Max Pool Size:6 for datasource: TERADATA_SERVER
[DEBUG] 2021-01-28 08:19:47,622 DataSource - Max Pool Size:6 for datasource: SNOWFLAKE_SERVER
[DEBUG] 2021-01-28 08:19:47,637 DataSource - Max Pool Size for each DataSource should be >= Threads
[DEBUG] 2021-01-28 08:19:47,640 TestDataProvider - Initializing tests Data Provider...
[DEBUG] 2021-01-28 08:19:47,643 Printer - Initializing logger / printer ...
[DEBUG] 2021-01-28 08:19:47,759 TestDataProvider - Reading tests configuration...
[DEBUG] 2021-01-28 08:19:47,788 TestDataProvider - Running tests...
[INFO ] 2021-01-28 08:19:47,852 DBTestCompare:ae.conifg - Starting test...
[INFO ] 2021-01-28 08:19:49,844 DBTestCompare:ae.conifg - TEST FAILED
java.lang.Exception: java.sql.SQLFeatureNotSupportedException: ResultSet type 1004 is not supported.
Query 1: SELECT distinct GENDER FROM CITIBIKE."PUBLIC".TRIPS
Query 2: SELECT distinct GENDER FROM CITIBIKE."PUBLIC".TRIPS
        at uk.co.objectivity.test.db.comparators.FetchComparator.compare(FetchComparator.java:81)
        at uk.co.objectivity.test.db.DBTestCompare.testSQLResults(DBTestCompare.java:89)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
        at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:584)
        at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:172)
        at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
        at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:804)
        at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:145)
        at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
        at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

I am using FETCH method to compare results.
Will try to do some research, but maybe you have a solution already.

from dbtestcompare.

pniewiadowski avatar pniewiadowski commented on May 27, 2024

Ok, that was quicker than I thought :)

In FetchComparator.java there is a:

connection1.prepareStatement(sql1.getSql(), ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet
                    .CONCUR_READ_ONLY);

Which use ResultSet.TYPE_FORWARD_ONLY and according to Snowflake JDBC driver is one of not supported ResultSet types.
Changing this to:

connection1.prepareStatement(sql2.getSql(), ResultSet.TYPE_FORWARD_ONLY, ResultSet
                    .CONCUR_READ_ONLY);

I was able to run the test.

from dbtestcompare.

raczeja avatar raczeja commented on May 27, 2024

you can make PR with your changes, I will merged...

from dbtestcompare.

pniewiadowski avatar pniewiadowski commented on May 27, 2024

Well, no problem I can do this, but I am not sure how this influence other databases.
Do you know?

So far I have test it with Teradata and Snowflake and that's working.

from dbtestcompare.

raczeja avatar raczeja commented on May 27, 2024

during the build is tested against SQL Server, MySQL and PostgreSQL
https://dev.azure.com/DBTestCompare/Build/_build/results?buildId=170&view=ms.vss-test-web.build-test-results-tab
we will see...

from dbtestcompare.

pniewiadowski avatar pniewiadowski commented on May 27, 2024

PR #31 added

from dbtestcompare.

raczeja avatar raczeja commented on May 27, 2024

I think that just name of new driver is missing in https://github.com/ObjectivityLtd/DBTestCompare/blob/master/pom.xml#L38

from dbtestcompare.

pniewiadowski avatar pniewiadowski commented on May 27, 2024

Yes, sorry about that. Done

from dbtestcompare.

raczeja avatar raczeja commented on May 27, 2024

thank you

from dbtestcompare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.