Skip to content

Commit

Permalink
all: remove temp directories in tests
Browse files Browse the repository at this point in the history
Change-Id: I33efc7302b381c8def3aeac35a2d618d0ad71918
  • Loading branch information
keegancsmith committed Sep 10, 2019
1 parent 47ff303 commit b1730d8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ func TestLargeFileOption(t *testing.T) {
if err != nil {
t.Fatalf("TempDir: %v", err)
}
defer func() {
os.RemoveAll(dir)
}()
defer os.RemoveAll(dir)

sizeMax := 1000
opts := Options{
Expand Down Expand Up @@ -151,6 +149,7 @@ func TestUpdate(t *testing.T) {
if err != nil {
t.Fatalf("TempDir: %v", err)
}
defer os.RemoveAll(dir)

opts := Options{
IndexDir: dir,
Expand Down Expand Up @@ -243,6 +242,7 @@ func TestDeleteOldShards(t *testing.T) {
if err != nil {
t.Fatalf("TempDir: %v", err)
}
defer os.RemoveAll(dir)

opts := Options{
IndexDir: dir,
Expand Down Expand Up @@ -325,6 +325,7 @@ func TestPartialSuccess(t *testing.T) {
if err != nil {
t.Fatalf("TempDir: %v", err)
}
defer os.RemoveAll(dir)

opts := Options{
IndexDir: dir,
Expand Down Expand Up @@ -447,6 +448,7 @@ func TestEmptyContent(t *testing.T) {
if err != nil {
t.Fatalf("TempDir: %v", err)
}
defer os.RemoveAll(dir)

opts := Options{
IndexDir: dir,
Expand Down
2 changes: 2 additions & 0 deletions gitindex/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package gitindex
import (
"io/ioutil"
"net/url"
"os"
"path/filepath"
"reflect"
"testing"
Expand All @@ -13,6 +14,7 @@ func TestDeleteRepos(t *testing.T) {
if err != nil {
t.Fatalf("TempDir: %v", err)
}
defer os.RemoveAll(dir)

if err := createSubmoduleRepo(dir); err != nil {
t.Error("createSubmoduleRepo", err)
Expand Down
1 change: 1 addition & 0 deletions gitindex/tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func TestFindGitRepos(t *testing.T) {
if err != nil {
t.Fatalf("TempDir: %v", err)
}
defer os.RemoveAll(dir)

if err := createSubmoduleRepo(dir); err != nil {
t.Error("createSubmoduleRepo", err)
Expand Down
1 change: 1 addition & 0 deletions shards/watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func TestDirWatcherUnloadOnce(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer os.RemoveAll(dir)

logger := &loggingLoader{
loads: make(chan string, 10),
Expand Down

0 comments on commit b1730d8

Please sign in to comment.