🔀 Merge branch 'stable' into develop

This commit is contained in:
Dan Jones 2024-10-09 15:19:06 -05:00
commit d0b6c40445
2 changed files with 11 additions and 4 deletions

View file

@ -3,6 +3,12 @@ OUT=my-log
GOBIN=$(shell go env GOBIN) GOBIN=$(shell go env GOBIN)
COVEROUT=cover.out COVEROUT=cover.out
COVERHTML=cover.html COVERHTML=cover.html
OPEN=xdg-open
OS=$(shell uname -s)
ifeq ($(OS),Darwin)
OPEN=open
endif
.PHONY: help .PHONY: help
help: ## Show help for documented recipes help: ## Show help for documented recipes
@ -23,7 +29,8 @@ test: ## Test application and generate coverage report
$(MAKE) clean $(MAKE) clean
$(MAKE) $(COVEROUT) $(MAKE) $(COVEROUT)
$(COVEROUT): $(SOURCES) fmt $(COVEROUT): $(SOURCES)
$(MAKE) fmt
go test ./... -race -cover -coverprofile $@ go test ./... -race -cover -coverprofile $@
$(COVERHTML): $(COVEROUT) $(COVERHTML): $(COVEROUT)
@ -33,8 +40,8 @@ $(COVERHTML): $(COVEROUT)
report: $(COVERHTML) ## Generate a coverage report report: $(COVERHTML) ## Generate a coverage report
.PHONY: open-report .PHONY: open-report
open-report: report ## Open the coverage report in the default browser open-report: $(COVERHTML) ## Open the coverage report in the default browser
xdg-open $(COVERHTML) $(OPEN) $<
.PHONY: build .PHONY: build
build: $(OUT) ## Builds the application build: $(OUT) ## Builds the application

View file

@ -211,7 +211,7 @@ func (s *AppendTestSuite) TestConfLoadErr() {
func (s *AppendTestSuite) TestMkdirErr() { func (s *AppendTestSuite) TestMkdirErr() {
// Don't run this test as root // Don't run this test as root
config.Overrides["input.path"] = "/root/my-logs-test" config.Overrides["input.path"] = "/var/my-logs-test"
defer func(path string) { defer func(path string) {
config.Overrides["input.path"] = path config.Overrides["input.path"] = path
}(s.dir) }(s.dir)