From 1a9152575cf473226a858425901ac9aece2815e1 Mon Sep 17 00:00:00 2001 From: Yonghwan SO Date: Sat, 10 Sep 2022 00:13:30 +0900 Subject: [PATCH] fixed e2e test configuration: why does it run for only sqlite... --- .github/workflows/tests.yml | 26 ++++++++++++++------------ database.yml | 10 +++++----- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 97fb9ea8..308c187a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: ports: - 3307:3306 # needed because the mysql container does not provide a healthcheck - options: --health-cmd "mysqladmin ping -h localhost" --health-interval 10s --health-timeout 5s --health-retries 5 + options: --health-cmd "mysqladmin ping -h localhost" --health-interval 5s --health-timeout 5s --health-retries 10 steps: - uses: actions/checkout@v3 @@ -51,9 +51,9 @@ jobs: run: | go test -v -tags sqlite -race ./... - - name: Reset soda and run e2e + - name: Reset database and run e2e env: - SODA_DIALECT: "sqlite" + SODA_DIALECT: "mysql" run: | soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations @@ -77,9 +77,9 @@ jobs: POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres ports: - - 5432:5432 + - 5433:5432 # needed because the postgres container does not provide a healthcheck - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10 steps: - uses: actions/checkout@v3 @@ -105,9 +105,9 @@ jobs: run: | go test -v -tags sqlite -race ./... - - name: Reset soda and run e2e + - name: Reset database and run e2e env: - SODA_DIALECT: "sqlite" + SODA_DIALECT: "postgres" run: | soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations @@ -136,7 +136,9 @@ jobs: pushd crdb wget -qO- https://binaries.cockroachdb.com/cockroach-v21.1.19.linux-amd64.tgz | tar -xz mv cockroach-v21.1.19.linux-amd64/* . - ./cockroach start-single-node --insecure --background + ln -s `pwd`/cockroach /usr/local/bin/ + cockroach version + ./cockroach start-single-node --insecure --background --sql-addr :26258 popd - name: Install and run soda @@ -154,9 +156,9 @@ jobs: run: | go test -v -tags sqlite -race ./... - - name: Reset soda and run e2e + - name: Reset database and run e2e env: - SODA_DIALECT: "sqlite" + SODA_DIALECT: "cockroach" run: | soda drop -e $SODA_DIALECT -p ./testdata/migrations soda create -e $SODA_DIALECT -p ./testdata/migrations @@ -213,7 +215,7 @@ jobs: go test -v -tags sqlite ./... shell: bash - - name: Reset soda and run e2e + - name: Reset database and run e2e if: ${{ matrix.os != 'windows-latest' }} env: SODA_DIALECT: "sqlite" @@ -224,7 +226,7 @@ jobs: go test -v -tags sqlite,e2e -race ./... shell: bash - - name: Reset soda and run e2e without race detection + - name: Reset database and run e2e without race detection if: ${{ matrix.os == 'windows-latest' }} env: SODA_DIALECT: "sqlite" diff --git a/database.yml b/database.yml index 4ee63b38..a21537ec 100644 --- a/database.yml +++ b/database.yml @@ -2,20 +2,20 @@ mysql: dialect: "mysql" database: "pop_test" host: {{ envOr "MYSQL_HOST" "127.0.0.1" }} - port: {{ envOr "MYSQL_PORT" "3306" }} + port: {{ envOr "MYSQL_PORT" "3307" }} user: {{ envOr "MYSQL_USER" "root" }} password: {{ envOr "MYSQL_PASSWORD" "root" }} postgres: - url: "postgres://postgres:postgres@localhost:5432/pop_test?sslmode=disable" + url: "postgres://postgres:postgres@localhost:5433/pop_test?sslmode=disable" pool: 25 cockroach: - # url: "cockroach://root@127.0.0.1:26257/pop_test?application_name=cockroach&sslmode=disable" + # url: "cockroach://root@127.0.0.1:26258/pop_test?application_name=cockroach&sslmode=disable" dialect: "cockroach" database: "pop_test" host: {{ envOr "COCKROACH_HOST" "127.0.0.1" }} - port: {{ envOr "COCKROACH_PORT" "26257" }} + port: {{ envOr "COCKROACH_PORT" "26258" }} user: {{ envOr "COCKROACH_USER" "root" }} password: {{ envOr "COCKROACH_PASSWORD" "" }} options: @@ -31,7 +31,7 @@ sqlserver: sqlite: dialect: "sqlite3" - database: "./sql_scripts/sqlite/test.sqlite" + database: "./tmp/test.sqlite" options: mode: rwc