Skip to content

Commit

Permalink
test(pipe): fix tests cleanup (#4636)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Feb 17, 2024
1 parent 554ca5f commit dab740d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ linters:
- misspell
- depguard
- testifylint
- gocritic
linters-settings:
staticcheck:
checks:
Expand All @@ -35,3 +36,6 @@ linters-settings:
deny:
- pkg: "github.com/pkg/errors"
desc: "use stdlib instead"
gocritic:
enabled-checks:
- exitAfterDefer
5 changes: 3 additions & 2 deletions internal/pipe/before/before_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import (

func TestMain(m *testing.M) {
log.SetLevel(log.DebugLevel)
defer log.SetLevel(log.InfoLevel)
os.Exit(m.Run())
code := m.Run()
log.SetLevel(log.InfoLevel)
os.Exit(code)
}

func TestDescription(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions internal/pipe/sign/sign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ func TestMain(m *testing.M) {
os.Exit(1)
}

defer os.RemoveAll(keyring)
os.Exit(m.Run())
code := m.Run()
_ = os.RemoveAll(keyring)
os.Exit(code)
}

func TestDescription(t *testing.T) {
Expand Down

0 comments on commit dab740d

Please sign in to comment.