Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
go-version: stable
- name: Calculate coverage
run: |
go test -v -covermode=count -coverprofile=cover.out.raw -coverpkg=./... ./...
go test -v -covermode=atomic -coverprofile=cover.out.raw -coverpkg=./... ./...
# remove mocks from coverage calculation
grep -v mock_ cover.out.raw > cover.out
- name: Generage coverage badge
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/dist
/cover.out
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ build:
.PHONY: fuzz
fuzz: mod-tidy generate
go test -fuzz='^Fuzz' -fuzztime=10s -v ./internal/server

.PHONY: cover
cover: mod-tidy generate
go test -v -covermode=atomic -coverprofile=cover.out -coverpkg=./... ./...
go tool cover -html=cover.out
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Then push some code to main:
git checkout --orphan badges
git rm -rf .
rm -f .gitignore
echo 'This branch exists only to contains the coverage badge in the README on `main`.' > README.md
echo 'This branch exists only to store the coverage badge in the README on `main`.' > README.md
git add README.md
git commit -m 'chore: initialize the badges branch'
git push origin badges
Expand Down Expand Up @@ -101,7 +101,7 @@ Configure the repository:

1. Go to repository Settings > Rules > Rulesets, and import the `protect-default-branch.json` ruleset.

1. That's it.
That's it.

## How to contribute

Expand Down
4 changes: 4 additions & 0 deletions internal/server/serve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func TestGreet(t *testing.T) {
expect: "time travel detected",
expectError: true,
},
"late birthday": {
input: []string{"Foo", "2000-12-22"},
expect: "Hello Foo, happy belated birthday for 355 days ago.",
},
}
for name, tc := range testCases {
t.Run(name, func(tt *testing.T) {
Expand Down