Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix appveyor #2137

Merged
merged 2 commits into from
Jan 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +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
#GOFLAGS: -tags nofuse
global:
BASH: C:\cygwin\bin\bash
matrix:
- GOARCH: amd64
GOVERSION: 1.5.1
GOROOT: c:\go
DOWNLOADPLATFORM: "x64"

install:
# 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:
- '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make nofuse"'

test_script:
- '%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) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were these changes contributed to iptb proper?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this was just pulled in from iptb

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ipfs/iptb@b21f95b is the commit I think


// 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 @@ -361,4 +362,3 @@ test_check_peerid() {
return 1
}
}