Skip to content

Commit

Permalink
feat: add kitexcall skeleton (#1)
Browse files Browse the repository at this point in the history
* feat: add kitexcall skeleton

* feat: add kitexcall skeleton

* add log.go file

* optimize logic

* optimize biz error handle logic

* add go.sum

* fix biz_error response parse

* feat: add kitexcall

* fix: word spelling error

* fix: word spelling error

* fix: update go version in ci

* fix: update go version in ci

* fix: update go.mod

* fix: lint

* fix: lowercase the value

* fix: output error

* fix: add compatibility-test

* fix: add compatibility-test

* fix: add compatibility-test

* fix: metainfo from server & method format

* fix: update service name

* fix: idl service name

* fix: allow Transport be
  • Loading branch information
Zzhiter authored May 23, 2024
1 parent 7619916 commit 41ab8ef
Show file tree
Hide file tree
Showing 17 changed files with 1,901 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"

- uses: actions/cache@v3
with:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: "1.21"

- name: Golangci Lint
# https://golangci-lint.run/
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ name: Tests
on: [ push, pull_request ]

jobs:
unit-benchmark-test:
compatibility-test:
strategy:
matrix:
go: [ "1.18", "1.19", "1.20", "1.21" ]
os: [ X64 ]
go: [ "1.20", "1.21", "1.22" ]
os: [ X64, ARM64 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Unit Test
run: go test -race -covermode=atomic -coverprofile=coverage.out ./...
run: go test -gcflags=-l -race -covermode=atomic ./...

- name: Benchmark
run: go test -bench=. -benchmem -run=none ./...
56 changes: 56 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module github.com/kitex-contrib/kitexcall

go 1.21

replace github.com/apache/thrift => github.com/apache/thrift v0.13.0

require (
github.com/bytedance/gopkg v0.0.0-20230728082804-614d0af6619b
github.com/cloudwego/dynamicgo v0.2.0
github.com/cloudwego/kitex v0.9.1
)

require (
github.com/apache/thrift v0.16.0 // indirect
github.com/bytedance/sonic v1.11.2 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/choleraehyq/pid v0.0.18 // indirect
github.com/cloudwego/configmanager v0.2.0 // indirect
github.com/cloudwego/fastpb v0.0.4 // indirect
github.com/cloudwego/frugal v0.1.14 // indirect
github.com/cloudwego/localsession v0.0.2 // indirect
github.com/cloudwego/netpoll v0.6.0 // indirect
github.com/cloudwego/thriftgo v0.3.6 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/pprof v0.0.0-20230509042627-b1315fad0c5a // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/jhump/protoreflect v1.8.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/gls v0.0.0-20220109145502-612d0167dce5 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/oleiade/lane v1.0.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
golang.org/x/arch v0.2.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
438 changes: 438 additions & 0 deletions go.sum

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions internal/test/assert.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2024 CloudWeGo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package test

import (
"reflect"
"testing"
)

// DeepEqual asserts a and b are deep equal, otherwise fails the test.
func DeepEqual(t *testing.T, a, b interface{}) {
t.Helper()
if !reflect.DeepEqual(a, b) {
t.Fatalf("assertion failed: %v != %v", a, b)
}
}
Loading

0 comments on commit 41ab8ef

Please sign in to comment.