From 07b3d70d4f192c18c3191f9d7281a49306bf9ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E4=BA=91=E9=87=91YunjinXu?= Date: Mon, 16 Oct 2023 10:53:06 +0800 Subject: [PATCH] adapter helper and github action --- .github/workflows/tests.yml | 10 ++++++++++ helper/compose.store.yml | 9 +++++++++ helper/test-cover.sh | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e25ebc8..5b181e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,6 +45,16 @@ jobs: - /etc/timezone:/etc/timezone:ro ports: - 27017:27017 + sqlserver: + image: mcr.microsoft.com/mssql/server:2019-latest + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + env: + ACCEPT_EULA: Y + MSSQL_SA_PASSWORD: p@ssw0rd + ports: + - '1433:1433' steps: - name: Set up Go 1.19 uses: actions/setup-go@v2 diff --git a/helper/compose.store.yml b/helper/compose.store.yml index 83e929f..206ef09 100644 --- a/helper/compose.store.yml +++ b/helper/compose.store.yml @@ -36,3 +36,12 @@ services: - /etc/localtime:/etc/localtime:ro ports: - '27017:27017' + sqlserver2019: + image: mcr.microsoft.com/mssql/server:2019-latest + volumes: + - /etc/localtime:/etc/localtime:ro + ports: + - 1433:1433 + environment: + - ACCEPT_EULA=Y + - MSSQL_SA_PASSWORD=p@ssw0rd diff --git a/helper/test-cover.sh b/helper/test-cover.sh index c5860ca..786a1fe 100755 --- a/helper/test-cover.sh +++ b/helper/test-cover.sh @@ -1,7 +1,7 @@ set -x export DTM_DEBUG=1 echo "mode: count" > coverage.txt -for store in redis boltdb mysql postgres; do +for store in redis boltdb mysql postgres sqlserver; do TEST_STORE=$store go test -failfast -covermode count -coverprofile=profile.out -coverpkg=github.com/dtm-labs/dtm/client/dtmcli,github.com/dtm-labs/dtm/client/dtmcli/dtmimp,github.com/dtm-labs/logger,github.com/dtm-labs/dtm/client/dtmgrpc,github.com/dtm-labs/dtm/client/workflow,github.com/dtm-labs/dtm/client/dtmgrpc/dtmgimp,github.com/dtm-labs/dtm/dtmsvr,dtmsvr/config,github.com/dtm-labs/dtm/dtmsvr/storage,github.com/dtm-labs/dtm/dtmsvr/storage/boltdb,github.com/dtm-labs/dtm/dtmsvr/storage/redis,github.com/dtm-labs/dtm/dtmsvr/storage/registry,github.com/dtm-labs/dtm/dtmsvr/storage/sql,github.com/dtm-labs/dtm/dtmutil -gcflags=-l ./... || exit 1 echo "TEST_STORE=$store finished" if [ -f profile.out ]; then