mirror of
https://github.com/hanzoai/insights-go.git
synced 2026-09-30 22:46:12 +00:00
* intitial refactor: - Add Context-based graceful shutdown and drain phase for enqueued requests - Use buffered channels vs. mutex for concurrency mgmt. - Use atomic.Pointer vs. locks for FF mgmt - Use Callback ifc vs. lossy internal tracking for unit test result validation - Add new APIs mirroring current that accept caller's Context to control operation timeouts * expose batch submission timeout with default equiv to old hardcoded timeout * restructure event submission and batching pipeline * overhaul tests; implement new stress tests and address coverage gaps * parallelize tests where safe to do so (3x CI time savings!) * introduce faster pure Go JSON seralization library * more refactors: unit tests & benchmarks * DRY up shutdown req drain and prepareForSend serializer * use go-json in CLI utils too; remove redundant helpers * move error type to proper pkg * DRY up loop() and fix deadlock in old test case * normalize CI and Makefile test and benchmark target behavviors * more realistic feature flags benchmark * replace leaky time.After pattern with idiomatic safer Timers * internal queue size minimums decoupled from batch and worker configs * remove dead comments * fix test bug * update default http.Transport cfg to avoid conn pool as bottleneck; update batch enqueue limiting strategy and tests/benches * adjust stress test defaults to match prod * update flaky tests and rm stale file * make graceful shutdown timeout opt-in for now * fix tests that reverted to hold helper utils during rebase * fix flaky test due to overhead from -race detector now default in test flags * add more graceful shutdown test cases
31 lines
753 B
Makefile
31 lines
753 B
Makefile
ifndef CIRCLE_ARTIFACTS
|
|
CIRCLE_ARTIFACTS=tmp
|
|
endif
|
|
|
|
dependencies:
|
|
@go get -v -t ./...
|
|
|
|
vet:
|
|
@go vet ./...
|
|
|
|
test: vet
|
|
@mkdir -p ${CIRCLE_ARTIFACTS}
|
|
@go test -v -race -count=1 -timeout=5m -coverprofile=${CIRCLE_ARTIFACTS}/cover.out ./...
|
|
@go tool cover -func ${CIRCLE_ARTIFACTS}/cover.out -o ${CIRCLE_ARTIFACTS}/cover.txt
|
|
@go tool cover -html ${CIRCLE_ARTIFACTS}/cover.out -o ${CIRCLE_ARTIFACTS}/cover.html
|
|
|
|
# Run benchmarks (no race - it skews performance measurements)
|
|
bench: vet
|
|
@go test -v -bench=. -benchmem -run=^$$ -timeout=30m .
|
|
|
|
# Quick benchmark run (single iteration, no memory stats)
|
|
bench-quick: vet
|
|
@go test -bench=. -run=^$$ .
|
|
|
|
build: test
|
|
@go build ./...
|
|
|
|
ci: dependencies test
|
|
|
|
.PHONY: dependencies vet test bench bench-quick ci
|