add unit tests for various utility functions,

add integration test for LDAPClient,
add aiutomatic openldap configuration for testing through make,
add make targets for tests
improve make targets for build/clean,
update README with build and test instructions
This commit is contained in:
2024-10-19 04:16:17 +00:00
parent 99242b70a0
commit b8b0504a70
11 changed files with 1617 additions and 6 deletions

View File

@@ -1,9 +1,23 @@
build: clean
CGO_ENABLED=0 go build -ldflags="-s -w" -o dist/ .
.PHONY: build test clean dev-init
test: clean
go run .
build: clean
@echo "======================== Building Binary ======================="
CGO_ENABLED=0 go build -ldflags="-s -w" -v -o dist/ .
tests: dev-reinit
@echo "======================== Running Tests ========================="
go test -v -cover -coverpkg=./app/ -coverprofile coverage ./test/
@echo "======================= Coverage Report ========================"
go tool cover -func=coverage
@rm -f coverage
clean:
@echo "======================== Cleaning Project ======================"
go clean
rm -f dist/*
rm -f dist/*
dev-init:
@cd scripts; make dev-init
dev-reinit:
@cd scripts; make dev-reinit