我在http://github.com/NeilGarb/budget設置了一個公共 golang 項目,帶有子包核心和 api。我將項目保存在 $GOPATH/src/github.com/NeilGarb/budget 中。我想使用 Travis CI 運行 core 的 ginkgo 測試,但是我在我的測試包中使用了絕對導入,而 Travis 抱怨它找不到所說的包。例如,我的測試包括:package user_testimport ( . "github.com/NeilGarb/budget/core")在我的本地機器上運行 ant 工作正常,但是當 travis 嘗試運行測試時,我得到:core-test:[exec] Failed to compile core:[exec] [exec] can't load package: package github.com/NeilGarb/budget/core: cannot find package "github.com/NeilGarb/budget/core" in any of:[exec] /home/travis/.gvm/gos/go1.2/src/pkg/github.com/NeilGarb/budget/core (from $GOROOT)[exec] /home/travis/.gvm/pkgsets/go1.2/global/src/github.com/NeilGarb/budget/core (from $GOPATH)[exec] [exec] Ginkgo ran in 714.967041ms[exec] Test Suite Failed我嘗試在我的測試中使用相對導入(即?!?./core”),這有效,但我的覆蓋率始終顯示為 0%。該怎么辦?:(
- 2 回答
- 0 關注
- 191 瀏覽
添加回答
舉報
0/150
提交
取消