fix: panic with the gRPC test cases (#334)

Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
This commit is contained in:
Rick 2024-01-15 13:32:11 +08:00 committed by GitHub
parent d6da4ca694
commit 3f6b4a45f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

View File

@ -56,10 +56,6 @@ jobs:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial --force-coverage-parser go -r coverage.out
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial --force-coverage-parser go -r collector-coverage.out
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial --force-coverage-parser go -r store-orm-coverage.out
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial --force-coverage-parser go -r store-s3-coverage.out
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial --force-coverage-parser go -r store-git-coverage.out
bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial --force-coverage-parser go -r operator/cover.out
bash <(curl -Ls https://coverage.codacy.com/get.sh) final

View File

@ -70,4 +70,5 @@ RUN apt update -y && \
apt install -y --no-install-recommends ssh-client ca-certificates && \
apt install -y curl
EXPOSE 8080
CMD ["atest", "server", "--local-storage=/var/data/api-testing/*.yaml"]

View File

@ -91,6 +91,14 @@ items:
expect:
bodyFieldsExpect:
api: http://localhost:8080/server.Runner
- name: GetSuggestedAPIs
request:
api: /GetSuggestedAPIs
method: POST
body: |
{
"name": "{{.param.suiteName}}"
}
- name: createTestCase
request:
api: /CreateTestCase

View File

@ -77,6 +77,9 @@ func NewGRPCTestCaseRunner(host string, proto testing.RPCDesc) TestCaseRunner {
func init() {
RegisterRunner("grpc", func(suite *testing.TestSuite) TestCaseRunner {
if suite.Spec.RPC == nil {
suite.Spec.RPC = &testing.RPCDesc{}
}
return NewGRPCTestCaseRunner(suite.API, *suite.Spec.RPC)
})
}