Skip to content

Commit

Permalink
added grc for test colouring
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocicerchia committed Nov 4, 2024
1 parent e79acdb commit 6005798
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@ test/full-setup/certs/*/*.csr
test/full-setup/certs/*/*.key
dist/

go-proxy-cache
go-proxy-cache

cover.html
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ tlsfuzzer: ## tlsfuzzer
test: test-unit test-functional test-endtoend test-ws test-http2 ## test

test-unit: ## test unit
TESTING=1 go test -v -race -count=1 --tags=unit ./...
TESTING=1 grc go test -v -race -count=1 --tags=unit ./...

test-functional: ## test functional
python3 -m http.server &> /dev/null &
TESTING=1 go test -v -race -count=1 --tags=functional ./...
TESTING=1 grc go test -v -race -count=1 --tags=functional ./...
pgrep python3 | xargs kill || true

test-endtoend: ## test endtoend
go test -v -race -count=1 --tags=endtoend ./...
grc go test -v -race -count=1 --tags=endtoend ./...

test-ws: ## test websocket
cd test/full-setup/ws && npm install
Expand All @@ -114,7 +114,7 @@ test-http2: ## test HTTP2

cover: ## coverage
python3 -m http.server &> /dev/null &
TESTING=1 go test -race -count=1 --tags=unit,functional -coverprofile c.out ./...
TESTING=1 grc go test -race -count=1 --tags=unit,functional -coverprofile c.out ./...
go tool cover -func=c.out
go tool cover -html=c.out -o cover.html
pgrep python3 | xargs kill || true
Expand Down
1 change: 1 addition & 0 deletions docs/DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Go v1.15
- make
- [wrk](https://github.com/wg/wrk)
- [grc](https://github.com/garabik/grc)

## Setup

Expand Down
21 changes: 21 additions & 0 deletions test/full-setup/.grc/conf.gotest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# go-test grc colorizer configuration
regexp==== RUN .*
colour=bright_blue
-
regexp=--- PASS: .* (\(\d+\.\d+s\))
colour=green, yellow
-
regexp=^PASS$
colour=bold white on_green
-
regexp=^(ok|FAIL)\s+.*
colour=default, magenta
-
regexp=--- FAIL: .* (\(\d+\.\d+s\))
colour=red, yellow
-
regexp=^FAIL$
colour=bold white on_red
-
regexp=[^\s]+\.go(:\d+)?
colour=cyan
3 changes: 3 additions & 0 deletions test/full-setup/.grc/grc.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Go
^([/\w\.]+\/)?go test\b
conf.gotest

0 comments on commit 6005798

Please sign in to comment.