Skip to content

Commit 4852b55

Browse files
committed
add ADBC tests for Go, C#, Java, Kotlin, Python, Clojure
1 parent 3e67c8e commit 4852b55

37 files changed

Lines changed: 2201 additions & 173 deletions

.github/workflows/test.yml

Lines changed: 98 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -12,110 +12,112 @@ jobs:
1212
runs-on: ubuntu-latest
1313
timeout-minutes: 30
1414

15-
services:
16-
xtdb:
17-
image: ghcr.io/xtdb/xtdb:edge
18-
ports:
19-
- 5432:5432
20-
- 8080:8080
21-
options: >-
22-
--health-cmd "curl --silent --fail http://localhost:8080/healthz/alive || exit 1"
23-
--health-interval 10s
24-
--health-timeout 5s
25-
--health-retries 5
26-
27-
container:
28-
image: archlinux:base
29-
options: --user root
30-
3115
steps:
3216
- name: Checkout Repository
3317
uses: actions/checkout@v4
3418

35-
- name: Install Essential System Dependencies
36-
run: |
37-
chmod +x $GITHUB_WORKSPACE/.devcontainer/install-system-deps.sh
38-
$GITHUB_WORKSPACE/.devcontainer/install-system-deps.sh essential
39-
40-
- name: Create Test User
41-
run: |
42-
useradd -m -s /bin/bash -u 1001 runner
43-
echo "runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
44-
45-
- name: Install and configure mise
46-
run: |
47-
cp $GITHUB_WORKSPACE/.devcontainer/setup-mise.sh /tmp/setup-mise.sh
48-
chmod +x /tmp/setup-mise.sh
49-
su - runner -c "/tmp/setup-mise.sh runner $GITHUB_WORKSPACE"
50-
rm /tmp/setup-mise.sh
51-
52-
- name: Install Language Runtimes
53-
run: |
54-
chown -R runner:runner $GITHUB_WORKSPACE
55-
su - runner -c "cd $GITHUB_WORKSPACE && ~/.local/bin/mise install"
56-
57-
- name: Install Language-Specific Tools
58-
run: |
59-
su - runner -c "cd $GITHUB_WORKSPACE && for dir in python csharp babashka; do
60-
if [ -d \"\$dir\" ] && [ -f \"\$dir/.mise.toml\" ]; then
61-
echo \"Installing mise tools for \$dir...\"
62-
(cd \"\$dir\" && ~/.local/bin/mise install) || echo \"Warning: Failed to install tools for \$dir\"
63-
fi
64-
done"
65-
66-
- name: Setup Language Runtime Packages
67-
run: |
68-
# Install system packages for Ruby, Elixir, PHP
69-
$GITHUB_WORKSPACE/.devcontainer/install-system-deps.sh languages
70-
71-
- name: Setup Language Tools (Clojure, Elixir, PHP)
72-
run: |
73-
cp $GITHUB_WORKSPACE/.devcontainer/setup-language-tools.sh /tmp/setup-language-tools.sh
74-
chmod +x /tmp/setup-language-tools.sh
75-
su - runner -c "/tmp/setup-language-tools.sh all"
76-
rm /tmp/setup-language-tools.sh
77-
78-
- name: Install Language Dependencies
79-
run: |
80-
su - runner -c "cd $GITHUB_WORKSPACE && \
81-
eval \"\$(~/.local/bin/mise activate bash)\" && \
82-
for dir in python node ruby go elixir php; do
83-
if [ -d \"\$dir\" ]; then
84-
echo \"Installing dependencies for \$dir...\"
85-
(cd \"\$dir\" && ~/.local/bin/mise run deps 2>&1) || echo \"Warning: Failed to install deps for \$dir\"
86-
fi
87-
done"
88-
89-
- name: Wait for XTDB to be Ready
19+
- name: Start XTDB with Flight SQL
9020
run: |
21+
# Start XTDB container with custom config that enables Flight SQL
22+
docker run -d --name xtdb \
23+
-p 5432:5432 -p 8080:8080 -p 9833:9833 \
24+
-v ${{ github.workspace }}/.github/xtdb-ci.yaml:/config/xtdb.yaml:ro \
25+
ghcr.io/xtdb/xtdb:edge \
26+
-f /config/xtdb.yaml
27+
28+
# Wait for XTDB to be ready
9129
for i in {1..60}; do
92-
if curl --silent --fail http://xtdb:8080/healthz/alive; then
30+
if curl --silent --fail http://localhost:8080/healthz/alive 2>/dev/null; then
9331
echo "XTDB is ready"
94-
exit 0
32+
break
9533
fi
34+
echo "Waiting for XTDB... ($i/60)"
9635
sleep 2
9736
done
98-
echo "XTDB did not start in time" && exit 1
9937
100-
- name: Verify XTDB Connection
101-
run: |
102-
$GITHUB_WORKSPACE/.devcontainer/install-system-deps.sh postgres
103-
su - runner -c "psql -h xtdb -U xtdb -d xtdb -c 'SELECT 1'" || echo "PostgreSQL connection test failed"
104-
env:
105-
PGPASSWORD: xtdb
106-
107-
- name: Run All Tests
108-
env:
109-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
# Verify it started
39+
if ! curl --silent --fail http://localhost:8080/healthz/alive; then
40+
echo "XTDB did not start in time"
41+
docker logs xtdb
42+
exit 1
43+
fi
44+
45+
- name: Pull Archlinux container
46+
run: docker pull archlinux:base
47+
48+
- name: Run tests in Archlinux container
11049
run: |
111-
su - runner -c "cd $GITHUB_WORKSPACE && \
112-
export XTDB_HOST=xtdb && \
113-
export XTDB_PORT=5432 && \
114-
export XTDB_USER=xtdb && \
115-
export XTDB_PASSWORD=xtdb && \
116-
export XTDB_DATABASE=xtdb && \
117-
eval \"\$(~/.local/bin/mise activate bash)\" && \
118-
~/.local/bin/mise run test:all"
50+
docker run --rm \
51+
--network host \
52+
-v ${{ github.workspace }}:/workspace \
53+
-w /workspace \
54+
-e XTDB_HOST=localhost \
55+
-e XTDB_PORT=5432 \
56+
-e XTDB_USER=xtdb \
57+
-e XTDB_PASSWORD=xtdb \
58+
-e XTDB_DATABASE=xtdb \
59+
-e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
60+
archlinux:base \
61+
bash -c '
62+
set -e
63+
64+
# Install essential deps
65+
chmod +x /workspace/.devcontainer/install-system-deps.sh
66+
/workspace/.devcontainer/install-system-deps.sh essential
67+
68+
# Create test user
69+
useradd -m -s /bin/bash -u 1001 runner
70+
echo "runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
71+
72+
# Install mise
73+
cp /workspace/.devcontainer/setup-mise.sh /tmp/setup-mise.sh
74+
chmod +x /tmp/setup-mise.sh
75+
su - runner -c "/tmp/setup-mise.sh runner /workspace"
76+
77+
# Install language runtimes
78+
chown -R runner:runner /workspace
79+
su - runner -c "cd /workspace && ~/.local/bin/mise install"
80+
81+
# Install language-specific tools
82+
su - runner -c "cd /workspace && for dir in python csharp babashka; do
83+
if [ -d \"\$dir\" ] && [ -f \"\$dir/.mise.toml\" ]; then
84+
echo \"Installing mise tools for \$dir...\"
85+
(cd \"\$dir\" && ~/.local/bin/mise install) || echo \"Warning: Failed to install tools for \$dir\"
86+
fi
87+
done"
88+
89+
# Install system packages for Ruby, Elixir, PHP
90+
/workspace/.devcontainer/install-system-deps.sh languages
91+
92+
# Setup Clojure, Elixir, PHP
93+
cp /workspace/.devcontainer/setup-language-tools.sh /tmp/setup-language-tools.sh
94+
chmod +x /tmp/setup-language-tools.sh
95+
su - runner -c "/tmp/setup-language-tools.sh all"
96+
97+
# Install language dependencies
98+
su - runner -c "cd /workspace && \
99+
eval \"\$(~/.local/bin/mise activate bash)\" && \
100+
for dir in python node ruby go elixir php; do
101+
if [ -d \"\$dir\" ]; then
102+
echo \"Installing dependencies for \$dir...\"
103+
(cd \"\$dir\" && ~/.local/bin/mise run deps 2>&1) || echo \"Warning: Failed to install deps for \$dir\"
104+
fi
105+
done"
106+
107+
# Verify XTDB connection
108+
/workspace/.devcontainer/install-system-deps.sh postgres
109+
PGPASSWORD=xtdb su - runner -c "psql -h localhost -U xtdb -d xtdb -c \"SELECT 1\"" || echo "PostgreSQL connection test failed"
110+
111+
# Run all tests
112+
su - runner -c "cd /workspace && \
113+
export XTDB_HOST=localhost && \
114+
export XTDB_PORT=5432 && \
115+
export XTDB_USER=xtdb && \
116+
export XTDB_PASSWORD=xtdb && \
117+
export XTDB_DATABASE=xtdb && \
118+
eval \"\$(~/.local/bin/mise activate bash)\" && \
119+
~/.local/bin/mise run test:all"
120+
'
119121
120122
- name: Upload Test Results
121123
if: always()
@@ -126,3 +128,7 @@ jobs:
126128
**/test-results/
127129
**/coverage/
128130
retention-days: 7
131+
132+
- name: Show XTDB logs on failure
133+
if: failure()
134+
run: docker logs xtdb

README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,24 @@ Feel free to hack on the examples - your Codespace is your own to explore!
3636

3737
## Language Feature Compatibility Matrix
3838

39-
The following matrix shows features that are not supported in some languages:
40-
41-
| Language | Transit-JSON (COPY) | Transit-Msgpack (COPY) | Transit-JSON (Parameters) |
42-
|----------|---------------------|------------------------|---------------------------|
43-
| **Python** ||||
44-
| **Node.js** ||||
45-
| **Go** ||||
46-
| **Ruby** ||||
47-
| **Java** ||||
48-
| **Kotlin** ||||
49-
| **C** ||||
50-
| **C#** ||||
51-
| **Clojure** ||||
52-
| **Elixir** ||||
53-
| **Babashka** ||||
54-
| **PHP** ||||
39+
The following matrix shows features that are not yet tested as working in some languages (i.e. no confirmed support, PRs welcome):
40+
41+
| Language | Transit-JSON (COPY) | Transit-Msgpack (COPY) | Transit-JSON (Params) | ADBC |
42+
|----------|---------------------|------------------------|-----------------------|------|
43+
| **Python** |||||
44+
| **Node.js** |||||
45+
| **Go** |||||
46+
| **Ruby** |||||
47+
| **Java** |||||
48+
| **Kotlin** |||||
49+
| **C** |||||
50+
| **C#** |||||
51+
| **Clojure** |||||
52+
| **Elixir** |||||
53+
| **Babashka** |||||
54+
| **PHP** |||||
55+
56+
[Apache Arrow ADBC](https://arrow.apache.org/adbc/) drivers connect via gRPC (port 9833) using Arrow Flight SQL for high-performance columnar data transfer. In-process ADBC usage on the JVM is also supported.
5557

5658
### Updating the Matrix
5759

@@ -61,7 +63,7 @@ The compatibility matrix is automatically generated from test output. To regener
6163
python3 scripts/generate-feature-matrix.py
6264
```
6365

64-
Languages report only **unsupported** features. All features are assumed supported by default, minimizing maintenance burden.
66+
Languages report only **unsupported** features. All features are assumed supported by default.
6567

6668
### Testing
6769

clojure/.mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ run = "clojure -M:dev:repl"
3232
description = "Run Clojure tests"
3333
run = """
3434
mise run setup
35-
clojure -M:test 2>&1 | grep -v 'Downloading:'
35+
clojure -J--add-opens=java.base/java.nio=ALL-UNNAMED -M:test 2>&1 | grep -v 'Downloading:'
3636
"""

clojure/deps.edn

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
;; JSON processing
1313
org.clojure/data.json {:mvn/version "2.5.0"}
1414

15+
;; Arrow ADBC Flight SQL (same versions as XTDB)
16+
org.apache.arrow.adbc/adbc-driver-flight-sql {:mvn/version "0.20.0"}
17+
org.apache.arrow/arrow-memory-netty {:mvn/version "18.3.0"}
18+
1519
;; helpful for debugging the loading data script
1620
org.clojure/tools.logging {:mvn/version "1.2.4"}
1721
org.slf4j/slf4j-simple {:mvn/version "2.0.9"}}

0 commit comments

Comments
 (0)