Start fixing appveyor
License: MIT Signed-off-by: dignifiedquire <dignifiedquire@gmail.com>
dignifiedquire committed
Dec 5, 2015 at 22:25 UTC
4f06a0d8bdfc4461a3f9ab433f749ef2b189d092
4 files changed
+63
-13
appveyor.yml
+38
-9
@@ -1,20 +1,49 @@
1
+# Notes:
2
+# - Minimal appveyor.yml file is an empty file. All sections are optional.
3
+# - Indent each level of configuration with 2 spaces. Do not use tabs!
4
+# - All section names are case-sensitive.
5
+# - Section names should be unique on each level.
6
+
7
version: "{build}"
8
+
9
os: Windows Server 2012 R2
10
+
11
+clone_folder: c:\go\src\github.com\ipfs\go-ipfs
12
+
13
environment:
14
GOPATH: c:\gopath
5
- TEST_NO_FUSE: 1
6
- TEST_VERBOSE: 1
7
- TEST_SUITE: test_sharness_expensive
15
+ #TEST_NO_FUSE: 1
16
+ #TEST_VERBOSE: 1
17
+ #TEST_SUITE: test_sharness_expensive
18
+ #GOFLAGS: -tags nofuse
19
+ global:
20
+ BASH: C:\cygwin\bin\bash
21
+ matrix:
22
+ - GOARCH: amd64
23
+ GOVERSION: 1.5.1
24
+ GOROOT: c:\go
25
+ DOWNLOADPLATFORM: "x64"
26
+
27
install:
9
- - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
10
- - rmdir c:\go /s /q
11
- - appveyor DownloadFile https://storage.googleapis.com/golang/go1.5.1.windows-amd64.msi
12
- - msiexec /i go1.5.1.windows-amd64.msi /q
28
+ # Enable make
29
+ #- SET PATH=c:\MinGW\bin;%PATH%
30
+ #- copy c:\MinGW\bin\mingw32-make.exe c:\MinGW\bin\make.exe
31
- go version
32
- go env
33
+
34
+# Cygwin build script
35
+#
36
+# NOTES:
37
+#
38
+# The stdin/stdout file descriptor appears not to be valid for the Appveyor
39
+# build which causes failures as certain functions attempt to redirect
40
+# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
41
+#
42
build_script:
16
- - make install
43
+ - '%BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make nofuse"'
44
+
45
test_script:
18
- - make $TEST_SUITE
46
+ - '%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"'
47
+
48
build:
49
parallel: true
test/dependencies/iptb/main.go
+8
-1
@@ -23,6 +23,8 @@ import (
23
manet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
24
)
25
26
+var setupOpt = func(cmd *exec.Cmd) {}
27
+
28
// GetNumNodes returns the number of testbed nodes configured in the testbed directory
29
func GetNumNodes() int {
30
for i := 0; i < 2000; i++ {
@@ -279,7 +281,7 @@ func IpfsStart(waitall bool) error {
281
cmd.Dir = dir
282
cmd.Env = envForDaemon(i)
283
282
- cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
284
+ setupOpt(cmd)
285
286
stdout, err := os.Create(path.Join(dir, "daemon.stdout"))
287
if err != nil {
@@ -602,6 +604,11 @@ func main() {
604
kingpin.Arg("args", "arguments").StringsVar(&args)
605
kingpin.Parse()
606
607
+ if len(args) == 0 {
608
+ kingpin.Usage()
609
+ return
610
+ }
611
+
612
switch args[0] {
613
case "init":
614
if cfg.Count == 0 {
test/dependencies/iptb/proc_unix.go
new
+14
@@ -0,0 +1,14 @@
1
+// +build !windows
2
+
3
+package main
4
+
5
+import (
6
+ "os/exec"
7
+ "syscall"
8
+)
9
+
10
+func init() {
11
+ setupOpt = func(cmd *exec.Cmd) {
12
+ cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
13
+ }
14
+}
test/sharness/lib/test-lib.sh
+3
-3
@@ -9,7 +9,8 @@
9
# use the ipfs tool to test against
10
11
# add current directory to path, for ipfs tool.
12
-PATH=$(pwd)/bin:${PATH}
12
+BIN=$(cd .. && echo `pwd`/bin)
13
+PATH=${BIN}:${PATH}
14
15
# set sharness verbosity. we set the env var directly as
16
# it's too late to pass in --verbose, and --verbose is harder
@@ -17,7 +18,7 @@ PATH=$(pwd)/bin:${PATH}
18
test "$TEST_VERBOSE" = 1 && verbose=t
19
20
# assert the `ipfs` we're using is the right one.
20
-if test `which ipfs` != $(pwd)/bin/ipfs; then
21
+if test `which ipfs` != ${BIN}/ipfs; then
22
echo >&2 "Cannot find the tests' local ipfs tool."
23
echo >&2 "Please check test and ipfs tool installation."
24
exit 1
@@ -361,4 +362,3 @@ test_check_peerid() {
362
return 1
363
}
364
}
364
-