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 #189 from mcuadros/integration
Browse files Browse the repository at this point in the history
sdk: intregration-test now is self-contained
  • Loading branch information
juanjux authored Oct 3, 2017
2 parents 0f9f2d7 + 7dbae5f commit 421904b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
12 changes: 10 additions & 2 deletions assets/build/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion etc/build/make/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ BUILD_PATH := $(location)/build
RUN := $(sdklocation)/etc/run.sh
RUN_VERBOSE := VERBOSE=1 $(RUN)

GRPC_PORT := 9432
GRPC_PORT_INTEGRATION ?= 39432

# docker runtime commands
DOCKER_CMD ?= docker
DOCKER_BUILD ?= $(DOCKER_CMD) build
Expand Down Expand Up @@ -106,7 +109,12 @@ build-driver-internal: $(BUILD_PATH)
$(RUN) $(GO_CMD) build -o $(BUILD_PATH)/bin/driver .

integration-test: build
@$(RUN_VERBOSE) $(bblfsh-sdk-tools) test
CONTAINER_ID=`$(DOCKER_CMD) run -d \
-p $(GRPC_PORT_INTEGRATION):$(GRPC_PORT) \
$(call unescape_docker_tag,$(DOCKER_IMAGE_VERSIONED))`; \
echo "CONTAINER_ID: $$CONTAINER_ID"; \
$(bblfsh-sdk-tools) test --endpoint localhost:$(GRPC_PORT_INTEGRATION) || true; \
docker kill $$CONTAINER_ID;

push: build
$(if $(pushdisabled),$(error $(pushdisabled)))
Expand Down
2 changes: 1 addition & 1 deletion sdk/driver/integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (s *suite) SetUpTest(t *testing.T) {

r := require.New(t)
// TODO: use client-go as soon NativeParse request is availabe on it.
conn, err := grpc.Dial(s.Endpoint, grpc.WithTimeout(time.Second*2), grpc.WithInsecure())
conn, err := grpc.Dial(s.Endpoint, grpc.WithTimeout(time.Second*2), grpc.WithInsecure(), grpc.WithBlock())
r.Nil(err)

s.c = protocol.NewProtocolServiceClient(conn)
Expand Down
2 changes: 1 addition & 1 deletion sdk/driver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (s *Server) initialize() error {
func (s *Server) initializeFlags() {
const (
defaultNetwork = "tcp"
defaultAddress = "localhost:9432"
defaultAddress = "0.0.0.0:9432"
defaultVerbose = "info"
defaultFormat = "text"
)
Expand Down

0 comments on commit 421904b

Please sign in to comment.