[
https://issues.apache.org/jira/browse/DRILL-6249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16468446#comment-16468446
]
ASF GitHub Bot commented on DRILL-6249:
---------------------------------------
paul-rogers commented on a change in pull request #1251: DRILL-6249: Adding
more unit testing documentation.
URL: https://github.com/apache/drill/pull/1251#discussion_r186933973
##########
File path: docs/dev/Testing.md
##########
@@ -2,27 +2,108 @@
Drill makes extensive use of [JUnit](http://junit.org/junit4/) and other
libraries for testing. This page provides pointers to the information you need
to work with Drill tests. We don't repeat that information; you will want to
follow the links and read the original material to get a complete understanding
of the libraries that Drill uses.
-Caveat: information here about Drill is "reverse engineered" from the code;
this page has not yet had the benefit of insight from the developers who
created Drill's test structure.
-
-# Topics
-
-"Classic" Drill testing techniques
+# Writing Tests
+* [Test Data Sets](TestDataSets.md)
+* [Temp Directory Utilities](TempDirectories.md)
* [Testing with JUnit](JUnit.md)
* [Test Logging](TestLogging.md)
+
+## Deprecated Drill Testing Techniques
+
+This is a list of old Drill testing machinery that we have cleaner machinery
for now.
+
+* [BaseTestQuery](BaseTestQuery.md): Deprecated, use
[ClusterTest](ClusterTest.md) instead.
+
+## Legacy Drill Testing Techniques
+
+This is a list of old Drill testing machinery for which there is no other
alternative at the moment.
+
* [Testing with Physical Plans and Mock Data](LegacyTestingFrameworks.md)
-"Updated" Drill testing techniques
+## Latest Drill Testing Techniques
+* [RowSet Framework](RowSetFramework.md)
* [Cluster Fixture Framework](ClusterFixture.md)
* [Operator Fixture Framework](OperatorFixture.md)
-* [The Mock Record Reader](MockRecordReader.md)
+* [ClusterTest](ClusterTest.md)
+* [Single Operator Unit Test](PhysicalOpUnitTestBase.md)
+* [Mocking Components](MockingComponents.md)
+* [Generated Code](GeneratedCode.md)
+
+## Categories
+
+Currently Drill uses Travis to run smoke tests for every PR and commit. All of
Drill's unit tests cannot be run on Travis because Drill's tests take longer to
run than the
+maximum allowed container time for the free tier of Travis. In order to decide
which tests are run on Travis and which tests are not, tests are categorized
using JUnit's
+`@Category` annotation. Currently the following categories are excluded from
Travis:
+
+ - **SlowTest:** Tests that are slow.
+ - **UnlikelyTest:** Tests that cover parts of the code that are rarely or
never touched.
+ - **SecurityTest:** Corner case tests for security features.
+
+To mark a test with a category you can do the following:
+
+```
+@Category(SlowTest.class)
+public class MyTest {
+ // Testing code
+}
+```
+
+To mark a test with multiple categories you can do the following:
+
+```
+@Category({SlowTest.class, SecurityTest.class})
+public class MyTest {
+ // Testing code
+}
+```
+
+# Running Tests
+
+Drill tests run in parallel. The Model for parallel execution is to divide
test classes between multiple
+forked test processes. Each test process then runs the test classes assigned
to it sequentially.
+
+## Speeding Up Test Runs
+
+There are a couple knobs you can turn to make tests run faster on your machine.
+
+ * **Maven Build Threads**: `-T <num>`
+ * **Sure Fire Fork Count**: `-DforkCount=<num>`
+ * **Test Categories**
+
+### -T
+
+Maven allows you to use multiple threads to compile sub modules. Also when
running tests each build
+thread forks its own surefire process, so the tests for different submodules
are run in parallel. In order
+to leverage this use the `-T` flag. By default this option is effectively.
+
+Ex. In order to run the build using two maven threads use the following
command.
+
+```
+mvn -T 2 clean install
+```
+
+### -DforkCount
+
+To run tests within a submodule in parallel you can use the `-DforkCount`
option. By default this
+
+Ex. Run 4 test processes in parallel
+
+```
+mvn clean install -DforkCount=4
+```
+
+**Note:** The `-DforkCount` option interacts with `-T`. When use together each
build thread (`-T`) gets
Review comment:
use --> used
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Add Markdown Docs for Unit Testing and Link to it in README.md
> --------------------------------------------------------------
>
> Key: DRILL-6249
> URL: https://issues.apache.org/jira/browse/DRILL-6249
> Project: Apache Drill
> Issue Type: Improvement
> Reporter: Timothy Farkas
> Assignee: Timothy Farkas
> Priority: Major
> Labels: ready-to-commit
> Fix For: 1.14.0
>
>
> I am working on a presentation about how to use the unit testing utilities in
> Drill. Instead of writing the doc and having it be lost in Google Drive
> somewhere I am going to add a Markdown doc to the drill repo and link to it
> in the README.md. This is appropriate since these docs will only be used by
> developers, and the way we unit test will change as the code changes. So the
> unit testing docs should be kept in the same repo as the code so it can be
> updated and kept in sync with the rest of Drill.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)