Skip to content

Commit

Permalink
Split examples & Integration Test (#27)
Browse files Browse the repository at this point in the history
* add action

* add grpc listen

* only run

* using gripmock:test

* using gripmock:test

* wait for it to serve

* test example 2

* run simple example

* fix args

* dont remove gripmock

* wrap ups test

* support go package with semicolon

* fix alias package

* wkt example

* fix example stream

* change event of integration test

* address review
  • Loading branch information
jekiapp authored Sep 17, 2019
1 parent 697cec3 commit 845771c
Show file tree
Hide file tree
Showing 22 changed files with 525 additions and 703 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Integration test
on:
pull_request:
branches:
master


jobs:
build:
name: Run example
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Run Simple Example
uses: ./
with:
entrypoint: .github/workflows/run-example.sh
args: simple
- name: Run Stream Example
uses: ./
with:
entrypoint: .github/workflows/run-example.sh
args: stream
- name: Run WKT Example
uses: ./
with:
entrypoint: .github/workflows/run-example.sh
args: well_known_types

5 changes: 5 additions & 0 deletions .github/workflows/run-example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

gripmock --stub=example/$1/stub example/$1/$1.proto &

go run example/$1/client/*.go
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ RUN mv /protobuf-repo/src/ /protobuf/

RUN rm -rf /protobuf-repo

RUN apk del git

RUN mkdir -p /go/src/github.com/tokopedia/gripmock

COPY . /go/src/github.com/tokopedia/gripmock
Expand All @@ -48,8 +46,6 @@ WORKDIR /go/src/github.com/tokopedia/gripmock
# install gripmock
RUN go install -v

RUN rm -rf *

EXPOSE 4770 4771

ENTRYPOINT ["gripmock"]
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ fi

go build ../.

docker build -t "ahmadmuzakki/gripmock:$1" .
docker build -t "tkpd/gripmock:$1" .
Loading

0 comments on commit 845771c

Please sign in to comment.