-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a new 3 way sync mechanism, where the test definitions (Asciidoc), that are generated from neo4j graphql (js) are stored separately as `*.js.adoc`. The new tool JsTestCaseSync.kt now compares the js version with the previous js version and only take over test that were changed. Additionally, the reformatting feature is extracted from the TestSuites into a new tool AsciidocReformater.kt. This removes code that is not test relevant out of the test factories. As a refactoring, utility functions were also removed from the test factories into own *Utils classes.
- Loading branch information
Showing
492 changed files
with
77,118 additions
and
8,962 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="org.neo4j.graphql.tools.AsciidocReformater" type="JetRunConfigurationType" nameIsGenerated="true"> | ||
<option name="MAIN_CLASS_NAME" value="org.neo4j.graphql.tools.AsciidocReformater" /> | ||
<module name="neo4j-graphql-java" /> | ||
<shortenClasspath name="NONE" /> | ||
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$" /> | ||
<method v="2"> | ||
<option name="Make" enabled="true" /> | ||
</method> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="org.neo4j.graphql.tools.JsTestCaseSync" type="JetRunConfigurationType" nameIsGenerated="true"> | ||
<option name="MAIN_CLASS_NAME" value="org.neo4j.graphql.tools.JsTestCaseSync" /> | ||
<module name="neo4j-graphql-java" /> | ||
<shortenClasspath name="NONE" /> | ||
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$" /> | ||
<method v="2"> | ||
<option name="Make" enabled="true" /> | ||
</method> | ||
</configuration> | ||
</component> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
core/src/test/kotlin/org/neo4j/graphql/asciidoc/ast/ThematicBreak.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
package org.neo4j.graphql.asciidoc.ast | ||
|
||
class ThematicBreak: StructuralNode(null) | ||
class ThematicBreak: StructuralNode(null) { | ||
|
||
override fun buildContent(contentExtractor: (CodeBlock) -> String): String { | ||
return "\n'''\n" | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
core/src/test/kotlin/org/neo4j/graphql/domain/CodeBlockPredicate.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.neo4j.graphql.domain | ||
|
||
import org.neo4j.graphql.asciidoc.ast.CodeBlock | ||
|
||
|
||
class CodeBlockPredicate private constructor( | ||
private val language: String, | ||
private val filter: Map<String, String?> = emptyMap(), | ||
private val exactly: Boolean = false | ||
) { | ||
|
||
fun matches(codeBlock: CodeBlock) = codeBlock.matches(language, filter, exactly) | ||
|
||
companion object { | ||
val CYPHER = CodeBlockPredicate("cypher", exactly = true) | ||
val CYPHER_PARAMS = CodeBlockPredicate("json", exactly = true) | ||
val GRAPHQL_SOURCE_SCHEMA = CodeBlockPredicate("graphql", mapOf("schema" to "true")) | ||
val GRAPHQL_AUGMENTED_SCHEMA = CodeBlockPredicate("graphql", mapOf("augmented" to "true")) | ||
val GRAPHQL_REQUEST = CodeBlockPredicate("graphql", mapOf("request" to "true")) | ||
val GRAPHQL_REQUEST_VARIABLES = CodeBlockPredicate("json", mapOf("request" to "true")) | ||
val GRAPHQL_RESPONSE = CodeBlockPredicate("json", mapOf("response" to "true")) | ||
val QUERY_CONFIG = CodeBlockPredicate("json", mapOf("query-config" to "true")) | ||
val SCHEMA_CONFIG = CodeBlockPredicate("json", mapOf("schema-config" to "true")) | ||
val TEST_DATA = CodeBlockPredicate("cypher", mapOf("test-data" to "true")) | ||
val CUSTOM_RESOLVER = CodeBlockPredicate("kotlin") | ||
} | ||
|
||
} |
Oops, something went wrong.