Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/jdbc-driver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: JDBC Driver Tests

on:
push:
branches: [ "PG12" ]

pull_request:
branches: [ "PG12" ]

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
36 changes: 36 additions & 0 deletions .github/workflows/nodejs-driver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Nodejs Driver Tests

on:
push:
branches: [ "PG12" ]

pull_request:
branches: [ "PG12" ]

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
2 changes: 1 addition & 1 deletion drivers/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.3"
services:
db:
image: apache/age
image: apache/age:PG12_latest
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=agens
Expand Down
21 changes: 19 additions & 2 deletions drivers/jdbc/lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void afterAll() throws Exception {
public void beforeAll() throws Exception {
String CORRECT_DB_PASSWORDS = "postgres";
agensGraphContainer = new GenericContainer<>(DockerImageName
.parse("sorrell/agensgraph-extension-alpine:latest"))
.parse("apache/age:PG12_latest"))
.withEnv("POSTGRES_PASSWORD", CORRECT_DB_PASSWORDS)
.withExposedPorts(5432);
agensGraphContainer.start();
Expand Down
37 changes: 18 additions & 19 deletions drivers/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
59 changes: 39 additions & 20 deletions drivers/nodejs/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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' } } }]
]
)
})
})