Skip to content

Commit

Permalink
Removed gremlin-io-test
Browse files Browse the repository at this point in the history
Migrated this type of IO testing to gremlin-util. Added testing for GraphSON 3.0 untyped.
  • Loading branch information
spmallette committed Jul 19, 2023
1 parent 0afd3a5 commit 480b08d
Show file tree
Hide file tree
Showing 9,245 changed files with 1,907 additions and 225,056 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ This release also includes changes from <<release-3-6-XXX, 3.6.XXX>>.
* Removed deprecated `GraphSONMessageSerializerGremlinV1d0` as this is now `GraphSONMessageSerializerV1` to be consistent with other naming.
* Added `GraphSONUntypedMessageSerializerV1` which was formerly `GraphSONMessageSerializerV1d0` to be consistent with other naming.
* Added `GraphSONUntypedMessageSerializerV3` which essentially matches the format of GraphSON 1.0 in its untyped form.
* Removed `gremlin-io-test` and moved that IO type of testing to `gremlin-util`.
* Bumped Groovy to 4.0.9.
* Bumped GMavenPlus to 2.1.0.
* Bumped Spark to 3.3.2.
Expand Down
1 change: 0 additions & 1 deletion docs/src/dev/developer/development-environment.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ mvn -Dmaven.javadoc.skip=true --projects tinkergraph-gremlin test
** Clean the `.groovy/grapes/org.apache.tinkerpop` directory on build: `mvn clean install -DcleanGrapes`
** Turn off "heavy" logging in the "process" tests: `mvn clean install -DargLine="-DmuteTestLogs=true"`
** The test suite for `neo4j-gremlin` is disabled by default - to turn it on: `mvn clean install -DincludeNeo4j`
* Generate <<building-testing,test resources>> for `gremlin-io-test`: `mvn clean install -pl :gremlin-io-test -Dio`
* Regenerate toy graph data (only necessary given changes to IO classes): `mvn clean install -Dio` from `tinkergraph-gremlin` directory
** If there are changes to the Gryo format, it may be necessary to generate the Grateful Dead dataset from GraphSON (see `IoDataGenerationTest.shouldWriteGratefulDead`)
* Start Gremlin Server with Docker using the standard test configuration: `docker/gremlin-server.sh`
Expand Down
76 changes: 0 additions & 76 deletions docs/src/dev/developer/for-committers.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -941,79 +941,3 @@ resources. That file gets copied to the `target/test-classes` on build and sure
are then configured to point at that area of the file system for those configuration files. The XML files
can be edited to fine tune control of the log output, but generally speaking the current configuration is likely
best for everyone's general purposes, so if changes are made please revert them prior to commit.
[[io]]
== IO Documentation and Testing
The link:https://tinkerpop.apache.org/docs/x.y.z/dev/io[IO Documentation] provides more details into GraphML and GraphSON
with a special focus on the needs of developers who are working directly with these formats. GraphSON gets
the greatest focus here as it is used as the primary IO format for link:https://tinkerpop.apache.org/docs/x.y.z/reference/#gremlin-drivers-variants[GLVs].
This documentation is largely generated from the `gremlin-io-test` module found under `gremlin-tools`. The
`gremlin-io-test` module also includes a testing framework which validates that formats don't break between TinkerPop
versions. Unfortunately, this module requires some maintenance to ensure that the documentation and tests both stay
updated.
The `gremlin-io-test` module contains a set of files in the test resources that are statically bound to the version in
which they were generated. Older versions should never be modified. The only time changes to these resources should be
accepted should be for the current `SNAPSHOT` version. The test resources are generated from the `Model` class which
contains the objects that will undergo serialization for purpose of testing. Note that these same objects in the
`Model` are also used to generate documentation.
To generate these test resources and documentation snippets based on the `Model`, use this Maven command:
[source,text]
----
mvn clean install -pl :gremlin-io-test -Dio
----
This command will generate two directories in the `/target` output directory of `gremlin-io-test`: `test-case-data`
and `dev-docs`. The contents of `test-case-data` represents the serialized `Model` objects that can be copied to the
test resources and the contents of the `dev-docs` contains asciidoc snippets that can be copied to the IO documentation.
Generating data files in the fashion mentioned above with Maven is only good for versions of TinkerPop on the 3.3.x
line because the `gremlin-io-test` module did not exist in 3.2.x. Of course, compatibility is still tested back to
those older versions. To generate test data from 3.2.x, there are Groovy scripts in the comments of the
`graphson.asciidoc` files that can copy/pasted to the Gremlin Console. They will generate the batch of test files
needed for `gremlin-io-test`.
When does this command need to be executed?
1. If a new object is added to the `Model` - in this case, the newly created data files should be copied to the
appropriate test resource directory for the current `SNAPSHOT` version and the appropriate asciidoc snippet added to
the IO asciidocs.
2. After the release of a new TinkerPop version - in this case, a new test resource directory should be created for
the `SNAPSHOT` version and the generated `test-case-data` copied in appropriately.
The second case, does require some additional discussion. When a new version is added the following classes will need
to be updated in the following ways:
*GraphBinaryCompatibility* - Include new GraphBinary 1.0 enums for the current `SNAPSHOT`.
[source,java]
----
V1_3_4_3("3.4.3", "1.0", "v1"),
V1_3_4_4("3.4.4", "1.0", "v1");
----
*GraphSONCompatibility* - Include new GraphSON enums for each of the various GraphSON configurations and versions.
[source,java]
----
V1D0_3_3_x("3.3.x", "1.0", "v1d0"),
V2D0_PARTIAL_3_3_x("3.3.x", "2.0", "v2d0-partial"),
V2D0_NO_TYPE_3_3_x("3.3.x", "2.0", "v2d0-no-types"),
V3D0_PARTIAL_3_3_x("3.3.x", "3.0", "v3d0");
----
*GraphBinaryCompatibilityTest* - Add the newly included `GraphBinaryCompatibility` enums to the test parameters being
careful to match the appropriate "mapper" to the right version.
*GraphSONUntypedCompatibilityTest* - Add the newly included GraphSON 1.0 and 2.0 "untyped" enums to the test parameters
being careful to match the appropriate "mapper" to the right version.
*GraphSONTypedCompatibilityTest* - Add the newly included GraphSON 3.0 and 2.0 "typed" enums to the test parameters
being careful to match the appropriate "mapper" to the right version.
At this point, all of the IO tests are rigged up properly and assuming the test resources are available a standard
`mvn clean install` should execute the compatibility tests and validate that everything is working as expected and
that there are no breaks in serialization processes.
3 changes: 0 additions & 3 deletions docs/src/dev/developer/release.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ during this period.
... All tickets not marked "Fixed", "Done", or "Implemented" for their Resolution should not have a Fix Version
assigned (use common sense when reviewing these tickets before removing the Fix Version as it is possible the incorrect
Resolution may have been assigned).
.. Be sure that `gremlin-io-test` has been updated (from 3.3.0 on - this module was not available prior to the 3.3.x line)
... This is typically a post-release task, but it's worth checking to be sure in case the step was somehow overlooked.
... Instructions for updating the module are described in the <<io,IO Documentation and Testing Section>>.
. When all documentation changes are in place, use `bin/publish-docs.sh` to deploy a final `SNAPSHOT` representation
of the docs and thus validate that there are no issues with the documentation generation process. Request review
of the published documentation on the dev mailing list.
Expand Down
Loading

0 comments on commit 480b08d

Please sign in to comment.