From 27ad988fd78da3e1324a8dd8dad40b23323bcf40 Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Sun, 20 Sep 2026 18:30:58 +0800 Subject: [PATCH] =?UTF-8?q?ci=F0=9F=91=B7:=20run=20the=20tests=20against?= =?UTF-8?q?=20MySQL=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MySQL is the dialect most installations run and the only registered driver with no service here. The scheduler lease that follows reads the database's clock, and the first implementation read it as a timestamp: over go-admin's own `parseTime=True&loc=Local` DSN, MySQL's UTC_TIMESTAMP comes back relabelled as local time, so on any host that is not UTC every lease was one zone offset out. Every assertion that compared the lease only against itself still passed, and the three dialects already here could not see it. The DSN keeps loc=Local on purpose: it is what config/settings.yml ships. A DSN here that quietly differed would test a configuration nobody runs. --- .github/workflows/go.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bf344f53..5fe7b7a7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -68,6 +68,28 @@ jobs: --health-retries 20 --health-start-period 20s + # The dialect most installations actually run, and until the + # scheduler lease (#915) the only one with no service here. The lease + # reads the database's clock, and the first implementation read it as + # a timestamp: over go-admin's own `parseTime=True&loc=Local` DSN, + # MySQL's UTC_TIMESTAMP comes back relabelled as local time, so on any + # host that is not UTC every lease was one zone offset out - and every + # assertion that compared the lease only against itself still passed. + # The three dialects that were here could not see it. + mysql: + image: mysql:8 + env: + MYSQL_ROOT_PASSWORD: GoAdmin_Test1 + MYSQL_DATABASE: goadmin_test + ports: + - 3306:3306 + options: >- + --health-cmd "mysqladmin ping -h 127.0.0.1 -uroot -pGoAdmin_Test1" + --health-interval 10s + --health-timeout 5s + --health-retries 20 + --health-start-period 20s + env: GO_ADMIN_TEST_REDIS_ADDR: 127.0.0.1:6379 # The soft-delete conversion drops an index, and gorm's PostgreSQL driver @@ -77,6 +99,11 @@ jobs: # See go-admin#919. GO_ADMIN_TEST_POSTGRES_DSN: "host=127.0.0.1 port=5432 user=postgres password=postgres dbname=goadmin_test sslmode=disable" GO_ADMIN_TEST_SQLSERVER_DSN: "sqlserver://sa:GoAdmin_Test1@127.0.0.1:1433?database=goadmin_test" + # loc=Local on purpose: it is what config/settings.yml ships and what + # made the timezone defect above reachable. A DSN here that quietly + # differed from the one installations use would test a configuration + # nobody runs. + GO_ADMIN_TEST_MYSQL_DSN: "root:GoAdmin_Test1@tcp(127.0.0.1:3306)/goadmin_test?charset=utf8mb4&parseTime=True&loc=Local" steps: