Skip to content

Commit 64fd934

Browse files
author
Philip Z
committed
test: retain DuckDB and runtime example gates
1 parent 3ae4bf0 commit 64fd934

7 files changed

Lines changed: 445 additions & 2 deletions

File tree

‎examples/conformance/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ It also proves that optimistic versions remain isolated when different entity
77
types use the same numeric ID and their mutation ledgers are merged.
88

99
```bash
10-
make run
10+
examples/verify-runtime-examples.sh
1111
```
1212

13+
Run the command from the repository root. It builds against current reactor
14+
sources and verifies this example together with the School bootstrap example,
15+
using an isolated temporary SQLite database for each run.
16+
1317
The generated Runtime Module is installed at application startup but remains a
1418
passive manifest. Schema reconciliation is invoked separately and explicitly.

‎examples/school-management/README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@ related entities as `NotLoaded`.
1919
Before publication, install the repository's local runtime and then run the
2020
generated workspace. The portable SQL runtime test separately changes a constant
2121
and verifies optimistic, single-version reconciliation.
22+
23+
From the repository root, run `examples/verify-runtime-examples.sh`. The gate
24+
builds both retained examples against the current reactor sources, assigns each
25+
run an isolated temporary SQLite database, waits for its acceptance marker, and
26+
exits non-zero if either application fails or times out.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5+
run_dir="$(mktemp -d)"
6+
active_pid=""
7+
8+
cleanup() {
9+
if [[ -n "$active_pid" ]] && kill -0 "$active_pid" 2>/dev/null; then
10+
kill "$active_pid" 2>/dev/null || true
11+
wait "$active_pid" 2>/dev/null || true
12+
fi
13+
rm -rf "$run_dir"
14+
}
15+
trap cleanup EXIT
16+
17+
mvn -q -f "$repo_dir/pom.xml" \
18+
-pl examples/conformance,examples/school-management \
19+
-am package -DskipTests
20+
21+
run_example() {
22+
local name="$1"
23+
local jar="$2"
24+
local marker="$3"
25+
local log="$run_dir/$name.log"
26+
local database="$run_dir/$name.db"
27+
28+
java -jar "$jar" \
29+
"--spring.datasource.url=jdbc:sqlite:$database" \
30+
--server.port=0 >"$log" 2>&1 &
31+
active_pid=$!
32+
33+
for _ in $(seq 1 240); do
34+
if grep -Fq "$marker" "$log"; then
35+
kill "$active_pid" 2>/dev/null || true
36+
wait "$active_pid" 2>/dev/null || true
37+
active_pid=""
38+
printf 'PASS %s\n' "$name"
39+
return 0
40+
fi
41+
if ! kill -0 "$active_pid" 2>/dev/null; then
42+
wait "$active_pid" || true
43+
active_pid=""
44+
printf 'FAIL %s exited before its acceptance marker\n' "$name" >&2
45+
sed -n '1,240p' "$log" >&2
46+
return 1
47+
fi
48+
sleep 0.25
49+
done
50+
51+
printf 'FAIL %s did not emit its acceptance marker within 60 seconds\n' "$name" >&2
52+
sed -n '1,240p' "$log" >&2
53+
return 1
54+
}
55+
56+
run_example \
57+
"conformance" \
58+
"$repo_dir/examples/conformance/target/deploy/runtime-example-conformance-service-0.0.1-SNAPSHOT.jar" \
59+
"PASS Java minimum runtime conformance: 8/8"
60+
61+
run_example \
62+
"school-management" \
63+
"$repo_dir/examples/school-management/target/deploy/school-management-service-0.0.1-SNAPSHOT.jar" \
64+
"PASS Java School bootstrap, portable Query, and native SQLite Facet parity"
65+
66+
printf 'PASS Java runtime examples: 2/2\n'

‎pom.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
<module>teaql-opentelemetry</module>
8484
<module>examples/conformance/lib</module>
8585
<module>examples/conformance</module>
86+
<module>examples/school-management/lib</module>
87+
<module>examples/school-management</module>
8688
</modules>
8789

8890
<dependencyManagement>

‎teaql-duckdb/README.md‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,22 @@
22

33
This module provides DuckDB support for TeaQL.
44

5+
The executable compatibility gate defaults to DuckDB JDBC `1.5.5.1`:
6+
7+
```bash
8+
mvn -pl teaql-duckdb test
9+
```
10+
11+
An older driver can be checked with the same tests, for example:
12+
13+
```bash
14+
mvn -pl teaql-duckdb clean test -Dduckdb.version=1.0.0
15+
```
16+
17+
Compatibility claims refer to the Java JDBC driver exercised by this gate,
18+
not to a separately installed DuckDB CLI.
19+
520
## Test Report
6-
A complete testing phase was successfully run with our core Vending Machine logic on DuckDB `1.0.0`. Read the full [TEST_REPORT.md](./TEST_REPORT.md) for details.
21+
The historical Vending Machine report used DuckDB `1.0.0`. The retained Maven
22+
gate verifies current JDBC compatibility; read [TEST_REPORT.md](./TEST_REPORT.md)
23+
for the earlier test scope.

‎teaql-duckdb/pom.xml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
</parent>
1111
<artifactId>teaql-duckdb</artifactId>
1212
<name>teaql-duckdb</name>
13+
<properties>
14+
<!-- Override with -Dduckdb.version=... for compatibility gates. -->
15+
<duckdb.version>1.5.5.1</duckdb.version>
16+
</properties>
1317
<dependencies>
1418
<dependency>
1519
<groupId>io.teaql</groupId>
@@ -19,5 +23,44 @@
1923
<groupId>io.teaql</groupId>
2024
<artifactId>teaql-utils</artifactId>
2125
</dependency>
26+
<dependency>
27+
<groupId>org.duckdb</groupId>
28+
<artifactId>duckdb_jdbc</artifactId>
29+
<version>${duckdb.version}</version>
30+
<scope>test</scope>
31+
</dependency>
32+
<dependency>
33+
<groupId>io.teaql</groupId>
34+
<artifactId>teaql-provider-jdbc</artifactId>
35+
<version>${project.version}</version>
36+
<scope>test</scope>
37+
</dependency>
38+
<dependency>
39+
<groupId>io.teaql</groupId>
40+
<artifactId>teaql-runtime</artifactId>
41+
<version>${project.version}</version>
42+
<scope>test</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>junit</groupId>
46+
<artifactId>junit</artifactId>
47+
<scope>test</scope>
48+
</dependency>
2249
</dependencies>
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-surefire-plugin</artifactId>
55+
<configuration>
56+
<argLine>
57+
--add-reads io.teaql.duck=io.teaql.runtime
58+
--add-reads io.teaql.duck=java.sql
59+
--add-opens io.teaql.duck/io.teaql.duckdb=io.teaql.utils
60+
--add-opens io.teaql.core/io.teaql.core=io.teaql.utils
61+
</argLine>
62+
</configuration>
63+
</plugin>
64+
</plugins>
65+
</build>
2366
</project>

0 commit comments

Comments
 (0)