Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #13 from bblfsh/test
Browse files Browse the repository at this point in the history
integration test and travis
  • Loading branch information
abeaumont authored Sep 13, 2017
2 parents 9341892 + 901c403 commit 801a7f7
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 14 deletions.
25 changes: 15 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
language: go
sudo: false

go:
- 1.7.x
- 1.8.x
- 1.9.x
- master
- 1.9

before_install:
- make deps
go_import_path: gopkg.in/bblfsh/client-go.v0

sudo: required

install:
- make build
services:
- docker

before_install:
- docker run --privileged -d -p 9432:9432 --name bblfsh bblfsh/server
- make dependencies

script:
- make test
- make test-coverage

after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if err != nil {

python := "import foo"

res, err := client.NewParseRequest().Content(python).Do()
res, err := client.NewParseRequest().Language("python").Content(python).Do()
if err != nil {
panic(err)
}
Expand Down
29 changes: 29 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package bblfsh

import (
"fmt"
"testing"

"github.com/stretchr/testify/require"
)

func TestClient(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test")
}

cli, err := NewBblfshClient("localhost:9432")
require.Nil(t, err)

python := "import foo"

res, err := cli.NewParseRequest().Language("python").Content(python).Do()
require.Nil(t, err)

fmt.Println(res.Errors)
fmt.Println(res.UAST)

require.Equal(t, len(res.Errors), 0)
require.NotNil(t, res.UAST)

}
9 changes: 6 additions & 3 deletions parse_request_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package bblfsh

import "testing"
import "gopkg.in/bblfsh/sdk.v0/protocol"
import "github.com/stretchr/testify/require"
import (
"testing"

"github.com/stretchr/testify/require"
"gopkg.in/bblfsh/sdk.v0/protocol"
)

func TestParseRequestConfiguration(t *testing.T) {
req := ParseRequest{}
Expand Down

0 comments on commit 801a7f7

Please sign in to comment.