Skip to content

Commit

Permalink
De-ignored tests and solve various CI error
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed Feb 10, 2025
1 parent 0e90b5a commit 66dd095
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 21 deletions.
1 change: 0 additions & 1 deletion extended-it/src/test/java/apoc/couchbase/CouchbaseIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import static org.junit.Assert.fail;
import static org.neo4j.test.assertion.Assert.assertEventually;

@Ignore
public class CouchbaseIT {

private static int numberConnections = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import static org.neo4j.configuration.GraphDatabaseSettings.SYSTEM_DATABASE_NAME;
import static org.neo4j.test.assertion.Assert.assertEventually;

@Ignore
public class CypherProceduresClusterRoutingTest {
private static final long TIMEOUT = 30L;
private static final int NUM_CORES = 3;
Expand Down Expand Up @@ -64,7 +63,6 @@ public static void bringDownCluster() {


@Test
@Ignore
public void testSetupAndDropCustomsWithUseSystemClause() {

// create a custom procedure and function for each member
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
* @since 13.02.19
*/
// TODO Investigate why this test is not working. Possibly increase timeout for container
@Ignore
public class MetricsTest {

private static Neo4jContainerExtension neo4jContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import static org.junit.Assert.*;
import static org.neo4j.configuration.GraphDatabaseSettings.SYSTEM_DATABASE_NAME;

@Ignore
public class UUIDClusterRoutingTest {
private static final int NUM_CORES = 4;
private static TestcontainersCausalCluster cluster;
Expand Down
47 changes: 36 additions & 11 deletions extended/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,37 @@ dependencies {
compileOnly sourceSets.main.java
testImplementation sourceSets.main.java


apt project(':processor')
apt group: 'org.neo4j', name: 'neo4j', version: neo4jVersionEffective // mandatory to run @ServiceProvider based META-INF code generation

antlr "org.antlr:antlr4:4.13.2", {
exclude group: 'org.glassfish'
exclude group: 'com.ibm.icu'
exclude group: 'org.abego.treelayout'
}

def withoutServers = {
exclude group: 'org.eclipse.jetty'
exclude group: 'org.eclipse.jetty.aggregate'
exclude group: 'org.apache.hive', module: 'hive-service'
exclude group: 'org.eclipse.jetty.http2'
exclude group: 'org.eclipse.jetty.ee8'
}

def withoutJacksons = {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
}

implementation group: 'org.neo4j.community', name: 'it-test-support', version: neo4jVersionEffective,withoutServers // , classifier: "tests"
implementation group: 'org.neo4j', name: 'log-test-utils', version: neo4jVersionEffective,withoutServers
implementation group: 'org.neo4j', name: 'neo4j-common', version: neo4jVersionEffective, classifier: "tests",withoutServers
implementation group: 'org.neo4j', name: 'neo4j-kernel', version: neo4jVersionEffective, classifier: "tests",withoutServers
implementation group: 'org.neo4j', name: 'neo4j-io', version: neo4jVersionEffective, classifier: "tests",withoutServers
implementation group: 'org.apache.hadoop', name: 'hadoop-minicluster', version: '3.4.0'
implementation group: 'org.apache.hadoop', name: 'hadoop-common', version: '3.4.0'
implementation group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: '3.4.0'

apt project(':processor')
apt group: 'org.neo4j', name: 'neo4j', version: neo4jVersionEffective // mandatory to run @ServiceProvider based META-INF code generation

antlr "org.antlr:antlr4:4.13.2", {
exclude group: 'org.glassfish'
exclude group: 'com.ibm.icu'
exclude group: 'org.abego.treelayout'
}

// These will be dependencies packaged with the .jar
implementation project(':common')
Expand Down Expand Up @@ -136,6 +146,9 @@ dependencies {

// These dependencies affect the tests only, they will not be packaged in the resulting .jar
testImplementation project(':test-utils')
// , {
//
// }
testImplementation project(':core')
testImplementation group: 'org.apache.poi', name: 'poi', version: '5.1.0', {
exclude group: 'org.apache.commons', module: 'commons-collections4'
Expand Down Expand Up @@ -165,12 +178,24 @@ dependencies {
exclude group: 'org.apache.commons', module: 'commons-collections4'
}

configurations.all {
implementation group: 'org.neo4j.community', name: 'it-test-support', version: neo4jVersionEffective,withoutServers // , classifier: "tests"
implementation group: 'org.neo4j', name: 'log-test-utils', version: neo4jVersionEffective,withoutServers
implementation group: 'org.neo4j', name: 'neo4j-common', version: neo4jVersionEffective, classifier: "tests",withoutServers
implementation group: 'org.neo4j', name: 'neo4j-kernel', version: neo4jVersionEffective, classifier: "tests",withoutServers
implementation group: 'org.neo4j', name: 'neo4j-io', version: neo4jVersionEffective, classifier: "tests",withoutServers
implementation group: 'org.apache.hadoop', name: 'hadoop-minicluster', version: '3.4.0'
implementation group: 'org.apache.hadoop', name: 'hadoop-common', version: '3.4.0'
implementation group: 'org.apache.hadoop', name: 'hadoop-hdfs', version: '3.4.0'

configurations.configureEach {
exclude group: 'org.slf4j', module: 'slf4j-nop'
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'org.eclipse.jetty.http2'
exclude group: 'org.eclipse.jetty.ee8'
}
}


java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
Expand Down
3 changes: 2 additions & 1 deletion extended/src/main/java/apoc/ml/OpenAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import apoc.ApocConfig;
import apoc.Extended;
import apoc.result.MapResult;
import apoc.util.ExtendedMapUtils;
import apoc.util.ExtendedUtil;
import apoc.util.JsonUtil;
import apoc.util.Util;
Expand Down Expand Up @@ -225,7 +226,7 @@ public Stream<MapResult> completion(@Name("prompt") String prompt, @Name("api_ke
public Stream<MapResult> chatCompletion(@Name("messages") List<Map<String, Object>> messages, @Name("api_key") String apiKey, @Name(value = "configuration", defaultValue = "{}") Map<String, Object> configuration) throws Exception {
boolean failOnError = isFailOnError(configuration);
if (checkNullInput(messages, failOnError)) return Stream.empty();
messages = messages.stream().filter(MapUtils::isNotEmpty).toList();
messages = messages.stream().filter(ExtendedMapUtils::isNotEmpty).toList();
if (checkEmptyInput(messages, failOnError)) return Stream.empty();
configuration.putIfAbsent("model", GPT_4O_MODEL);
return executeRequest(apiKey, configuration, "chat/completions", (String) configuration.get("model"), "messages", messages, "$", apocConfig, urlAccessChecker)
Expand Down
4 changes: 4 additions & 0 deletions extended/src/main/java/apoc/util/ExtendedMapUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ public static int size(final Map<?, ?> map) {
public static boolean isEmpty(final Map<?,?> map) {
return map == null || map.isEmpty();
}

public static boolean isNotEmpty(final Map<?,?> map) {
return !isEmpty(map);
}
}
1 change: 0 additions & 1 deletion extended/src/test/java/apoc/export/csv/ExportCsvTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
* @author mh
* @since 22.05.16
*/
@Ignore("It fails due to `java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet`")
public class ExportCsvTest {
private static final String EXPECTED = String.format("\"_id\",\"_labels\",\"age\",\"city\",\"kids\",\"male\",\"name\",\"street\",\"_start\",\"_end\",\"_type\"%n" +
"\"0\",\":User:User1\",\"42\",\"\",\"[\"\"a\"\",\"\"b\"\",\"\"c\"\"]\",\"true\",\"foo\",\"\",,,%n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static apoc.util.TestUtil.testResult;
import static org.junit.Assert.assertEquals;

@Ignore("It fails due to `java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet`")
public class ParquetHdfsTest {

private static final File directory = new File("target/hdfs-parquet-import");
Expand Down
2 changes: 0 additions & 2 deletions extended/src/test/java/apoc/load/LoadHdfsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.AfterAll;
Expand All @@ -29,7 +28,6 @@
import static apoc.util.TestUtil.testResult;
import static org.junit.Assert.assertEquals;

@Ignore("It fails due to `java.lang.NoClassDefFoundError: org/eclipse/jetty/servlet`")
public class LoadHdfsTest {

@ClassRule
Expand Down

0 comments on commit 66dd095

Please sign in to comment.