mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user