Skip to content
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

GitHub action fixes timeout error #4179

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/actions/test-gradle-project/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ runs:
- uses: ./.github/actions/setup-gradle-cache
- name: Run compile tests
shell: bash
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI :${{inputs.project-name}}:compileJava :${{inputs.project-name}}:compileTestJava
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4JVERSION -Pneo4jDockerEeOverride=$NEO4J_ENTERPRISE_IMAGE -Pneo4jDockerCeOverride=$NEO4J_COMMUNITY_IMAGE :${{inputs.project-name}}:compileJava :${{inputs.project-name}}:compileTestJava
- name: Run tests
shell: bash
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI :${{inputs.project-name}}:check --parallel
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4JVERSION -Pneo4jDockerEeOverride=$NEO4J_ENTERPRISE_IMAGE -Pneo4jDockerCeOverride=$NEO4J_COMMUNITY_IMAGE :${{inputs.project-name}}:check --parallel
- name: Archive test results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: ${{inputs.project-name}}-test-results
Expand Down
60 changes: 48 additions & 12 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ on:
branches: [ "dev" ]

env:
CODEARTIFACT_DOWNLOAD_URL: ${{ secrets.CODEARTIFACT_DOWNLOAD_URL }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CODEARTIFACT_URL: ${{ secrets.CODEARTIFACT_URL }}
CODEARTIFACT_USERNAME: ${{ secrets.CODEARTIFACT_USERNAME }}
ECR_NEO4J_DOCKER_URL: ${{ secrets.ECR_NEO4J_DOCKER_URL }}


jobs:
Expand Down Expand Up @@ -40,26 +42,34 @@ jobs:
- uses: ./.github/actions/setup-jdk
- uses: ./.github/actions/setup-gradle-cache

- name: Determine latest neo4j CI version
- name: Determine Remote Maven Repository, Neo4j Version and Neo4j Docker Images
run: |
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
echo "neo4j_version_base=$neo4j_version_base"
NEO4J_VERSION_CI=`aws codeartifact list-package-versions --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --repository ci-live --format maven --namespace org.neo4j --package neo4j --sort-by PUBLISHED_TIME --query "versions[?starts_with(version,'$neo4j_version_base')] | [0].version" | tr -d '" '`
echo "NEO4J_VERSION_CI=$NEO4J_VERSION_CI" >> "$GITHUB_ENV"
echo "Found NEO4j_VERSION_CI=$NEO4J_VERSION_CI"
echo "Analyzing current branch BRANCH_NAME=$BRANCH_NAME"
if [[ $BRANCH_NAME =~ ^5.[0-9]+$ ]]; then
NEO4JVERSION="$neo4j_version_base"
else
NEO4JVERSION="$neo4j_version_base-SNAPSHOT"
CODEARTIFACT_DOWNLOAD_URL="$CODEARTIFACT_URL/ci-live"
echo "CODEARTIFACT_DOWNLOAD_URL=$CODEARTIFACT_DOWNLOAD_URL"
echo "CODEARTIFACT_DOWNLOAD_URL=$CODEARTIFACT_DOWNLOAD_URL" >> "$GITHUB_ENV"
fi
echo "NEO4JVERSION=$NEO4JVERSION"
echo "NEO4JVERSION=$NEO4JVERSION" >> "$GITHUB_ENV"

- name: Compile Java
run: |
chmod +x gradlew
./gradlew --no-daemon --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI --init-script init.gradle clean
./gradlew --no-daemon --info -Pneo4jVersionOverride=$NEO4JVERSION --init-script init.gradle clean
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Compile
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI compileJava compileTestJava
run: ./gradlew --info -Pneo4jVersionOverride=$NEO4JVERSION compileJava compileTestJava

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Expand Down Expand Up @@ -99,18 +109,44 @@ jobs:
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}

- name: Determine latest neo4j CI version
- name: Determine Remote Maven Repository, Neo4j Version and Neo4j Docker Images
run: |
neo4j_version_base=$(grep -e "neo4jVersion = .*" build.gradle | cut -d '=' -f 2 | tr -d \'\" | tr -d ' ')
echo "neo4j_version_base=$neo4j_version_base"
NEO4J_VERSION_CI=`aws codeartifact list-package-versions --domain build-service-live --domain-owner ${{ secrets.AWS_ACCOUNT_ID }} --repository ci-live --format maven --namespace org.neo4j --package neo4j --sort-by PUBLISHED_TIME --query "versions[?starts_with(version,'$neo4j_version_base')] | [0].version" | tr -d '" '`
echo "NEO4J_VERSION_CI=$NEO4J_VERSION_CI" >> "$GITHUB_ENV"
echo "Found NEO4j_VERSION_CI=$NEO4J_VERSION_CI"
echo "Analyzing current branch BRANCH_NAME=$BRANCH_NAME"
if [[ $BRANCH_NAME =~ ^5.[0-9]+$ ]]; then
NEO4JVERSION="$neo4j_version_base"
NEO4J_ENTERPRISE_IMAGE="neo4j:$NEO4JVERSION-enterprise"
NEO4J_COMMUNITY_IMAGE="neo4j:$NEO4JVERSION-community"
echo "DOCKER_REMOTE=Dockerhub" >> "$GITHUB_ENV"
else
NEO4JVERSION="$neo4j_version_base-SNAPSHOT"
NEO4J_ENTERPRISE_IMAGE="${{ secrets.ECR_NEO4J_DOCKER_URL }}/build-service/neo4j:$neo4j_version_base-enterprise-debian-nightly"
NEO4J_COMMUNITY_IMAGE="${{ secrets.ECR_NEO4J_DOCKER_URL }}/build-service/neo4j:$neo4j_version_base-community-debian-nightly"
echo "DOCKER_REMOTE=ECR" >> "$GITHUB_ENV"
CODEARTIFACT_DOWNLOAD_URL="$CODEARTIFACT_URL/ci-live"
echo "CODEARTIFACT_DOWNLOAD_URL=$CODEARTIFACT_DOWNLOAD_URL"
echo "CODEARTIFACT_DOWNLOAD_URL=$CODEARTIFACT_DOWNLOAD_URL" >> "$GITHUB_ENV"
fi
echo "NEO4JVERSION=$NEO4JVERSION"
echo "NEO4JVERSION=$NEO4JVERSION" >> "$GITHUB_ENV"
echo "NEO4J_ENTERPRISE_IMAGE=$NEO4J_ENTERPRISE_IMAGE"
echo "NEO4J_ENTERPRISE_IMAGE=$NEO4J_ENTERPRISE_IMAGE" >> "$GITHUB_ENV"
echo "NEO4J_COMMUNITY_IMAGE=$NEO4J_COMMUNITY_IMAGE"
echo "NEO4J_COMMUNITY_IMAGE=$NEO4J_COMMUNITY_IMAGE" >> "$GITHUB_ENV"

- name: Login to ECR
if: env.DOCKER_REMOTE == 'ECR'
uses: docker/login-action@v3
with:
registry: ${{ secrets.ECR_NEO4J_DOCKER_URL }}
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

- name: Init gradle
run: |
chmod +x gradlew
./gradlew --info -Pneo4jVersionOverride=$NEO4J_VERSION_CI --init-script init.gradle
./gradlew --info -Pneo4jVersionOverride=$NEO4JVERSION --init-script init.gradle

- name: Run ${{ matrix.project }} tests
uses: ./.github/actions/test-gradle-project
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "apoc-core"]
path = apoc-core
url = https://github.com/neo4j/apoc
branch = 5.22
branch = dev
2 changes: 1 addition & 1 deletion apoc-core
Submodule apoc-core updated 41 files
+0 −10 .github/actions/gradle-command-on-pr/action.yaml
+0 −27 .github/actions/test-gradle-project/action.yaml
+47 −58 .github/workflows/CI.yaml
+0 −3 .github/workflows/generateLicenses-command.yml
+0 −3 .github/workflows/spotlessApply-command.yml
+16 −14 build.gradle
+5 −5 common/build.gradle
+0 −10 common/src/main/java/apoc/ApocConfig.java
+13 −4 common/src/main/java/apoc/export/util/ExportConfig.java
+10 −1 common/src/main/java/apoc/export/util/FormatUtils.java
+31 −0 common/src/main/java/apoc/util/Util.java
+4 −3 common/src/main/java/org/neo4j/cypher/export/DatabaseSubGraph.java
+5 −5 core/build.gradle
+16 −9 core/src/main/java/apoc/CoreApocGlobalComponents.java
+11 −2 core/src/main/java/apoc/convert/Json.java
+32 −17 core/src/main/java/apoc/export/csv/CsvFormat.java
+34 −0 core/src/main/java/apoc/export/csv/CustomCSVWriter.java
+2 −2 core/src/main/java/apoc/meta/Meta.java
+2 −2 core/src/main/java/apoc/stats/DegreeDistribution.java
+1 −1 core/src/main/java/apoc/stats/DegreeUtil.java
+48 −0 core/src/main/java/apoc/text/Strings.java
+18 −0 core/src/main/java/apoc/trigger/Trigger.java
+15 −24 core/src/main/java/apoc/trigger/TriggerHandler.java
+4 −3 core/src/main/java/apoc/warmup/Warmup.java
+187 −45 core/src/test/java/apoc/convert/PathsToJsonTreeTest.java
+395 −65 core/src/test/java/apoc/export/csv/ExportCsvTest.java
+142 −3 core/src/test/java/apoc/text/StringsTest.java
+31 −10 core/src/test/java/apoc/trigger/TriggerDisabledTest.java
+6 −2 core/src/test/java/apoc/trigger/TriggerRestartTest.java
+7 −2 core/src/test/java/apoc/trigger/TriggerTest.java
+1 −1 core/src/test/java/apoc/util/LogsUtilTest.java
+38 −0 core/src/test/java/apoc/util/UtilTest.java
+1 −0 it/src/test/java/apoc/it/core/ApocSplitTest.java
+1 −1 it/src/test/java/apoc/it/core/ExportCsvS3Test.java
+54 −25 it/src/test/java/apoc/it/core/WarmupEnterpriseTest.java
+5 −5 processor/build.gradle
+3 −3 readme.adoc
+4 −4 teamcity-repository.gradle
+5 −5 test-utils/build.gradle
+0 −1 test-utils/src/main/java/apoc/util/TestContainerUtil.java
+10 −1 test-utils/src/main/java/org/neo4j/test/rule/DbmsRule.java
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ downloadLicenses {

allprojects {
group = 'org.neo4j.procedure'
version = '5.23.0'
version = '5.25.0'
archivesBaseName = 'apoc'
description = """neo4j-apoc-procedures"""
}
Expand Down Expand Up @@ -86,13 +86,13 @@ subprojects {
archiveClassifier = 'javadoc'
}
test {
//exclude '**/CypherProceduresClusterTest.class'//, '**/AtomicTest.class'
include '**/MissingExtraDependenciesTest.class'//, '**/AtomicTest.class'

// neo4jDockerImage system property is used in TestContainerUtil
systemProperties 'user.language' : 'en' ,
'user.country' : 'US',
'neo4jDockerImage' : System.getProperty("NEO4JVERSION") ? 'neo4j:' + System.getProperty("NEO4JVERSION") + '-enterprise-debian' : 'neo4j:5.23.0-enterprise',
'neo4jCommunityDockerImage': System.getProperty("NEO4JVERSION") ? 'neo4j:' + System.getProperty("NEO4JVERSION") + '-debian' : 'neo4j:5.23.0',
'neo4jDockerImage': project.hasProperty("neo4jDockerEeOverride") ? project.getProperty("neo4jDockerEeOverride") : 'neo4j:5.25.0-enterprise-debian',
'neo4jCommunityDockerImage': project.hasProperty("neo4jDockerCeOverride") ? project.getProperty("neo4jDockerCeOverride") : 'neo4j:5.25.0-debian',
'coreDir': 'apoc-core/core',
'testDockerBundle': false

Expand Down Expand Up @@ -151,9 +151,9 @@ subprojects {

ext {
// NB: due to version.json generation by parsing this file, the next line must not have any if/then/else logic
neo4jVersion = "5.23.0"
neo4jVersion = "5.25.0"
// instead we apply the override logic here
neo4jVersionEffective = project.hasProperty("neo4jVersionOverride") ? project.getProperty("neo4jVersionOverride") : neo4jVersion
testContainersVersion = '1.18.3'
testContainersVersion = '1.19.1'
apacheArrowVersion = '15.0.0'
}
2 changes: 1 addition & 1 deletion docs/asciidoc/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ asciidoc:
docs-version: "5.0"
branch: "5.0"
apoc-release-absolute: "5.0"
apoc-release: "5.22.0"
apoc-release: "5.24.0"
2 changes: 2 additions & 0 deletions docs/asciidoc/modules/ROOT/partials/neo4j-server.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The version compatibility matrix explains the mapping between Neo4j and APOC ver
[opts=header]
|===
|apoc version | neo4j version
| https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/5.24.0[5.24.0^] | 5.24.0 (5.24.x)
| https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/5.23.0[5.23.0^] | 5.23.0 (5.23.x)
| https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/5.22.0[5.22.0^] | 5.22.0 (5.22.x)
| https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/5.21.0[5.21.0^] | 5.21.0 (5.21.x)
| https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/5.20.0[5.20.0^] | 5.20.0 (5.20.x)
Expand Down
2 changes: 1 addition & 1 deletion docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ plugins {
id 'org.neo4j.doc.build.docbook' version '1.0-alpha12'
}

if (!project.hasProperty('apocVersion')) { ext.apocVersion = '5.22.0' }
if (!project.hasProperty('apocVersion')) { ext.apocVersion = '5.25.0' }

ext {
versionParts = apocVersion.split('-')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static apoc.load.LoadHtml.SELENIUM_MISSING_DEPS_ERROR;
import static apoc.mongodb.MongoDBUtils.MONGO_MISSING_DEPS_ERROR;
import static apoc.redis.RedisConfig.REDIS_MISSING_DEPS_ERROR;
import static apoc.util.TestContainerUtil.createEnterpriseDB;
import static apoc.util.TestContainerUtil.createCommunityDB;
import static apoc.util.TestContainerUtil.testCall;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
Expand All @@ -35,7 +35,7 @@ public class MissingExtraDependenciesTest {

@BeforeClass
public static void setUp() throws Exception {
neo4jContainer = createEnterpriseDB(List.of(TestContainerUtil.ApocPackage.EXTENDED), true);
neo4jContainer = createCommunityDB(List.of(TestContainerUtil.ApocPackage.EXTENDED), true);
neo4jContainer.start();

session = neo4jContainer.getSession();
Expand Down
5 changes: 5 additions & 0 deletions extended-it/src/test/java/apoc/neo4j/docker/BoltTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.test.rule.DbmsRule;
import org.neo4j.test.rule.ImpermanentDbmsRule;
import org.testcontainers.containers.wait.strategy.Wait;

import java.time.Duration;
import java.time.LocalTime;
import java.time.OffsetTime;
import java.util.Arrays;
Expand Down Expand Up @@ -60,7 +62,10 @@ public class BoltTest {
@BeforeClass
public static void setUp() throws Exception {
neo4jContainer = createEnterpriseDB(List.of(ApocPackage.EXTENDED, ApocPackage.CORE), true).withInitScript("init_neo4j_bolt.cypher");
neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()
.withStartupTimeout(Duration.ofMinutes(10)));neo4jContainer.withStartupTimeout(Duration.ofMinutes(10));
neo4jContainer.start();

TestUtil.registerProcedure(db, Bolt.class, ExportCypher.class, Cypher.class, PathExplorer.class, GraphRefactoring.class);
BOLT_URL = getBoltUrl().replaceAll("'", "");
session = neo4jContainer.getSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import org.neo4j.driver.Record;
import org.neo4j.driver.Result;
import org.neo4j.driver.Session;
import org.testcontainers.containers.wait.strategy.Wait;

import java.time.Duration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand All @@ -32,6 +34,9 @@ public void checkForCoreAndExtended() {
try(Neo4jContainerExtension neo4jContainer = createEnterpriseDB(List.of(ApocPackage.CORE, ApocPackage.EXTENDED), true)
.withNeo4jConfig("dbms.transaction.timeout", "60s")
.withEnv(APOC_IMPORT_FILE_ENABLED, "true")) {
neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()
.withStartupTimeout(Duration.ofMinutes(10)));
neo4jContainer.withStartupTimeout(Duration.ofMinutes(10));
neo4jContainer.start();

Session session = neo4jContainer.getSession();
Expand All @@ -54,7 +59,9 @@ public void matchesSpreadsheet() {
try(Neo4jContainerExtension neo4jContainer = createEnterpriseDB(List.of(TestContainerUtil.ApocPackage.CORE, TestContainerUtil.ApocPackage.EXTENDED), true)
.withNeo4jConfig("dbms.transaction.timeout", "60s")
.withEnv(APOC_IMPORT_FILE_ENABLED, "true")) {

neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()
.withStartupTimeout(Duration.ofMinutes(10)));
neo4jContainer.withStartupTimeout(Duration.ofMinutes(10));
neo4jContainer.start();

Session session = neo4jContainer.getSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
import org.neo4j.driver.Session;
import org.neo4j.driver.types.Node;
import org.neo4j.driver.types.Relationship;
import org.testcontainers.containers.wait.strategy.Wait;

import java.io.File;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -63,12 +65,17 @@ public class CypherEnterpriseExtendedTest {

private static Neo4jContainerExtension neo4jContainer;
private static Session session;



@BeforeClass
public static void beforeAll() {
// We build the project, the artifact will be placed into ./build/libs
neo4jContainer = createEnterpriseDB(List.of(ApocPackage.EXTENDED), true)
.withNeo4jConfig("dbms.transaction.timeout", "60s");
neo4jContainer.setWaitStrategy(Wait.defaultWaitStrategy()
.withStartupTimeout(Duration.ofMinutes(10)));
neo4jContainer.withStartupTimeout(Duration.ofMinutes(10));
neo4jContainer.start();
session = neo4jContainer.getSession();

Expand Down
Loading
Loading