Skip to content

Commit

Permalink
fix: integrate test
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKenway committed Sep 7, 2021
1 parent 5bea8b5 commit 5e6abc2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions igt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ config:
$(info > Setting up config files)
@mkdir -p $(OUT_DIR)/server
@mkdir -p $(OUT_DIR)/pixiuconf
@mkdir -p $(OUT_DIR)/proto
@-test -f $(PROJECT_DIR)/server/profiles/dev/log.yml && cat $(PROJECT_DIR)/server/profiles/dev/log.yml | sed "s#\$$HOST_IP#$(DOCKER_HOST_IP)#g" > $(OUT_DIR)/server/log.yml && echo " > $(OUT_DIR)/conf/log.yml"
@-test -f $(PROJECT_DIR)/server/profiles/dev/server.yml && cat $(PROJECT_DIR)/server/profiles/dev/server.yml | sed "s#\$$HOST_IP#$(DOCKER_HOST_IP)#g" > $(OUT_DIR)/server/server.yml && echo " > $(OUT_DIR)/conf/server.yml"
@-test -f $(PROJECT_DIR)/pixiu/api_config.yaml && cat $(PROJECT_DIR)/pixiu/api_config.yaml | sed "s#\$$HOST_IP#$(DOCKER_HOST_IP)#g" > $(OUT_DIR)/pixiuconf/api_config.yaml && echo " > $(OUT_DIR)/pixiuconf/api_config.yaml"
Expand Down
15 changes: 14 additions & 1 deletion pkg/filter/http/grpcproxy/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"io"
"io/ioutil"
stdHttp "net/http"
"os"
"path/filepath"
"strings"
"sync"
)
Expand Down Expand Up @@ -324,8 +326,19 @@ func (f *Filter) Config() interface{} {

func (f *Filter) Apply() error {
gc := f.cfg

cur := gc.Path
if len(cur) != 0 && cur[0] != '/' {
ex, err := os.Executable()
if err != nil {
return err
}
cur = filepath.Dir(ex) + "/" + gc.Path
}

logger.Infof("%s load proto files from %s", loggerHeader, cur)
fileLists := make([]string, 0)
items, err := ioutil.ReadDir(gc.Path)
items, err := ioutil.ReadDir(cur)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions samples/http/grpc/pixiu/conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ static_resources:
http_filters:
- name: dgp.filter.http.apiconfig
config:
path: /mnt/d/WorkSpace/GoLandProjects/dubbo-go-pixiu/samples/http/grpc/pixiu/api_config.yaml
path: $PROJECT_DIR/pixiu/api_config.yaml
- name: dgp.filter.http.grpcproxy
config:
path: /mnt/d/WorkSpace/GoLandProjects/dubbo-go-pixiu/samples/http/grpc/proto
path: $PROJECT_DIR/proto
- name: dgp.filter.http.response
config:
server_name: "test-http-grpc"
Expand Down

0 comments on commit 5e6abc2

Please sign in to comment.