ci: capture PostgreSQL logs in the gen job (#26340)

Adds a `test-postgres-docker-logs` Make target that dumps the test
PostgreSQL container's logs via `docker logs`. The container already
logs every statement to stderr (`log_statement=all`, no
`logging_collector`), so Docker captures them and no volume mounting or
reconfiguration is needed.

The CI `gen` job now starts the container with `make
test-postgres-docker` before `make gen`, collects the logs at the end
(always, even on failure), and uploads them as the `gen-postgres-logs`
artifact to help debug generation issues that depend on the database.

Refs: https://github.com/coder/internal/issues/1568

<sub>Opened by Coder Agents on behalf of @spikecurtis.</sub>
This commit is contained in:
Spike Curtis
2026-06-15 16:23:36 -04:00
committed by GitHub
parent 21aa295fe4
commit 792afc0842
2 changed files with 23 additions and 0 deletions
+9
View File
@@ -1598,6 +1598,15 @@ test-postgres-docker:
done
.PHONY: test-postgres-docker
# test-postgres-docker-logs prints the PostgreSQL container's logs. The
# postgres image logs to stderr (no logging_collector), which Docker captures,
# so combined with log_statement=all in test-postgres-docker these logs include
# every executed statement. Redirect to a file to save them, e.g.
# `make test-postgres-docker-logs > postgres.log`.
test-postgres-docker-logs:
docker logs test-postgres-docker-${POSTGRES_VERSION}
.PHONY: test-postgres-docker-logs
test-tailnet-integration:
env \
CODER_TAILNET_TESTS=true \