fix: connect integration tests to Compose network
E2E Tests / Run on Ubuntu (pull_request) Failing after 50s
Tests / Run on Ubuntu (pull_request) Successful in 3m58s
Lint / Run on Ubuntu (pull_request) Successful in 4m22s

This commit is contained in:
2026-09-10 16:50:44 +00:00
parent 98cdc9c2b2
commit 5ff3cf7282
2 changed files with 12 additions and 2 deletions
+7 -2
View File
@@ -31,11 +31,16 @@ jobs:
make test
- name: Running PostgreSQL Integration Tests
run: make test-integration
run: |
make dev-up
docker network connect postgresql-tenant-operator-dev_default "${HOSTNAME}"
POSTGRES_TEST_DSN="postgres://postgres:postgres-dev-only@postgres:5432/postgres?sslmode=disable" make test-integration
- name: Clean up Integration Dependencies
if: always()
run: make dev-down
run: |
docker network disconnect postgresql-tenant-operator-dev_default "${HOSTNAME}" || true
make dev-down
- name: Verify generated files and modules are current
run: git diff --exit-code
+5
View File
@@ -118,6 +118,11 @@ make test-integration
PostgreSQL。registry 测试会删除并重建固定的测试 schema,因此禁止将该变量指向真实
homelab database。测试后运行 `make dev-down` 清理依赖。
Gitea Actions 的 job 本身运行在 Docker container 中,不能通过 `127.0.0.1` 访问
Docker host 上发布的 Compose 端口。CI 会暂时将 job container 加入 Compose 网络,
并通过 `postgres:5432` 运行集成测试;清理前先断开该网络,才能删除 Compose
network。本机执行仍使用默认的 `127.0.0.1:15432`
本机运行 controller 时,先确认当前 kubeconfig 指向专用 Kind,而不是真实 homelab
```sh