Unverified 提交 6b58b132 作者: Steven Allen 提交者: GitHub

Merge pull request #6235 from ipfs/fix/macos-fuse

build: fix macos build with fuse
...@@ -36,6 +36,21 @@ defaults: &defaults ...@@ -36,6 +36,21 @@ defaults: &defaults
- image: circleci/golang:1.12 - image: circleci/golang:1.12
jobs: jobs:
gobuild:
<<: *defaults
steps:
- checkout
- *make_out_dirs
- *restore_gomod
- run:
command: make cmd/ipfs-try-build
environment:
TEST_NO_FUSE: 0
- run:
command: make cmd/ipfs-try-build
environment:
TEST_NO_FUSE: 1
- *store_gomod
gotest: gotest:
<<: *defaults <<: *defaults
steps: steps:
...@@ -43,7 +58,6 @@ jobs: ...@@ -43,7 +58,6 @@ jobs:
- *make_out_dirs - *make_out_dirs
- *restore_gomod - *restore_gomod
- run: make cmd/ipfs-try-build
- run: | - run: |
make -j 1 test/unit/gotest.junit.xml \ make -j 1 test/unit/gotest.junit.xml \
&& [[ ! $(jq -s -c 'map(select(.Action == "fail")) | .[]' test/unit/gotest.json) ]] && [[ ! $(jq -s -c 'map(select(.Action == "fail")) | .[]' test/unit/gotest.json) ]]
...@@ -96,5 +110,6 @@ workflows: ...@@ -96,5 +110,6 @@ workflows:
version: 2 version: 2
test: test:
jobs: jobs:
- gobuild
- gotest - gotest
- sharness - sharness
...@@ -8,8 +8,6 @@ import ( ...@@ -8,8 +8,6 @@ import (
core "github.com/ipfs/go-ipfs/core" core "github.com/ipfs/go-ipfs/core"
) )
type errNeedFuseVersion error // used in tests, needed in OSX
func Mount(node *core.IpfsNode, fsdir, nsdir string) error { func Mount(node *core.IpfsNode, fsdir, nsdir string) error {
return errors.New("not compiled in") return errors.New("not compiled in")
} }
...@@ -5,6 +5,7 @@ package node ...@@ -5,6 +5,7 @@ package node
import ( import (
"io/ioutil" "io/ioutil"
"os" "os"
"strings"
"testing" "testing"
"time" "time"
...@@ -63,7 +64,7 @@ func TestExternalUnmount(t *testing.T) { ...@@ -63,7 +64,7 @@ func TestExternalUnmount(t *testing.T) {
mkdir(t, ipnsDir) mkdir(t, ipnsDir)
err = Mount(node, ipfsDir, ipnsDir) err = Mount(node, ipfsDir, ipnsDir)
if _, ok := err.(errNeedFuseVersion); ok || err == fuse.ErrOSXFUSENotFound { if strings.Contains(err.Error(), "unable to check fuse version") || err == fuse.ErrOSXFUSENotFound {
t.Skip(err) t.Skip(err)
} }
if err != nil { if err != nil {
......
...@@ -30,8 +30,6 @@ var platformFuseChecks = func(*core.IpfsNode) error { ...@@ -30,8 +30,6 @@ var platformFuseChecks = func(*core.IpfsNode) error {
return nil return nil
} }
type errNeedFuseVersion error // used in tests, needed in OSX
func Mount(node *core.IpfsNode, fsdir, nsdir string) error { func Mount(node *core.IpfsNode, fsdir, nsdir string) error {
// check if we already have live mounts. // check if we already have live mounts.
// if the user said "Mount", then there must be something wrong. // if the user said "Mount", then there must be something wrong.
......
...@@ -46,6 +46,8 @@ test_go_test: $$(DEPS_GO) ...@@ -46,6 +46,8 @@ test_go_test: $$(DEPS_GO)
$(GOCC) test $(go-flags-with-tags) $(GOTFLAGS) ./... $(GOCC) test $(go-flags-with-tags) $(GOTFLAGS) ./...
.PHONY: test_go_test .PHONY: test_go_test
test_go_build: $$(TEST_GO_BUILD)
test_go_short: GOTFLAGS += -test.short test_go_short: GOTFLAGS += -test.short
test_go_short: test_go_test test_go_short: test_go_test
.PHONY: test_go_short .PHONY: test_go_short
...@@ -54,7 +56,7 @@ test_go_race: GOTFLAGS += -race ...@@ -54,7 +56,7 @@ test_go_race: GOTFLAGS += -race
test_go_race: test_go_test test_go_race: test_go_test
.PHONY: test_go_race .PHONY: test_go_race
test_go_expensive: test_go_test $$(TEST_GO_BUILD) test_go_expensive: test_go_test test_go_build
.PHONY: test_go_expensive .PHONY: test_go_expensive
TEST_GO += test_go_expensive TEST_GO += test_go_expensive
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论