You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by fr...@apache.org on 2022/08/12 03:34:40 UTC

[calcite-avatica-go] branch run-tests-using-docker created (now cad4e55)

This is an automated email from the ASF dual-hosted git repository.

francischuang pushed a change to branch run-tests-using-docker
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git


      at cad4e55  [CALCITE-5235] Run Github Actions tests using docker and upgrade Go

This branch includes the following new commits:

     new cad4e55  [CALCITE-5235] Run Github Actions tests using docker and upgrade Go

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[calcite-avatica-go] 01/01: [CALCITE-5235] Run Github Actions tests using docker and upgrade Go

Posted by fr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

francischuang pushed a commit to branch run-tests-using-docker
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git

commit cad4e559f37f03b32c5c55151685c7ed3501b6dd
Author: Francis Chuang <fr...@boostport.com>
AuthorDate: Fri Aug 12 13:34:22 2022 +1000

    [CALCITE-5235] Run Github Actions tests using docker and upgrade Go
---
 .github/workflows/tests.yaml | 45 ++++++++++++--------------------------------
 docker-compose.yml           | 34 +++++++++++++++++++++++++++++----
 2 files changed, 42 insertions(+), 37 deletions(-)

diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 8cad245..67ce052 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -5,45 +5,24 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        go_version: [1.17, 1.18]
-        database_image:
-          - boostport/hbase-phoenix-all-in-one:1.3-4.13
-          - boostport/hbase-phoenix-all-in-one:1.4-4.14
-          - boostport/hbase-phoenix-all-in-one:2.0-5.0
-          - apache/calcite-avatica-hypersql:1.13.0
-          - apache/calcite-avatica-hypersql:1.14.0
-          - apache/calcite-avatica-hypersql:1.15.0
-          - apache/calcite-avatica-hypersql:1.17.0
-          - apache/calcite-avatica-hypersql:1.18.0
-          - apache/calcite-avatica-hypersql:1.19.0
-          - apache/calcite-avatica-hypersql:1.20.0
+        go_version: [1.18, 1.19]
+        database:
+          - [phoenix, 1.3-4.13]
+          - [phoenix, 1.4-4.14]
+          - [phoenix, 2.0-5.0]
+          - [hsqldb, 1.18.0]
+          - [hsqldb, 1.19.0]
+          - [hsqldb, 1.20.0]
+          - [hsqldb, 1.21.0]
+          - [hsqldb, 1.22.0]
 
     runs-on: ubuntu-latest
 
     steps:
-      - name: Set up go
-        uses: actions/setup-go@v3
-        with:
-          go-version: ${{ matrix.go_version}}
-
       - name: Check out Avatica-Go repository
         uses: actions/checkout@v3
 
       - name: Run tests
         env:
-          PHOENIX_HOST: http://localhost:8765
-          HSQLDB_HOST: http://localhost:8765
-          DATABASE_IMAGE: ${{ matrix.database_image }}
-        run: |
-          case "$DATABASE_IMAGE" in
-            *phoenix*)
-              docker run -d -p 8765:8765 $DATABASE_IMAGE
-              export AVATICA_FLAVOR=PHOENIX
-              ;;
-            *hypersql*)
-              docker run -d -p 8765:8765 $DATABASE_IMAGE -u jdbc:hsqldb:mem:public
-              export AVATICA_FLAVOR=HSQLDB
-              ;;
-          esac
-
-          go test -v ./...
\ No newline at end of file
+          VERSION: ${{ matrix.database[1] }}
+        run: docker compose run test-${{ matrix.database[0]] }}
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
index 5523ab1..f1dd040 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -16,14 +16,14 @@
 version: '3'
 services:
   phoenix:
-    image: boostport/hbase-phoenix-all-in-one:2.0-5.0
+    image: boostport/hbase-phoenix-all-in-one:${VERSION:-2.0-5.0}
 
   hsqldb:
-    image: apache/calcite-avatica-hypersql:1.20.0
+    image: apache/calcite-avatica-hypersql:${VERSION:-1.20.0}
     command: -u jdbc:hsqldb:mem:public
 
   test:
-    image: golang:1.18
+    image: golang:${GO_VERSION:-1.19}
     command: sh -c "export AVATICA_FLAVOR=HSQLDB && go test -v ./...; export AVATICA_FLAVOR=PHOENIX && go test -v ./..."
     working_dir: /source
     environment:
@@ -36,6 +36,32 @@ services:
       - phoenix
       - hsqldb
 
+  test-phoenix:
+    image: golang:${GO_VERSION:-1.19}
+    command: go test -v ./...
+    working_dir: /source
+    environment:
+      PHOENIX_HOST: http://phoenix:8765
+      AVATICA_FLAVOR: PHOENIX
+    volumes:
+      - .:/source
+      - $GOPATH/pkg/mod/cache:/go/pkg/mod/cache
+    depends_on:
+      - phoenix
+
+  test-hsqldb:
+    image: golang:${GO_VERSION:-1.19}
+    command: go test -v ./...
+    working_dir: /source
+    environment:
+      PHOENIX_HOST: http://phoenix:8765
+      AVATICA_FLAVOR: HSQLDB
+    volumes:
+      - .:/source
+      - $GOPATH/pkg/mod/cache:/go/pkg/mod/cache
+    depends_on:
+      - hsqldb
+
   dry-run:
     image: alpine
     working_dir: /source
@@ -74,7 +100,7 @@ services:
       - .:/source
 
   compile-protobuf:
-    image: golang:1.18
+    image: golang:1.19
     working_dir: /source
     command: sh -c "./docker.sh compile-protobuf"
     environment: