-
Notifications
You must be signed in to change notification settings - Fork 495
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
Uses dev docker container in the dev branch. No AUTO cherry-pick #2621
Conversation
6952d1a
to
91045d7
Compare
91045d7
to
b8095ca
Compare
@@ -6,12 +6,11 @@ plugins { | |||
id 'maven-publish' | |||
id 'antlr' | |||
id "org.sonarqube" | |||
id "org.jetbrains.kotlin.jvm" version "1.5.31" | |||
id "org.jetbrains.kotlin.jvm" version "1.6.0" |
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.
We need to update this in the other maintained builds
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip |
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.
We need to update this in the other maintained builds
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 |
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.
We need to update this in the other maintained branches
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.
No I don't think so, as Neo 4.x is supposed to be run with Java 11?
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.
Yes yes, I only left this comment as a self-reminder to review these settings in other branches
@@ -20,7 +19,7 @@ jar { | |||
} | |||
|
|||
compileKotlin { | |||
kotlinOptions.jvmTarget = "1.8" | |||
kotlinOptions.jvmTarget = "17" |
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.
Update this in the other branches
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.
Yes, but in the other branches 4.2, 4.3 and 4.4, I guess you should update it to 11 rather than 17.
configurations.all { | ||
exclude group: 'org.slf4j', module: 'slf4j-nop' | ||
exclude group: 'ch.qos.logback', module: 'logback-classic' | ||
} |
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.
Add this in the other branches
filter { | ||
setFailOnNoMatchingTests(false) | ||
} | ||
|
||
testLogging.showStandardStreams = true | ||
testLogging.exceptionFormat = 'full' |
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.
Add this lines in other branches
run: (find ~/.gradle/caches -name "*neo4j*" -exec rm -rf {} \;) || echo "All neo4j files cleaned" | ||
- name: Check procedures included in apoc full | ||
run: git diff --exit-code full/src/main/resources/extended.txt || (echo "extended.txt file does not contain all changes" && exit -1) | ||
run: chmod +x gradlew && ./gradlew build |
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.
Simplify these lines and make sure there's no build --continue
in other branches.
for (var version: Neo4jVersion.values()) { | ||
try (Neo4jContainerExtension neo4jContainer = createDB(version, APOC_FULL, !TestUtil.isRunningInCI()) | ||
.withNeo4jConfig("dbms.transaction.timeout", "5s")) { | ||
|
||
neo4jContainer.start(); | ||
assertTrue("Neo4j Instance should be up-and-running", neo4jContainer.isRunning()); | ||
|
||
Session session = neo4jContainer.getSession(); | ||
int procedureCount = session.run("SHOW PROCEDURES YIELD name WHERE name STARTS WITH 'apoc' RETURN count(*) AS count").peek().get("count").asInt(); | ||
int functionCount = session.run("SHOW FUNCTIONS YIELD name WHERE name STARTS WITH 'apoc' RETURN count(*) AS count").peek().get("count").asInt(); | ||
int coreCount = session.run("CALL apoc.help('') YIELD core WHERE core = true RETURN count(*) AS count").peek().get("count").asInt(); | ||
|
||
assertTrue(procedureCount > 0); | ||
assertTrue(functionCount > 0); | ||
assertTrue(coreCount > 0); | ||
} catch (Exception ex) { | ||
// if Testcontainers wasn't able to retrieve the docker image we ignore the test | ||
if (TestContainerUtil.isDockerImageAvailable(ex)) { | ||
ex.printStackTrace(); | ||
fail("Should not have thrown exception when trying to start Neo4j: " + ex); | ||
} else if (!TestUtil.isRunningInCI()) { | ||
fail( "The docker image " + TestContainerUtil.neo4jEnterpriseDockerImageVersion + " should be available in the CI"); | ||
} | ||
} | ||
} | ||
} |
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.
Refactor this in other branches to also have tests for community version (to avoid binary incompatibilities ever again)
@@ -48,7 +47,7 @@ dependencies { | |||
// implementation group: 'commons-codec', name: 'commons-codec', version: '1.14' | |||
implementation group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0' | |||
implementation group: 'org.hdrhistogram', name: 'HdrHistogram', version: '2.1.9' | |||
implementation group: 'org.neo4j.driver', name: 'neo4j-java-driver', version: '4.0.0' | |||
compileOnly group: 'org.neo4j.driver', name: 'neo4j-java-driver-slim', version: '4.4.3' |
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.
Make the driver compile only in other branches to avoid overwriting the one in the database when we plug in apoc
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.
What do you mean with 'only in other branches'? I'm not sure I follow...
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.
Sorry, I'll word it in other way: I want the version of java driver to be a compileOnly
dependency as well in other branches (since it is included in the database already). Not doing this causes the database to evict its own java version and use the one included in the apoc jar.
@@ -20,7 +20,7 @@ | |||
public void test() { | |||
try { | |||
Neo4jContainerExtension neo4jContainer = createEnterpriseDB(!TestUtil.isRunningInCI()) | |||
.withNeo4jConfig("dbms.transaction.timeout", "5s"); | |||
.withNeo4jConfig("dbms.transaction.timeout", "60s"); |
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.
Port this to other branches
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.
Most things looks good, just some smaller comments and questions
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 |
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.
No I don't think so, as Neo 4.x is supposed to be run with Java 11?
@@ -20,7 +19,7 @@ jar { | |||
} | |||
|
|||
compileKotlin { | |||
kotlinOptions.jvmTarget = "1.8" | |||
kotlinOptions.jvmTarget = "17" |
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.
Yes, but in the other branches 4.2, 4.3 and 4.4, I guess you should update it to 11 rather than 17.
@@ -48,7 +47,7 @@ dependencies { | |||
// implementation group: 'commons-codec', name: 'commons-codec', version: '1.14' | |||
implementation group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0' | |||
implementation group: 'org.hdrhistogram', name: 'HdrHistogram', version: '2.1.9' | |||
implementation group: 'org.neo4j.driver', name: 'neo4j-java-driver', version: '4.0.0' | |||
compileOnly group: 'org.neo4j.driver', name: 'neo4j-java-driver-slim', version: '4.4.3' |
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.
What do you mean with 'only in other branches'? I'm not sure I follow...
What
Fetches the dev neo4j container from TeamCity.
Why
Some tests rely on the neo4j docker container, which is not published until the database is released. Those tests were being ignored in the CI. This way we can develop more reliably.
This container will be available only for PRs coming from internal contributors.