Skip to content

Commit

Permalink
cmd/swarm: fix appveyor build (ethereum#17808)
Browse files Browse the repository at this point in the history
  • Loading branch information
acud authored and nonsense committed Oct 2, 2018
1 parent 26a37c5 commit bd1f7eb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
6 changes: 4 additions & 2 deletions cmd/swarm/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.

// +build !windows

package main

import (
Expand All @@ -26,6 +24,7 @@ import (
"io/ioutil"
"net/http"
"os"
"runtime"
"strings"
"testing"

Expand All @@ -40,6 +39,9 @@ import (
// 5. imports the exported datastore
// 6. fetches the uploaded random file from the second node
func TestCLISwarmExportImport(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}
cluster := newTestCluster(t, 1)

// generate random 10mb file
Expand Down
3 changes: 3 additions & 0 deletions cmd/swarm/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package main
import (
"context"
"crypto/ecdsa"
"flag"
"fmt"
"io/ioutil"
"net"
Expand All @@ -41,6 +42,8 @@ import (
"github.com/ethereum/go-ethereum/swarm"
)

var loglevel = flag.Int("loglevel", 3, "verbosity of logs")

func init() {
// Run the app if we've been exec'd as "swarm-test" in runSwarm.
reexec.Register("swarm-test", func() {
Expand Down
22 changes: 17 additions & 5 deletions cmd/swarm/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.

// +build !windows

package main

import (
"bytes"
"flag"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"runtime"
"strings"
"testing"
"time"
Expand All @@ -37,8 +35,6 @@ import (
"github.com/mattn/go-colorable"
)

var loglevel = flag.Int("loglevel", 3, "verbosity of logs")

func init() {
log.PrintOrigins(true)
log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(*loglevel), log.StreamHandler(colorable.NewColorableStderr(), log.TerminalFormat(true))))
Expand All @@ -47,18 +43,31 @@ func init() {
// TestCLISwarmUp tests that running 'swarm up' makes the resulting file
// available from all nodes via the HTTP API
func TestCLISwarmUp(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}

testCLISwarmUp(false, t)
}
func TestCLISwarmUpRecursive(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}
testCLISwarmUpRecursive(false, t)
}

// TestCLISwarmUpEncrypted tests that running 'swarm encrypted-up' makes the resulting file
// available from all nodes via the HTTP API
func TestCLISwarmUpEncrypted(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}
testCLISwarmUp(true, t)
}
func TestCLISwarmUpEncryptedRecursive(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}
testCLISwarmUpRecursive(true, t)
}

Expand Down Expand Up @@ -279,6 +288,9 @@ func testCLISwarmUpRecursive(toEncrypt bool, t *testing.T) {
// TestCLISwarmUpDefaultPath tests swarm recursive upload with relative and absolute
// default paths and with encryption.
func TestCLISwarmUpDefaultPath(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}
testCLISwarmUpDefaultPath(false, false, t)
testCLISwarmUpDefaultPath(false, true, t)
testCLISwarmUpDefaultPath(true, false, t)
Expand Down

0 comments on commit bd1f7eb

Please sign in to comment.