Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,19 @@ test-integration:

# Real backends in containers (Redis, PostgreSQL, MySQL, MinIO).
# Requires a Docker daemon; skipped by every other target via the build tag.
#
# testcontainers does not read the docker CLI context, so under colima it has to
# be told twice: DOCKER_HOST is the host-side socket it connects to, and
# TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE is the same socket as seen *inside* the
# VM, which is what its reaper container bind-mounts. Empty on Docker Desktop
# and in CI, where the default socket is already correct for both.
ifeq ($(shell docker context show 2>/dev/null),colima)
CONTAINER_ENV := DOCKER_HOST=$(shell docker context inspect colima --format '{{.Endpoints.docker.Host}}') \
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock
endif

test-containers:
go test -race -tags=integration ./test/integration/... -count=1 -timeout 900s
$(CONTAINER_ENV) go test -race -tags=integration ./test/integration/... -count=1 -timeout 900s

test-e2e:
go test ./test/e2e/... -count=1 -timeout 300s
Expand Down
6 changes: 5 additions & 1 deletion internal/transport/rest/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ type errorResponse struct {
// gets the category and, for input errors, the reason.
func writeError(w http.ResponseWriter, r *http.Request, err error) {
status, message := classify(err)
if status >= http.StatusInternalServerError {
// Only the internal-error bucket is logged. A 503 from a draining instance
// is expected operation and would otherwise fill the log on every rolling
// deploy, and an unreachable database is already logged where it is
// detected, with the driver detail the response deliberately drops.
if status == http.StatusInternalServerError {
log.Printf("ERROR: request_id=%s %s %s: %v", middleware.GetReqID(r.Context()), r.Method, r.URL.Path, err)
}
writeStatus(w, r, status, message)
Expand Down