From 1fa71877c512acd09d0e8c7ed5871d41c4529757 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Wed, 5 Jan 2022 11:11:13 -0400 Subject: [PATCH] chore: test coverage --- .github/workflows/unit-test.yml | 4 +++- Dockerfile | 2 -- Makefile | 2 +- README.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 4115a26..09f7118 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -23,4 +23,6 @@ jobs: dep ensure fi - name: Test - run: go test -v ./... \ No newline at end of file + run: go test -v ./... + - name: Upload coverage to Codecov + run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6973cc4..aceabfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,5 +6,3 @@ COPY go.* ./ RUN go mod download COPY . ./ - -RUN go test ./... -cover \ No newline at end of file diff --git a/Makefile b/Makefile index a42d5b4..dcc0036 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -TEST = "go test ./... -v -coverpkg=./... -coverprofile cp.out; go tool cover -func cp.out; rm cp.out" +TEST = "go test ./... -coverpkg=./... -coverprofile cp.out -covermode=atomic; go tool cover -func cp.out; rm cp.out" build: docker build . -t underscore:latest diff --git a/README.md b/README.md index fd35abe..33df447 100644 --- a/README.md +++ b/README.md @@ -74,10 +74,10 @@ And that's it. ## Tests -Building the docker image will run the tests automatically. Otherwise, you can simply run: +To run the unit tests, you can simply run: ```shell -go test ./... +make test ``` ## Functions