From 92c6a65a0320ca62f71a052dcb238a38c51e235c Mon Sep 17 00:00:00 2001 From: Matt Landis Date: Thu, 30 Jan 2020 14:23:36 -0500 Subject: [PATCH] tilt: enable errcheck on tests (#2877) --- pkg/watch/notify_test.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/watch/notify_test.go b/pkg/watch/notify_test.go index 0b7697d99..b719cd609 100644 --- a/pkg/watch/notify_test.go +++ b/pkg/watch/notify_test.go @@ -12,6 +12,8 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/assert" "github.com/windmilleng/tilt/internal/dockerignore" @@ -95,7 +97,8 @@ func TestGitBranchSwitch(t *testing.T) { } if i != 0 { - os.RemoveAll(dir) + err := os.RemoveAll(dir) + require.NoError(t, err) } } @@ -313,7 +316,12 @@ func TestWatchBrokenLink(t *testing.T) { if err != nil { t.Fatal(err) } - defer newRoot.TearDown() + defer func() { + err := newRoot.TearDown() + if err != nil { + fmt.Printf("error tearing down temp dir: %v\n", err) + } + }() link := filepath.Join(newRoot.Path(), "brokenLink") missingFile := filepath.Join(newRoot.Path(), "missingFile") @@ -323,7 +331,8 @@ func TestWatchBrokenLink(t *testing.T) { } f.watch(newRoot.Path()) - os.Remove(link) + err = os.Remove(link) + require.NoError(t, err) f.assertEvents(link) }