Skip to content

Commit

Permalink
chore: add java
Browse files Browse the repository at this point in the history
  • Loading branch information
pvetere committed Oct 16, 2024
1 parent 6ce0136 commit 8f5e667
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -32,6 +32,12 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'temurin'

- name: prepare build environment
run: echo "CONFIG="$(cat config.json)"" >> ${GITHUB_ENV}

Expand Down
22 changes: 22 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,28 @@ test_external_functions() {
}
TESTS+=("test_external_functions")

test_fts() {
docker_run

docker exec ${CURRENT_CONTAINER_ID} find / | grep java

query_master "set global fts2_java_path='/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.4-7/x64/bin/java'"
query_master "set global fts2_java_home='/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.4-7/x64'"
query_master "create database test"
local auth=$(echo -n "root:test" | base64)
query_master "create table test.fts(t text, fulltext using version 2 (t))"
query_master "insert into test.fts values ('hello'), ('world')"
query_master "optimize table test.fts full"

COUNT=$(query_master "select bm25(f, 't:hello') from test.fts f" | jq -r '.rows[0].c')
if [[ "${COUNT}" != "1" ]]; then
echo "FTS search did not produce 1 row"
echo ${COUNT}
exit 1
fi
}
TESTS+=("test_fts")

test_auto_restart() {
local exit_code

Expand Down

0 comments on commit 8f5e667

Please sign in to comment.