-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to test different cypher versions globally #725
Conversation
9a31599
to
188ff80
Compare
7c939a9
to
44f67bf
Compare
44f67bf
to
55d4729
Compare
// A test may set this for the entire file itself, so we shouldn't override that | ||
if (!globalConfig.containsKey(GraphDatabaseInternalSettings.default_cypher_version)) { | ||
String cypherVersionEnv = System.getenv() | ||
.getOrDefault("CYPHER_VERSION", GraphDatabaseInternalSettings.CypherVersion.Cypher25.name()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we leave this as 25 going forward?
The plan is to ask for the TC builds to use the env to test both Cypher 5 and 25 in PR builds :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote for using 5 as default for now and setting it to 25 when mono repo has flipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
public static List<String> getCypherVersions() { | ||
assert QueryLanguage.ALL.size() == 2; | ||
return List.of("5", "25"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also be a compilation failure:
public static List<String> getCypherVersions() { | |
assert QueryLanguage.ALL.size() == 2; | |
return List.of("5", "25"); | |
} | |
public static List<String> getCypherVersions() { | |
return QueryLanguage.ALL.stream() | |
.map(l -> switch(l) { | |
case Cypher5 -> "5"; | |
case Cypher25 -> "25"; | |
}) | |
.toList(); | |
} |
assertResultAsJsonEquals( | ||
CypherVersion.Default, | ||
showFunctions(null), | ||
showFunctions(CypherVersion.Default), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CypherVersion.Default
is being removed. If you really need a default one you can use:
switch (GraphDatabaseSettings.default_langage.default()) {
case Cypher5 => CypherVerision.Cypher5;
case Cypher25 => CypherVerision.Cypher25;
}
assertResultAsJsonEquals( | ||
CypherVersion.Default, | ||
showProcedures(null), | ||
showProcedures(CypherVersion.Default), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
directory.toPath().toAbsolutePath()); | ||
directory.toPath().toAbsolutePath()) | ||
.withSetting( | ||
GraphDatabaseInternalSettings.default_cypher_version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting is being replaced by GraphDatabaseSettings.default_language
. Unfortunately that is not hooked up yet (PR), so go ahead and merge this and I sort it out later.
// A test may set this for the entire file itself, so we shouldn't override that | ||
if (!globalConfig.containsKey(GraphDatabaseInternalSettings.default_cypher_version)) { | ||
String cypherVersionEnv = System.getenv() | ||
.getOrDefault("CYPHER_VERSION", GraphDatabaseInternalSettings.CypherVersion.Cypher25.name()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote for using 5 as default for now and setting it to 25 when mono repo has flipped.
Add config and env variable to be able to test Cypher Versions - ready to fix all Cypher 25 test failures