-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get gRPC descriptor via server reflection (#210)
Signed-off-by: Ink33 <[email protected]>
- Loading branch information
Showing
14 changed files
with
920 additions
and
555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!api-testing | ||
# yaml-language-server: $schema=https://linuxsuren.github.io/api-testing/api-testing-schema.json | ||
# see also https://github.com/LinuxSuRen/api-testing | ||
name: grpc-sample | ||
api: 127.0.0.1:7070 | ||
spec: | ||
grpc: | ||
import: | ||
- ./pkg/server | ||
protofile: server.proto | ||
items: | ||
- name: GetVersion | ||
request: | ||
api: /server.Runner/GetVersion | ||
- name: FunctionsQuery | ||
request: | ||
api: /server.Runner/FunctionsQuery | ||
body: | | ||
{ | ||
"name": "hello" | ||
} | ||
expect: | ||
body: | | ||
{ | ||
"data": [ | ||
{ | ||
"key": "hello", | ||
"value": "func() string" | ||
} | ||
] | ||
} | ||
- name: FunctionsQueryStream | ||
request: | ||
api: /server.Runner/FunctionsQueryStream | ||
body: | | ||
[ | ||
{ | ||
"name": "hello" | ||
}, | ||
{ | ||
"name": "title" | ||
} | ||
] | ||
expect: | ||
verify: | ||
- "len(data) == 2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!api-testing | ||
# yaml-language-server: $schema=https://linuxsuren.github.io/api-testing/api-testing-schema.json | ||
# see also https://github.com/LinuxSuRen/api-testing | ||
name: grpc-sample | ||
api: 127.0.0.1:7070 | ||
spec: | ||
grpc: | ||
serverReflection: true | ||
items: | ||
- name: GetVersion | ||
request: | ||
api: /server.Runner/GetVersion | ||
- name: FunctionsQuery | ||
request: | ||
api: /server.Runner/FunctionsQuery | ||
body: | | ||
{ | ||
"name": "hello" | ||
} | ||
expect: | ||
body: | | ||
{ | ||
"data": [ | ||
{ | ||
"key": "hello", | ||
"value": "func() string" | ||
} | ||
] | ||
} | ||
- name: FunctionsQueryStream | ||
request: | ||
api: /server.Runner/FunctionsQueryStream | ||
body: | | ||
[ | ||
{ | ||
"name": "hello" | ||
}, | ||
{ | ||
"name": "title" | ||
} | ||
] | ||
expect: | ||
verify: | ||
- "len(data) == 2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,11 @@ jobs: | |
Test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18.x | ||
- uses: actions/[email protected] | ||
- name: Unit Test | ||
run: | | ||
make test-all-backend test-operator | ||
|
@@ -32,30 +32,30 @@ jobs: | |
bash <(curl -Ls https://coverage.codacy.com/get.sh) final | ||
APITest: | ||
permissions: write-all | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18.x | ||
- uses: actions/[email protected] | ||
- name: API Test | ||
run: | | ||
make build copy | ||
sudo atest service install | ||
sudo atest service restart | ||
sudo atest service status | ||
atest run -p .github/testing/core.yaml --request-ignore-error --report md --report-file .github/workflows/report.md | ||
atest run -p sample/grpc-sample.yaml | ||
atest run -p '.github/testing/*.yaml' --request-ignore-error --report md --report-file .github/workflows/report.md | ||
sudo atest service status | ||
atest convert -p .github/testing/core.yaml --converter jmeter -t sample.jmx | ||
- name: Report API Test | ||
uses: harupy/comment-on-pr@c0522c44600040927a120b9309b531e3cb6f8d48 | ||
uses: thollander/actions-comment-pull-request@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
filename: report.md | ||
filePath: .github/workflows/report.md | ||
- name: Run JMeter Tests | ||
uses: rbhadti94/[email protected] | ||
with: | ||
|
@@ -64,28 +64,29 @@ jobs: | |
Build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18.x | ||
- uses: actions/[email protected] | ||
- name: Run GoReleaser | ||
uses: goreleaser/[email protected] | ||
uses: goreleaser/goreleaser-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }} | ||
with: | ||
github_token: ${{ secrets.GH_PUBLISH_SECRETS }} | ||
version: v1.14.0 | ||
version: latest | ||
args: release --skip-publish --rm-dist --snapshot | ||
- name: Operator | ||
run: cd operator && make build | ||
|
||
BuildImage: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18.x | ||
- uses: actions/[email protected] | ||
- name: Core Image | ||
run: make build-image | ||
- name: Operator Image | ||
|
@@ -94,16 +95,16 @@ jobs: | |
BuildEmbedUI: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18.x | ||
- uses: actions/[email protected] | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'npm' | ||
cache: "npm" | ||
cache-dependency-path: console/atest-ui/package-lock.json | ||
- name: Build | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Release | |
on: | ||
push: | ||
tags: | ||
- '*' | ||
- "*" | ||
branches: | ||
- master | ||
|
||
|
@@ -21,14 +21,14 @@ jobs: | |
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'npm' | ||
cache: "npm" | ||
cache-dependency-path: console/atest-ui/package-lock.json | ||
- name: Run GoReleaser | ||
uses: goreleaser/[email protected] | ||
|
@@ -41,11 +41,11 @@ jobs: | |
Test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18.x | ||
- uses: actions/[email protected] | ||
- name: Unit Test | ||
run: | | ||
make test-all-backend test-operator | ||
|
Oops, something went wrong.