test(e2e): add a prod-scale Novosibirsk suite
- process-level tests: seed a real EДДС Bulk NDJSON, start the daemon, run the full-registry selfcheck, canonical HTTP sample, real address-log queries, strict house identity, input limits, load and graceful shutdown - production data stays outside the repo (ADDRKIT_E2E_REGISTRY/LOG); all temporary files live in t.TempDir() - add `make e2e` and `make check` (vet + race tests + dependency guard)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
GO ?= go
|
GO ?= go
|
||||||
BIN_DIR ?= bin
|
BIN_DIR ?= bin
|
||||||
|
|
||||||
.PHONY: all build test vet fmt tidy run clean seed
|
.PHONY: all build test vet fmt tidy run clean seed check e2e
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
@@ -18,6 +18,24 @@ test:
|
|||||||
vet:
|
vet:
|
||||||
$(GO) vet ./...
|
$(GO) vet ./...
|
||||||
|
|
||||||
|
## check: vet + race tests + architecture guard (the address core must not
|
||||||
|
## depend on any events/outages adapter)
|
||||||
|
check: vet test
|
||||||
|
@if $(GO) list -deps ./cmd/addrkitd | grep -Eq 'domain/outages|adapters/arcgis'; then \
|
||||||
|
echo "addrkitd must not depend on events/outages packages" >&2; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
## e2e: process-level tests against a real registry snapshot.
|
||||||
|
## Set ADDRKIT_E2E_REGISTRY to a Bulk NDJSON dump (and optionally
|
||||||
|
## ADDRKIT_E2E_LOG to an EДДС address log). Data is never copied into the repo.
|
||||||
|
e2e:
|
||||||
|
@test -n "$(ADDRKIT_E2E_REGISTRY)" || { \
|
||||||
|
echo "set ADDRKIT_E2E_REGISTRY=/path/to/address_registry.ndjson" >&2; \
|
||||||
|
exit 1; \
|
||||||
|
}
|
||||||
|
$(GO) test -tags e2e -count=1 -v ./test/e2e
|
||||||
|
|
||||||
## fmt: format all Go sources
|
## fmt: format all Go sources
|
||||||
fmt:
|
fmt:
|
||||||
gofmt -l -w .
|
gofmt -l -w .
|
||||||
@@ -30,11 +48,14 @@ tidy:
|
|||||||
run: build
|
run: build
|
||||||
$(BIN_DIR)/addrkitd -config config.json
|
$(BIN_DIR)/addrkitd -config config.json
|
||||||
|
|
||||||
## seed: build registry.db from a registry dump (override IN=/OUT=)
|
## seed: build registry.db from a registry dump (override IN=/OUT=/CITY=/CITIES=)
|
||||||
IN ?= registry.ndjson
|
IN ?= registry.ndjson
|
||||||
OUT ?= registry.db
|
OUT ?= registry.db
|
||||||
|
CITY ?=
|
||||||
|
CITIES ?=
|
||||||
seed:
|
seed:
|
||||||
$(BIN_DIR)/addrkit seed -in $(IN) -out $(OUT)
|
$(BIN_DIR)/addrkit seed -in $(IN) -out $(OUT) \
|
||||||
|
$(if $(CITY),-city "$(CITY)") $(if $(CITIES),-cities "$(CITIES)")
|
||||||
|
|
||||||
## clean: remove build artifacts
|
## clean: remove build artifacts
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user