- Introduce tests for chat history file handling, loading/saving, and error cases in cmd/chat_test.go - Add tests for removeLastModifiedComments in cmd/edit_helper_test.go - Add comprehensive tests for CleanCodeResponse in internal/grok/cleancode_test.go - Update Makefile to centralize build artifacts in build/ directory for coverage reports and binary - Adjust .gitignore to ignore chat_history.json and remove obsolete coverage file entries
35 lines
933 B
Makefile
35 lines
933 B
Makefile
.PHONY: test test-cover test-agent build install clean
|
|
|
|
test:
|
|
go test ./... -v
|
|
|
|
test-cover:
|
|
@mkdir -p build
|
|
go test ./... -coverprofile=build/coverage.out
|
|
go tool cover -html=build/coverage.out -o build/coverage.html
|
|
@echo "✅ Coverage report: open build/coverage.html in your browser"
|
|
|
|
test-agent:
|
|
go test -run TestAgent ./... -v
|
|
|
|
build:
|
|
@mkdir -p build
|
|
go build -ldflags "-s -w" -trimpath -o build/grokkit .
|
|
|
|
install: build
|
|
mkdir -p ~/.local/bin
|
|
cp build/grokkit ~/.local/bin/grokkit
|
|
chmod +x ~/.local/bin/grokkit
|
|
@echo "✅ grokkit installed to ~/.local/bin"
|
|
|
|
clean:
|
|
rm -rf build/
|
|
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " test Run all tests"
|
|
@echo " test-cover Run tests + generate HTML coverage report"
|
|
@echo " test-agent Run only agent tests"
|
|
@echo " build Build optimized binary"
|
|
@echo " install Build and install to ~/.local/bin"
|
|
@echo " clean Remove build artifacts"
|