Skip to content

Commit

Permalink
Start fixing appveyor
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: dignifiedquire <dignifiedquire@gmail.com>
  • Loading branch information
dignifiedquire committed Dec 29, 2015
1 parent ec06c10 commit d6a1668
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 13 deletions.
47 changes: 38 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,49 @@
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.

version: "{build}"

os: Windows Server 2012 R2

clone_folder: c:\go\src\github.com\ipfs\go-ipfs

environment:
GOPATH: c:\gopath
TEST_NO_FUSE: 1
TEST_VERBOSE: 1
TEST_SUITE: test_sharness_expensive
#TEST_NO_FUSE: 1
#TEST_VERBOSE: 1
#TEST_SUITE: test_sharness_expensive
#GOFLAGS: -tags nofuse
global:
BASH: C:\cygwin\bin\bash
matrix:
- GOARCH: amd64
GOVERSION: 1.5.1
GOROOT: c:\go
DOWNLOADPLATFORM: "x64"

install:
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
- rmdir c:\go /s /q
- appveyor DownloadFile https://storage.googleapis.com/golang/go1.5.1.windows-amd64.msi
- msiexec /i go1.5.1.windows-amd64.msi /q
# Enable make
#- SET PATH=c:\MinGW\bin;%PATH%
#- copy c:\MinGW\bin\mingw32-make.exe c:\MinGW\bin\make.exe
- go version
- go env

# Cygwin build script
#
# NOTES:
#
# The stdin/stdout file descriptor appears not to be valid for the Appveyor
# build which causes failures as certain functions attempt to redirect
# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
#
build_script:
- make install
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make nofuse"'

test_script:
- make $TEST_SUITE
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; export GOFLAGS=''-tags nofuse''; export TEST_NO_FUSE=1; export TEST_VERBOSE=1; export TEST_SUITE=test_sharness_expensive; make $TEST_SUITE"'

build:
parallel: true
9 changes: 8 additions & 1 deletion test/dependencies/iptb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
manet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
)

var setupOpt = func(cmd *exec.Cmd) {}

// GetNumNodes returns the number of testbed nodes configured in the testbed directory
func GetNumNodes() int {
for i := 0; i < 2000; i++ {
Expand Down Expand Up @@ -279,7 +281,7 @@ func IpfsStart(waitall bool) error {
cmd.Dir = dir
cmd.Env = envForDaemon(i)

cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
setupOpt(cmd)

stdout, err := os.Create(path.Join(dir, "daemon.stdout"))
if err != nil {
Expand Down Expand Up @@ -602,6 +604,11 @@ func main() {
kingpin.Arg("args", "arguments").StringsVar(&args)
kingpin.Parse()

if len(args) == 0 {
kingpin.Usage()
return
}

switch args[0] {
case "init":
if cfg.Count == 0 {
Expand Down
14 changes: 14 additions & 0 deletions test/dependencies/iptb/proc_unix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// +build !windows

package main

import (
"os/exec"
"syscall"
)

func init() {
setupOpt = func(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
}
}
6 changes: 3 additions & 3 deletions test/sharness/lib/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
# use the ipfs tool to test against

# add current directory to path, for ipfs tool.
PATH=$(pwd)/bin:${PATH}
BIN=$(cd .. && echo `pwd`/bin)
PATH=${BIN}:${PATH}

# set sharness verbosity. we set the env var directly as
# it's too late to pass in --verbose, and --verbose is harder
# to pass through in some cases.
test "$TEST_VERBOSE" = 1 && verbose=t

# assert the `ipfs` we're using is the right one.
if test `which ipfs` != $(pwd)/bin/ipfs; then
if test `which ipfs` != ${BIN}/ipfs; then
echo >&2 "Cannot find the tests' local ipfs tool."
echo >&2 "Please check test and ipfs tool installation."
exit 1
Expand Down Expand Up @@ -352,4 +353,3 @@ test_check_peerid() {
return 1
}
}

0 comments on commit d6a1668

Please sign in to comment.