This is an automated email from the ASF dual-hosted git repository.
jgemignani pushed a commit to branch PG13
in repository https://gitbox.apache.org/repos/asf/age.git
The following commit(s) were added to refs/heads/PG13 by this push:
new f32667a6 [PG13] Update CI workflows (#775)
f32667a6 is described below
commit f32667a61e2ce2b605e91e70ab5977922fcbfce9
Author: Muhammad Taha Naveed <[email protected]>
AuthorDate: Wed Mar 29 02:47:19 2023 +0500
[PG13] Update CI workflows (#775)
* Implement CI test for jdbc driver
- Modify jdbc driver to pull correct AGE image from docker hub.
- Also added logger to display the result of tests i.e. passing,
failing etc.
* Implement CI test for nodejs driver
- Modified connection params to connect with running docker instance.
- Fixed failing tests by modifying the expected outcomes.
- Include asf header as key/value to avoid EJSONPARSE error.
"//" key will never be used by npm for any purpose,
and is reserved for comments.
* Update docker-compose to pull age image from corresponding pg version tag
* Update antlr 4.9.3 => 4.11.1 in requirements.txt
- This change was in master branch but not in PG13.
---
.github/workflows/jdbc-driver.yaml | 32 +++++++++++
.github/workflows/nodejs-driver.yaml | 36 +++++++++++++
drivers/docker-compose.yml | 2 +-
drivers/jdbc/lib/build.gradle.kts | 21 +++++++-
.../org/apache/age/jdbc/BaseDockerizedTest.java | 2 +-
drivers/nodejs/package.json | 37 +++++++------
drivers/nodejs/test/index.test.ts | 59 ++++++++++++++-------
drivers/python/requirements.txt | Bin 158 -> 160 bytes
8 files changed, 146 insertions(+), 43 deletions(-)
diff --git a/.github/workflows/jdbc-driver.yaml
b/.github/workflows/jdbc-driver.yaml
new file mode 100644
index 00000000..5754d835
--- /dev/null
+++ b/.github/workflows/jdbc-driver.yaml
@@ -0,0 +1,32 @@
+name: JDBC Driver Tests
+
+on:
+ push:
+ branches: [ "PG13" ]
+
+ pull_request:
+ branches: [ "PG13" ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ distributions: ['zulu', 'temurin', 'microsoft']
+
+ defaults:
+ run:
+ working-directory: drivers/jdbc
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Set up Java
+ uses: actions/setup-java@v3
+ with:
+ distribution: ${{ matrix.distributions }}
+ java-version: '17'
+
+ - name: Build and Test
+ run: gradle build
\ No newline at end of file
diff --git a/.github/workflows/nodejs-driver.yaml
b/.github/workflows/nodejs-driver.yaml
new file mode 100644
index 00000000..c3f83975
--- /dev/null
+++ b/.github/workflows/nodejs-driver.yaml
@@ -0,0 +1,36 @@
+name: Nodejs Driver Tests
+
+on:
+ push:
+ branches: [ "PG13" ]
+
+ pull_request:
+ branches: [ "PG13" ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ defaults:
+ run:
+ working-directory: drivers/nodejs/
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Run apache/age docker image
+ run: docker-compose up -d
+
+ - name: Set up Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: latest
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Build
+ run: npm run build
+
+ - name: Test
+ run: npm test
\ No newline at end of file
diff --git a/drivers/docker-compose.yml b/drivers/docker-compose.yml
index 668eb19d..d3c29d9f 100644
--- a/drivers/docker-compose.yml
+++ b/drivers/docker-compose.yml
@@ -1,7 +1,7 @@
version: "3.3"
services:
db:
- image: apache/age
+ image: apache/age:PG13_latest
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=agens
diff --git a/drivers/jdbc/lib/build.gradle.kts
b/drivers/jdbc/lib/build.gradle.kts
index 86af61ac..f363cfe2 100644
--- a/drivers/jdbc/lib/build.gradle.kts
+++ b/drivers/jdbc/lib/build.gradle.kts
@@ -17,6 +17,9 @@
* under the License.
*/
+import org.gradle.api.tasks.testing.logging.TestExceptionFormat
+import org.gradle.api.tasks.testing.logging.TestLogEvent
+
plugins {
`java-library`
antlr
@@ -36,6 +39,9 @@ dependencies {
testImplementation("org.testcontainers:testcontainers:1.15.3")
testImplementation("org.postgresql:postgresql:42.2.20")
+
+ testImplementation("org.slf4j:slf4j-api:1.7.5")
+ testImplementation("org.slf4j:slf4j-simple:1.7.5")
}
tasks.generateGrammarSource {
@@ -50,5 +56,16 @@ tasks.generateGrammarSource {
}
tasks.test {
- useJUnitPlatform()
-}
+ useJUnitPlatform();
+ testLogging {
+ // set options for log level LIFECYCLE
+ events(TestLogEvent.FAILED,
+ TestLogEvent.PASSED,
+ TestLogEvent.SKIPPED,
+ TestLogEvent.STANDARD_OUT)
+ exceptionFormat = TestExceptionFormat.FULL
+ showExceptions = true
+ showCauses = true
+ showStackTraces = true
+ }
+}
\ No newline at end of file
diff --git
a/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/BaseDockerizedTest.java
b/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/BaseDockerizedTest.java
index 8024f1a8..2a9e7865 100644
--- a/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/BaseDockerizedTest.java
+++ b/drivers/jdbc/lib/src/test/java/org/apache/age/jdbc/BaseDockerizedTest.java
@@ -51,7 +51,7 @@ public class BaseDockerizedTest {
public void beforeAll() throws Exception {
String CORRECT_DB_PASSWORDS = "postgres";
agensGraphContainer = new GenericContainer<>(DockerImageName
- .parse("sorrell/agensgraph-extension-alpine:latest"))
+ .parse("apache/age:PG13_latest"))
.withEnv("POSTGRES_PASSWORD", CORRECT_DB_PASSWORDS)
.withExposedPorts(5432);
agensGraphContainer.start();
diff --git a/drivers/nodejs/package.json b/drivers/nodejs/package.json
index db385eef..9f88bc2b 100644
--- a/drivers/nodejs/package.json
+++ b/drivers/nodejs/package.json
@@ -1,23 +1,22 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
{
+ "//": [
+ "Licensed to the Apache Software Foundation (ASF) under one",
+ "or more contributor license agreements. See the NOTICE file",
+ "distributed with this work for additional information",
+ "regarding copyright ownership. The ASF licenses this file",
+ "to you under the Apache License, Version 2.0 (the",
+ "\"License\"); you may not use this file except in compliance",
+ "with the License. You may obtain a copy of the License at",
+ "",
+ "http://www.apache.org/licenses/LICENSE-2.0",
+ "",
+ "Unless required by applicable law or agreed to in writing,",
+ "software distributed under the License is distributed on an",
+ "\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY",
+ "KIND, either express or implied. See the License for the",
+ "specific language governing permissions and limitations",
+ "under the License."
+ ],
"name": "pg-age",
"version": "1.0.0-alpha",
"main": "dist/index.js",
diff --git a/drivers/nodejs/test/index.test.ts
b/drivers/nodejs/test/index.test.ts
index 60f9e2fe..ea386dda 100644
--- a/drivers/nodejs/test/index.test.ts
+++ b/drivers/nodejs/test/index.test.ts
@@ -24,8 +24,8 @@ const config = {
user: 'postgres',
host: '127.0.0.1',
database: 'postgres',
- password: 'postgres',
- port: 25432
+ password: 'agens',
+ port: 5432
}
const testGraphName = 'age-test'
@@ -59,25 +59,44 @@ describe('Pre-connected Connection', () => {
$$) as (a agtype);
`)!
expect(results.rows).toStrictEqual(
- [{
- a: {
- id: 844424930131969,
- label: 'Part',
- properties: { part_num: '123' }
+ [
+ {
+ a : new Map(Object.entries({
+ id: 844424930131969,
+ label: 'Part',
+ properties: new Map(Object.entries({
+ part_num: '123'
+ }))
+ })),
+ },
+ {
+ a : new Map(Object.entries({
+ id: 844424930131970,
+ label: 'Part',
+ properties: new Map(Object.entries({
+ part_num: '345'
+ }))
+ })),
+ },
+ {
+ a : new Map(Object.entries({
+ id: 844424930131971,
+ label: 'Part',
+ properties: new Map(Object.entries({
+ part_num: '456'
+ }))
+ })),
+ },
+ {
+ a : new Map(Object.entries({
+ id: 844424930131972,
+ label: 'Part',
+ properties: new Map(Object.entries({
+ part_num: '789'
+ }))
+ })),
}
- }, {
- a: {
- id: 844424930131970,
- label: 'Part',
- properties: { part_num: '345' }
- }
- }, {
- a: {
- id: 844424930131971,
- label: 'Part',
- properties: { part_num: '456' }
- }
- }, { a: { id: 844424930131972, label: 'Part', properties: { part_num:
'789' } } }]
+ ]
)
})
})
diff --git a/drivers/python/requirements.txt b/drivers/python/requirements.txt
index 918763cb..3aff61d8 100644
Binary files a/drivers/python/requirements.txt and
b/drivers/python/requirements.txt differ