1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 09:20:02 +08:00

Merge pull request #2137 from Dignifiedquire/app

Fix  appveyor
This commit is contained in:
Juan Benet
2016-01-15 12:11:41 -05:00
4 changed files with 74 additions and 4 deletions

49
appveyor.yml Normal file
View File

@ -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

View File

@ -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++ {
@ -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 {
@ -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 {

View File

@ -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}
}
}

View File

@ -9,7 +9,8 @@
# 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
@ -17,7 +18,7 @@ PATH=$(pwd)/bin:${PATH}
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
@ -361,4 +362,3 @@ test_check_peerid() {
return 1
}
}