Skip to content

Commit

Permalink
Remove shard testing folders
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
  • Loading branch information
hsanjuan committed Nov 1, 2018
1 parent e20429f commit 1d924bf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions api/rest/client/methods_test.go
Expand Up @@ -436,6 +436,7 @@ func TestAddMultiFile(t *testing.T) {

testF := func(t *testing.T, c Client) {
sth := test.NewShardingTestHelper()
defer sth.Clean(t)
mfr, closer := sth.GetTreeMultiReader(t)
defer closer.Close()

Expand Down
24 changes: 22 additions & 2 deletions api/rest/restapi_test.go
Expand Up @@ -377,10 +377,20 @@ func TestAPIAddFileEndpointBadContentType(t *testing.T) {
func TestAPIAddFileEndpointLocal(t *testing.T) {
rest := testAPI(t)
defer rest.Shutdown()

sth := test.NewShardingTestHelper()
defer sth.Clean(t)

// This writes generates the testing files and
// writes them to disk.
// This is necessary here because we run tests
// in parallel, and otherwise a write-race might happen.
_, closer := sth.GetTreeMultiReader(t)
closer.Close()

tf := func(t *testing.T, url urlF) {
fmtStr1 := "/add?shard=true&repl_min=-1&repl_max=-1"
localURL := url(rest) + fmtStr1
sth := test.NewShardingTestHelper()
body, closer := sth.GetTreeMultiReader(t)
defer closer.Close()
resp := api.AddedOutput{}
Expand All @@ -394,8 +404,18 @@ func TestAPIAddFileEndpointLocal(t *testing.T) {
func TestAPIAddFileEndpointShard(t *testing.T) {
rest := testAPI(t)
defer rest.Shutdown()

sth := test.NewShardingTestHelper()
defer sth.Clean(t)

// This writes generates the testing files and
// writes them to disk.
// This is necessary here because we run tests
// in parallel, and otherwise a write-race might happen.
_, closer := sth.GetTreeMultiReader(t)
closer.Close()

tf := func(t *testing.T, url urlF) {
sth := test.NewShardingTestHelper()
body, closer := sth.GetTreeMultiReader(t)
defer closer.Close()
mpContentType := "multipart/form-data; boundary=" + body.Boundary()
Expand Down

0 comments on commit 1d924bf

Please sign in to comment.