Skip to content

Commit

Permalink
test: skip test that flakes on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Zachary Newman <[email protected]>
  • Loading branch information
znewman01 committed Apr 24, 2022
1 parent 7cfdb8a commit ad020e8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/blob/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ import (
"net/http/httptest"
"os"
"path"
"runtime"
"testing"
)

func TestLoadFileOrURL(t *testing.T) {
func TestLoadFile(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Skipping on Windows due to https://github.com/golang/go/issues/51442")
}
temp := t.TempDir()
fname := "filename.txt"
path := path.Join(temp, fname)
Expand All @@ -49,13 +53,17 @@ func TestLoadFileOrURL(t *testing.T) {
} else if !bytes.Equal(actual, data) {
t.Errorf("LoadFileOrURL(relative path) = '%s'; want '%s'", actual, data)
}
}

func TestLoadURL(t *testing.T) {
data := []byte("test")

server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
rw.Write(data)
}))
defer server.Close()

actual, err = LoadFileOrURL(server.URL)
actual, err := LoadFileOrURL(server.URL)
if err != nil {
t.Errorf("Reading from HTTP failed: %v", err)
} else if !bytes.Equal(actual, data) {
Expand Down

0 comments on commit ad020e8

Please sign in to comment.