瀏覽代碼

Merge pull request #72 from vmarkovtsev/master

Small CI and code improvements
Vadim Markovtsev 7 年之前
父節點
當前提交
0d4a50ae4b
共有 5 個文件被更改,包括 15 次插入4 次删除
  1. 5 1
      appveyor.yml
  2. 2 2
      changes_xpather.go
  3. 2 0
      changes_xpather_test.go
  4. 2 0
      comment_sentiment_test.go
  5. 4 1
      uast_test.go

+ 5 - 1
appveyor.yml

@@ -8,7 +8,7 @@ environment:
   GOPATH: c:\gopath
   GOPATH: c:\gopath
 
 
 install:
 install:
-  - choco install --allow-empty-checksums make
+  - appveyor-retry choco install --allow-empty-checksums make
   - c:\msys64\usr\bin\pacman --noconfirm --needed -S mingw-w64-x86_64-toolchain
   - c:\msys64\usr\bin\pacman --noconfirm --needed -S mingw-w64-x86_64-toolchain
   - curl -SLko protoc.zip https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-win32.zip
   - curl -SLko protoc.zip https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-win32.zip
   - 7z e protoc.zip
   - 7z e protoc.zip
@@ -22,6 +22,10 @@ build_script:
   - make
   - make
   - 7z a c:\gopath\src\gopkg.in\src-d\hercules.v3\hercules.win64.zip %GOPATH%\bin\hercules.exe
   - 7z a c:\gopath\src\gopkg.in\src-d\hercules.v3\hercules.win64.zip %GOPATH%\bin\hercules.exe
 
 
+test_script:
+  - go get -v -t -d gopkg.in/src-d/hercules.v3/...
+  - go test -v -tags disable_babelfish gopkg.in/src-d/hercules.v3
+
 artifacts:
 artifacts:
   - name: hercules.win64.zip
   - name: hercules.win64.zip
     path: hercules.win64.zip
     path: hercules.win64.zip

+ 2 - 2
changes_xpather.go

@@ -1,14 +1,14 @@
 package hercules
 package hercules
 
 
 import (
 import (
+	"bytes"
 	"log"
 	"log"
+	"io"
 
 
-	"bytes"
 	"github.com/minio/highwayhash"
 	"github.com/minio/highwayhash"
 	"gopkg.in/bblfsh/client-go.v2/tools"
 	"gopkg.in/bblfsh/client-go.v2/tools"
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing"
-	"io"
 )
 )
 
 
 // ChangesXPather extracts changed UAST nodes from files changed in the current commit.
 // ChangesXPather extracts changed UAST nodes from files changed in the current commit.

+ 2 - 0
changes_xpather_test.go

@@ -1,3 +1,5 @@
+// +build !disable_babelfish
+
 package hercules
 package hercules
 
 
 import (
 import (

+ 2 - 0
comment_sentiment_test.go

@@ -1,3 +1,5 @@
+// +build tensorflow
+
 package hercules
 package hercules
 
 
 import (
 import (

+ 4 - 1
uast_test.go

@@ -1,3 +1,5 @@
+// +build !disable_babelfish
+
 package hercules
 package hercules
 
 
 import (
 import (
@@ -7,13 +9,14 @@ import (
 	"testing"
 	"testing"
 
 
 	"fmt"
 	"fmt"
+	"path"
+
 	"github.com/gogo/protobuf/proto"
 	"github.com/gogo/protobuf/proto"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/assert"
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/bblfsh/sdk.v1/uast"
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/go-git.v4/plumbing/object"
 	"gopkg.in/src-d/hercules.v3/pb"
 	"gopkg.in/src-d/hercules.v3/pb"
-	"path"
 )
 )
 
 
 func fixtureUASTExtractor() *UASTExtractor {
 func fixtureUASTExtractor() *UASTExtractor {