Skip to content

Commit

Permalink
chore: test cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Jul 17, 2024
1 parent 30d8c04 commit f88e7a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"compress/gzip"
"fmt"
"io"
"log"
"os"
"path/filepath"
"testing"
Expand Down Expand Up @@ -91,7 +90,7 @@ func Test_TarDir(t *testing.T) {

srcFiles, err := os.ReadDir(src)
if err != nil {
log.Fatal(err)
t.Fatal(err)
}

for _, srcFile := range srcFiles {
Expand Down
3 changes: 1 addition & 2 deletions modules/dolt/dolt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestDoltWithPublicRemoteCloneUrl(t *testing.T) {
}

func createTestCredsFile(t *testing.T) string {
file, err := os.CreateTemp(os.TempDir(), "prefix")
file, err := os.CreateTemp(t.TempDir(), "prefix")
if err != nil {
t.Fatal(err)
}
Expand All @@ -100,7 +100,6 @@ func TestDoltWithPrivateRemoteCloneUrl(t *testing.T) {
ctx := context.Background()

filename := createTestCredsFile(t)
defer os.RemoveAll(filename)
_, err := dolt.Run(ctx,
"dolthub/dolt-sql-server:1.32.4",
dolt.WithDatabase("foo"),
Expand Down
3 changes: 1 addition & 2 deletions modules/openldap/openldap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@ mail: [email protected]
userPassword: Password1
`

f, err := os.CreateTemp("", "test.ldif")
f, err := os.CreateTemp(t.TempDir(), "test.ldif")
if err != nil {
t.Fatal(err)
}
defer os.Remove(f.Name())

_, err = f.WriteString(ldif)
if err != nil {
Expand Down

0 comments on commit f88e7a2

Please sign in to comment.