From 6d28f8f85c8438239366ef52385ef29f8a8270bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 31 Jan 2018 14:35:01 +0100 Subject: [PATCH 1/5] fix test data on windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..a6bcaf8ce1b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +assets/init-doc/* binary +core/coreunix/test_data/** binary From d399cdfec9a0b3bb43dc802df326df66de318135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 31 Jan 2018 14:41:49 +0100 Subject: [PATCH 2/5] disable some tests on windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- cmd/ipfs/util/ulimit_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/ipfs/util/ulimit_test.go b/cmd/ipfs/util/ulimit_test.go index ffba72ea819..2fcc9f41379 100644 --- a/cmd/ipfs/util/ulimit_test.go +++ b/cmd/ipfs/util/ulimit_test.go @@ -1,3 +1,5 @@ +// +build !windows + package util import ( From f1c4df89997f15611987cde972ed654b677e161d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 31 Jan 2018 15:03:22 +0100 Subject: [PATCH 3/5] fix pin test on windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- pin/pin_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pin/pin_test.go b/pin/pin_test.go index 3652ef8e722..c0137a0d346 100644 --- a/pin/pin_test.go +++ b/pin/pin_test.go @@ -16,10 +16,12 @@ import ( cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) +var rand = util.NewTimeSeededRand() + func randNode() (*mdag.ProtoNode, *cid.Cid) { nd := new(mdag.ProtoNode) nd.SetData(make([]byte, 32)) - util.NewTimeSeededRand().Read(nd.Data()) + rand.Read(nd.Data()) k := nd.Cid() return nd, k } From 2b6641dbd0de0560e8c05a6e255257f9ac55ba12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 31 Jan 2018 15:40:11 +0100 Subject: [PATCH 4/5] disable perm check in serialize_test.go/TestConfig on windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- repo/fsrepo/serialize/serialize_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/repo/fsrepo/serialize/serialize_test.go b/repo/fsrepo/serialize/serialize_test.go index 4547a4b809f..443024ed8f6 100644 --- a/repo/fsrepo/serialize/serialize_test.go +++ b/repo/fsrepo/serialize/serialize_test.go @@ -2,6 +2,7 @@ package fsrepo import ( "os" + "runtime" "testing" config "github.com/ipfs/go-ipfs/repo/config" @@ -27,7 +28,10 @@ func TestConfig(t *testing.T) { if err != nil { t.Fatalf("cannot stat config file: %v", err) } - if g := st.Mode().Perm(); g&0117 != 0 { - t.Fatalf("config file should not be executable or accessible to world: %v", g) + + if runtime.GOOS != "windows" { // see https://golang.org/src/os/types_windows.go + if g := st.Mode().Perm(); g&0117 != 0 { + t.Fatalf("config file should not be executable or accessible to world: %v", g) + } } } From dcfcfc5e8edb3f3adc9644c82468b64750c2c044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 31 Jan 2018 15:47:07 +0100 Subject: [PATCH 5/5] "fix" routing/mock tests on windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- routing/mock/centralized_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routing/mock/centralized_test.go b/routing/mock/centralized_test.go index 00ca6aec09d..8d056a139f5 100644 --- a/routing/mock/centralized_test.go +++ b/routing/mock/centralized_test.go @@ -6,9 +6,9 @@ import ( "time" delay "github.com/ipfs/go-ipfs/thirdparty/delay" - "gx/ipfs/QmVvkK7s5imCiq3JVbL3pGfnhcCnf3LrFJPF4GE2sAoGZf/go-testutil" u "gx/ipfs/QmNiJuT8Ja3hMVpBHXv3Q6dwmperaQ6JjLtpMQgMCD7xvx/go-ipfs-util" + testutil "gx/ipfs/QmVvkK7s5imCiq3JVbL3pGfnhcCnf3LrFJPF4GE2sAoGZf/go-testutil" pstore "gx/ipfs/QmXauCuJzmzapetmC6W4TuDJLL1yFFrVzSHoWv8YdbmnxH/go-libp2p-peerstore" cid "gx/ipfs/QmcZfnkapfECQGcLZaf9B79NRg7cRa9EnZh4LSbkCzwNvY/go-cid" ) @@ -164,6 +164,8 @@ func TestValidAfter(t *testing.T) { } conf.ValueVisibility.Set(0) + time.Sleep(100 * time.Millisecond) + providersChan = rs.Client(pi).FindProvidersAsync(ctx, key, max) t.Log("providers", providers) for p := range providersChan {