Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-1745

Add positive and negative test methods

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0, 0.12.0
    • Component/s: Unit Test
    • Labels:
      None

      Description

      We need positive and negative tests which test just successfully completed and failed without comparing the query results.

      This patch adds two methods runPositiveTests() and runNegativeTests() to QueryTestBase. They run all queries included in query_dir/positive and query_dir/negative in a batch manner. For example, the directory will be as follows:

          src-|
               |- resources
                     |- dataset
                     |     |- TestJoinQuery
                     |              |- table1.tbl
                     |              |- table2.tbl
                     |
                     |- queries
                     |     |- TestJoinQuery
                     |              |- positive
                     |                    |- valid_join_conditions.sql
                     |              |- negative
                     |                    |- invalid_join_conditions.sql
                     |              |- TestInnerJoin.sql
                     |              |- table1_ddl.sql
                     |              |- table2_ddl.sql
                     |
                     |- results
                           |- TestJoinQuery
                                    |- TestInnerJoin.result
      

      You can add the tests for them as follows:

      @Test
        public final void testPositives() throws Exception {
          runNegativeTests();
        }
      
        @Test
        public final void testNegatives() throws Exception {
          runNegativeTests();
        }
      

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #806 (See https://builds.apache.org/job/Tajo-master-build/806/)
        TAJO-1745: Add positive and negative test methods. (hyunsik: rev 6f28fa58bac658be2b9b659276245eed1d86d5e8)

        • tajo-core-tests/src/test/resources/queries/TestSelectQuery/nagative/operations.sql
        • tajo-core-tests/src/test/resources/queries/TestSelectQuery/positive/operations.sql
        • tajo-cluster-tests/src/test/java/org/apache/tajo/QueryTestCaseBase.java
        • tajo-core-tests/src/test/resources/queries/TestSelectQuery/nagative/tables.sql
        • tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
        • CHANGES
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #806 (See https://builds.apache.org/job/Tajo-master-build/806/ ) TAJO-1745 : Add positive and negative test methods. (hyunsik: rev 6f28fa58bac658be2b9b659276245eed1d86d5e8) tajo-core-tests/src/test/resources/queries/TestSelectQuery/nagative/operations.sql tajo-core-tests/src/test/resources/queries/TestSelectQuery/positive/operations.sql tajo-cluster-tests/src/test/java/org/apache/tajo/QueryTestCaseBase.java tajo-core-tests/src/test/resources/queries/TestSelectQuery/nagative/tables.sql tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java CHANGES
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed.

        Show
        hyunsik Hyunsik Choi added a comment - committed.
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Tajo-master-CODEGEN-build #445 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/445/)
        TAJO-1745: Add positive and negative test methods. (hyunsik: rev 6f28fa58bac658be2b9b659276245eed1d86d5e8)

        • tajo-core-tests/src/test/resources/queries/TestSelectQuery/nagative/operations.sql
        • tajo-cluster-tests/src/test/java/org/apache/tajo/QueryTestCaseBase.java
        • tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java
        • CHANGES
        • tajo-core-tests/src/test/resources/queries/TestSelectQuery/nagative/tables.sql
        • tajo-core-tests/src/test/resources/queries/TestSelectQuery/positive/operations.sql
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Tajo-master-CODEGEN-build #445 (See https://builds.apache.org/job/Tajo-master-CODEGEN-build/445/ ) TAJO-1745 : Add positive and negative test methods. (hyunsik: rev 6f28fa58bac658be2b9b659276245eed1d86d5e8) tajo-core-tests/src/test/resources/queries/TestSelectQuery/nagative/operations.sql tajo-cluster-tests/src/test/java/org/apache/tajo/QueryTestCaseBase.java tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java CHANGES tajo-core-tests/src/test/resources/queries/TestSelectQuery/nagative/tables.sql tajo-core-tests/src/test/resources/queries/TestSelectQuery/positive/operations.sql
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/tajo/pull/681

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tajo/pull/681
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jinossy commented on the pull request:

        https://github.com/apache/tajo/pull/681#issuecomment-132446500

        +1 LGTM

        Show
        githubbot ASF GitHub Bot added a comment - Github user jinossy commented on the pull request: https://github.com/apache/tajo/pull/681#issuecomment-132446500 +1 LGTM
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/681#issuecomment-132446083

        rebased and fixed.

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/681#issuecomment-132446083 rebased and fixed.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jinossy commented on the pull request:

        https://github.com/apache/tajo/pull/681#issuecomment-132080379

        Would you check failure?
        ```
        TestSelectQuery.testPositives:59->QueryTestCaseBase.runNegativeTests:508->QueryTestCaseBase.getNegativeQueryFiles:852 » IO
        TestSelectQuery.testNegatives:64->QueryTestCaseBase.runNegativeTests:508->QueryTestCaseBase.getNegativeQueryFiles:852 » I

        Tests run: 69, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 68.622 sec <<< FAILURE! - in org.apache.tajo.engine.query.TestSelectQuery
        testPositives(org.apache.tajo.engine.query.TestSelectQuery) Time elapsed: 0.005 sec <<< ERROR!
        java.io.IOException: Cannot find file:/Users/jhkim/tajo/asf/tajo/tajo-core-tests/target/test-classes/queries/TestSelectQuery/nagative
        at org.apache.tajo.QueryTestCaseBase.getNegativeQueryFiles(QueryTestCaseBase.java:852)
        at org.apache.tajo.QueryTestCaseBase.runNegativeTests(QueryTestCaseBase.java:508)
        at org.apache.tajo.engine.query.TestSelectQuery.testPositives(TestSelectQuery.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        ```

        Show
        githubbot ASF GitHub Bot added a comment - Github user jinossy commented on the pull request: https://github.com/apache/tajo/pull/681#issuecomment-132080379 Would you check failure? ``` TestSelectQuery.testPositives:59->QueryTestCaseBase.runNegativeTests:508->QueryTestCaseBase.getNegativeQueryFiles:852 » IO TestSelectQuery.testNegatives:64->QueryTestCaseBase.runNegativeTests:508->QueryTestCaseBase.getNegativeQueryFiles:852 » I Tests run: 69, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 68.622 sec <<< FAILURE! - in org.apache.tajo.engine.query.TestSelectQuery testPositives(org.apache.tajo.engine.query.TestSelectQuery) Time elapsed: 0.005 sec <<< ERROR! java.io.IOException: Cannot find file:/Users/jhkim/tajo/asf/tajo/tajo-core-tests/target/test-classes/queries/TestSelectQuery/nagative at org.apache.tajo.QueryTestCaseBase.getNegativeQueryFiles(QueryTestCaseBase.java:852) at org.apache.tajo.QueryTestCaseBase.runNegativeTests(QueryTestCaseBase.java:508) at org.apache.tajo.engine.query.TestSelectQuery.testPositives(TestSelectQuery.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) ```
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/681#issuecomment-130547671

        rebased

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/681#issuecomment-130547671 rebased
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on the pull request:

        https://github.com/apache/tajo/pull/681#issuecomment-130219516

        rebased

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on the pull request: https://github.com/apache/tajo/pull/681#issuecomment-130219516 rebased
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user hyunsik commented on a diff in the pull request:

        https://github.com/apache/tajo/pull/681#discussion_r36837760

        — Diff: tajo-core/src/test/java/org/apache/tajo/QueryTestCaseBase.java —
        @@ -18,6 +18,9 @@

        package org.apache.tajo;

        +import com.facebook.presto.hive.shaded.com.google.common.base.Function;
        +import com.facebook.presto.hive.shaded.com.google.common.collect.Collections2;
        — End diff –

        fixed

        Show
        githubbot ASF GitHub Bot added a comment - Github user hyunsik commented on a diff in the pull request: https://github.com/apache/tajo/pull/681#discussion_r36837760 — Diff: tajo-core/src/test/java/org/apache/tajo/QueryTestCaseBase.java — @@ -18,6 +18,9 @@ package org.apache.tajo; +import com.facebook.presto.hive.shaded.com.google.common.base.Function; +import com.facebook.presto.hive.shaded.com.google.common.collect.Collections2; — End diff – fixed
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jinossy commented on a diff in the pull request:

        https://github.com/apache/tajo/pull/681#discussion_r36821571

        — Diff: tajo-core/src/test/java/org/apache/tajo/QueryTestCaseBase.java —
        @@ -18,6 +18,9 @@

        package org.apache.tajo;

        +import com.facebook.presto.hive.shaded.com.google.common.base.Function;
        +import com.facebook.presto.hive.shaded.com.google.common.collect.Collections2;
        — End diff –

        Could you change to google collection?

        Show
        githubbot ASF GitHub Bot added a comment - Github user jinossy commented on a diff in the pull request: https://github.com/apache/tajo/pull/681#discussion_r36821571 — Diff: tajo-core/src/test/java/org/apache/tajo/QueryTestCaseBase.java — @@ -18,6 +18,9 @@ package org.apache.tajo; +import com.facebook.presto.hive.shaded.com.google.common.base.Function; +import com.facebook.presto.hive.shaded.com.google.common.collect.Collections2; — End diff – Could you change to google collection?
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user jinossy commented on the pull request:

        https://github.com/apache/tajo/pull/681#issuecomment-130136120

        Trigger travis please?

        Show
        githubbot ASF GitHub Bot added a comment - Github user jinossy commented on the pull request: https://github.com/apache/tajo/pull/681#issuecomment-130136120 Trigger travis please?
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user hyunsik opened a pull request:

        https://github.com/apache/tajo/pull/681

        TAJO-1745: Add positive and negative test methods.

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/hyunsik/tajo TAJO-1745

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/tajo/pull/681.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #681


        commit 5f84d2fec45ef0783dd54770bf10907b85a13e2a
        Author: Hyunsik Choi <hyunsik@apache.org>
        Date: 2015-08-06T08:36:07Z

        TAJO-1745: Add positive and negative test methods.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user hyunsik opened a pull request: https://github.com/apache/tajo/pull/681 TAJO-1745 : Add positive and negative test methods. You can merge this pull request into a Git repository by running: $ git pull https://github.com/hyunsik/tajo TAJO-1745 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tajo/pull/681.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #681 commit 5f84d2fec45ef0783dd54770bf10907b85a13e2a Author: Hyunsik Choi <hyunsik@apache.org> Date: 2015-08-06T08:36:07Z TAJO-1745 : Add positive and negative test methods.

          People

          • Assignee:
            hyunsik Hyunsik Choi
            Reporter:
            hyunsik Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development