Skip to content

Commit

Permalink
fix(adapter): beego2 and gf2
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceship authored and spaceship committed Aug 23, 2022
1 parent b1b862a commit d033b91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@ mysql-test: $(TEST_FRAMEWORK_DIR)/*
go get github.com/ugorji/go/codec@none
for file in $^ ; do \
make import-mysql ; \
gotest -mod=mod -v ./$${file}/... -args $(TEST_CONFIG_PATH) ; \
gotest -mod=mod -gcflags=all=-l -v ./$${file}/... -args $(TEST_CONFIG_PATH) ; \
done

sqlite-test: $(TEST_FRAMEWORK_DIR)/*
for file in $^ ; do \
make import-sqlite ; \
gotest -mod=mod ./$${file}/... -args $(TEST_CONFIG_SQLITE_PATH) ; \
gotest -mod=mod -gcflags=all=-l ./$${file}/... -args $(TEST_CONFIG_SQLITE_PATH) ; \
done

pg-test: $(TEST_FRAMEWORK_DIR)/*
for file in $^ ; do \
make import-postgresql ; \
gotest -mod=mod ./$${file}/... -args $(TEST_CONFIG_PQ_PATH) ; \
gotest -mod=mod -gcflags=all=-l ./$${file}/... -args $(TEST_CONFIG_PQ_PATH) ; \
done

ms-test: $(TEST_FRAMEWORK_DIR)/*
for file in $^ ; do \
make import-mssql ; \
gotest -mod=mod ./$${file}/... -args $(TEST_CONFIG_MS_PATH) ; \
gotest -mod=mod -gcflags=all=-l ./$${file}/... -args $(TEST_CONFIG_MS_PATH) ; \
done

## tests: user acceptance tests
Expand Down
10 changes: 6 additions & 4 deletions tests/frameworks/gf2/gf.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package gf

import (
// add gf adapter
"reflect"

"bou.ke/monkey"
_ "github.com/GoAdminGroup/go-admin/adapter/gf2"
"github.com/agiledragon/gomonkey"

// add mysql driver
"github.com/GoAdminGroup/go-admin/modules/config"
Expand Down Expand Up @@ -54,9 +55,10 @@ func newHandler() http.Handler {

s.SetPort(8103)

monkey.Patch(new(ghttp.Session).Close, func() error {
return nil
})
gomonkey.ApplyMethod(reflect.TypeOf(new(ghttp.Request).Session), "Close",
func(*ghttp.Session) error {
return nil
})

return s
}
Expand Down

0 comments on commit d033b91

Please sign in to comment.