Skip to content

Commit

Permalink
Add coverage statistics in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
georgepsarakis committed Dec 17, 2023
1 parent 6f35869 commit 287293c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ jobs:
go-version: '1.21.x'
- name: Install dependencies
run: go get .
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Build
run: go build -v ./...
- name: Unit Tests
run: go test -v ./...
run: go test -v -json -race -coverprofile=cover.out ./... | gotestfmt
- name: CLI Integration Tests
run: go test -v main_test.go
run: go test -v -json -race main_test.go | gotestfmt
3 changes: 1 addition & 2 deletions loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package loader

import (
"bytes"
"errors"
"fmt"
pg_query "github.com/pganalyze/pg_query_go/v4"
migrate "github.com/rubenv/sql-migrate"
Expand Down Expand Up @@ -76,7 +75,7 @@ func ReadStatementsFromFiles(paths ...string) ([]MigrationFile, error) {
return nil, err
}
if fileInfo.IsDir() {
return nil, errors.New(fmt.Sprintf("expected file and %s is a directory", p))
return nil, fmt.Errorf("expected file and %s is a directory", p)
}
sql, err := os.ReadFile(p)
if err != nil {
Expand Down

0 comments on commit 287293c

Please sign in to comment.