[ 
https://issues.apache.org/jira/browse/CALCITE-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14311882#comment-14311882
 ] 

Vladimir Sitnikov edited comment on CALCITE-507 at 2/10/15 10:05 AM:
---------------------------------------------------------------------

Preparation:
1) Clone https://github.com/vlsi/calcite-test-dataset.git at the same level as 
calcite repository.
For instance:
{noformat}
code
  +-- calcite
  +-- calcite-test-dataset
{noformat}
Note: integration tests search for {{../calcite-test-dataset}} or 
{{../../calcite-test-dataset}}. You can specify full path via 
{{calcite.test.dataset}} system property.

2) Build and start the VM: {{cd calcite-test-dataset && mvn install}}

Suggested work flow:
* To execute regular unit tests (does not require external data): no change. 
{{mvn test}} or {{mvn install}}.
* To execute all tests, for all the DBs: {{mvn verify -Pit}}. {{it}} stands for 
"integration-test". {{mvn install -Pit}} works as well.
* To execute just tests for external DBs, excluding unit tests: {{mvn 
-Dtest=foo -DfailIfNoTests=false -Pit verify}}
* To execute just MongoDB tests: {{cd mongo; mvn verify -Pit}}

>From within IDE:
* To execute regular unit tests: no change.
* To execute MongoDB tests: run {{MongoAdapterIT.java}} as usual (no additional 
properties are required)
* To execute MySQL tests: run {{JdbcTest}} and {{JdbcAdapterTest}} with setting 
{{-Dcalcite.test.db=mysql}}

Technically:
* Tests with external data are executed at maven's {{integration-test}} phase
* We do not currently use {{pre-integration-test}}/{{post-integration-test}}, 
however we could use that in future
* The verification of build pass/failure is performed at {{verify}} phase

TODO:
 * Need to pick the way to run tests against file-based databases (e.g. H2). 
File path is required in JDBC URL, so we need to fix the path. That implies we 
need to check out test dataset at predefined location ({{../test-dataset}}?).
 * Need to think if we should activate "slow tests" by default in {{it}} 
profile, so the running of full suite would be just {{mvn install -Pit}}


was (Author: vladimirsitnikov):
Suggested work flow:
* To execute regular unit tests (does not require external data): no change. 
{{mvn test}} or {{mvn install}}.
* To execute all tests, for all the DBs: {{mvn verify -Pit}}. {{it}} stands for 
"integration-test". {{mvn install -Pit}} works as well.
* To execute just tests for external DBs, excluding unit tests: {{mvn 
-Dtest=foo -DfailIfNoTests=false -Pit verify}}
* To execute just MongoDB tests: {{cd mongo; mvn verify -Pit}}

>From within IDE:
* To execute regular unit tests: no change.
* To execute MongoDB tests: run {{MongoAdapterIT.java}} as usual (no additional 
properties are required)
* To execute MySQL tests: run {{JdbcTest}} and {{JdbcAdapterTest}} with setting 
{{-Dcalcite.test.db=mysql}}

Technically:
* Tests with external data are executed at maven's {{integration-test}} phase
* We do not currently use {{pre-integration-test}}/{{post-integration-test}}, 
however we could use that in future
* The verification of build pass/failure is performed at {{verify}} phase

TODO:
 * Need to pick the way to run tests against file-based databases (e.g. H2). 
File path is required in JDBC URL, so we need to fix the path. That implies we 
need to check out test dataset at predefined location ({{../test-dataset}}?).
 * Need to think if we should activate "slow tests" by default in {{it}} 
profile, so the running of full suite would be just {{mvn install -Pit}}

> Add Vagrant files to enable testing of data storages: mysql, postgresql, 
> mongo, etc
> -----------------------------------------------------------------------------------
>
>                 Key: CALCITE-507
>                 URL: https://issues.apache.org/jira/browse/CALCITE-507
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.0.0-incubating
>            Reporter: Vladimir Sitnikov
>            Assignee: Julian Hyde
>              Labels: newbie
>             Fix For: next
>
>
> As discussed in email list, it makes sense to implement Vagrant (or similar) 
> VM machines to simplify testing of the downstream executors.
> Currently it is not clear how to configure mysql/mongo/etc.
> Not sure if it should be a set of separate configurations or a single 
> configuration with all the batteries included.
> For instance, Vagrant allows to configure a [set of 
> machines|https://docs.vagrantup.com/v2/multi-machine/index.html], while still 
> providing a way to start just a subset.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to