From da35bf4bcf719c568dbf7c42d8948b4649b2253f Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Wed, 9 Oct 2024 15:08:37 -0500 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=85=20Fix=20TestMkdirErr=20on=20Darwi?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/append_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/append_test.go b/files/append_test.go index 0976363..03f0253 100644 --- a/files/append_test.go +++ b/files/append_test.go @@ -211,7 +211,7 @@ func (s *AppendTestSuite) TestConfLoadErr() { func (s *AppendTestSuite) TestMkdirErr() { // 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) { config.Overrides["input.path"] = path }(s.dir) From 85671a076cf0c4c530c25424548a98d26c0b72dd Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Wed, 9 Oct 2024 15:13:34 -0500 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20Makefile=20so=20?= =?UTF-8?q?it=20doesn't=20re-run=20test=20and=20fmt=20when=20it=20doesn't?= =?UTF-8?q?=20need=20to?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 35491dc..c65ce26 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,8 @@ test: ## Test application and generate coverage report $(MAKE) clean $(MAKE) $(COVEROUT) -$(COVEROUT): $(SOURCES) fmt +$(COVEROUT): $(SOURCES) + $(MAKE) fmt go test ./... -race -cover -coverprofile $@ $(COVERHTML): $(COVEROUT) @@ -33,7 +34,7 @@ $(COVERHTML): $(COVEROUT) report: $(COVERHTML) ## Generate a coverage 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) .PHONY: build From fba5551bb3e0b5a2b7f914e3e4e1ee6c75a2155e Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Wed, 9 Oct 2024 15:14:37 -0500 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=A8=20Fix=20make=20open-report=20f?= =?UTF-8?q?or=20Darwin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c65ce26..a3d8581 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,12 @@ OUT=my-log GOBIN=$(shell go env GOBIN) COVEROUT=cover.out COVERHTML=cover.html +OPEN=xdg-open +OS=$(shell uname -s) + +ifeq ($(OS),Darwin) +OPEN=open +endif .PHONY: help help: ## Show help for documented recipes @@ -35,7 +41,7 @@ report: $(COVERHTML) ## Generate a coverage report .PHONY: open-report open-report: $(COVERHTML) ## Open the coverage report in the default browser - xdg-open $(COVERHTML) + $(OPEN) $< .PHONY: build build: $(OUT) ## Builds the application