You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/12/15 23:59:08 UTC

[29/44] incubator-tinkerpop git commit: Add some notes about unit testing to dev docs

Add some notes about unit testing to dev docs


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/ad9facba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/ad9facba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/ad9facba

Branch: refs/heads/TINKERPOP-1035
Commit: ad9facbaf49d6df2e1f40fa38f648b5d82821f66
Parents: 89f027d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Dec 11 06:16:50 2015 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Dec 11 06:16:50 2015 -0500

----------------------------------------------------------------------
 docs/src/dev/developer/contributing.asciidoc | 24 ++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/ad9facba/docs/src/dev/developer/contributing.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/contributing.asciidoc b/docs/src/dev/developer/contributing.asciidoc
index 959f4ef..2858d79 100644
--- a/docs/src/dev/developer/contributing.asciidoc
+++ b/docs/src/dev/developer/contributing.asciidoc
@@ -236,8 +236,30 @@ call out this fact.
 The JIRA issues that track removal of deprecated methods should be periodically evaluated to determine if it is
 prudent to schedule them into a release.
 
+Developing Tests
+~~~~~~~~~~~~~~~~
+
+TinkerPop has a wide variety of test types that help validate its internal code as well as external provider code.
+There are "unit tests" and "integration tests". Unit tests execute on standard runs of `mvn clean install`.  These
+tests tend to run quickly and provide a reasonable level of coverage and confidence in the code base.  Integration
+tests are disabled by default and must be explicitly turned on with a special build property by adding
+`-DskipIntegrationTests=false` to the `mvn` execution.  Integration tests run slower and may require external
+components to be running when they are executed. They are "marked" as separate from unit tests by inclusion of the
+suffix "IntegrateTest".
+
+Here are some other points to consider when developing tests:
+
+* Avoid use of `println` in tests and prefer use of a SLF4j `Logger` instance so that outputs can be controlled in a
+standard way.
+* If it is necessary to create files on the filesystem, do not hardcode directories - instead, use the `TestHelper` to
+create directory structures.  `TestHelper` will properly create file system structure in the appropriate build
+directory thus allowing proper clean-up between test runs.
+* If writing tests in one of the test suites, like `gremlin-test`, it is important to remember that if a new `Graph`
+instance is constructed within the test manually, that it be closed on exit of that test.  Failing to do this cleanup
+can cause problems for some graph providers.
+
 Gremlin Language Test Cases
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 When writing a test case for a Gremlin step, be sure to use the following conventions.