Skip to content

Commit

Permalink
feat:init app support env app_access_key and app_secret
Browse files Browse the repository at this point in the history
  • Loading branch information
geebytes committed May 7, 2024
1 parent 462d58e commit 5f6f001
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions internal/integration/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ import (
var onceExampleServer sync.Once
var onceServer sync.Once
var shareEndpoint = ""

// "NWkbCslfh9ea2LjVIUsKehJuopPb65fn", "oVPNllSR1DfizdmdSF7wLjgABYbexdt4FZ1HWrI81dD5BeNhsyXpXPDFoDEyiSVe"
var apiAddr = "http://127.0.0.1:12140"
var accessKey = "NWkbCslfh9ea2LjVIUsKehJuopPb65fn"
var secret="oVPNllSR1DfizdmdSF7wLjgABYbexdt4FZ1HWrI81dD5BeNhsyXpXPDFoDEyiSVe"
var secret = "oVPNllSR1DfizdmdSF7wLjgABYbexdt4FZ1HWrI81dD5BeNhsyXpXPDFoDEyiSVe"

func runExampleServer() {
onceExampleServer.Do(func() {
// run example server
Expand All @@ -36,9 +38,9 @@ func runExampleServer() {
func RunTestServer() {
log.Printf("run test server")
onceServer.Do(func() {
env:="test"
if begonia.Env!=""{
env=begonia.Env
env := "dev"
if begonia.Env != "" {
env = begonia.Env
}
config := config.ReadConfig(env)
go func() {
Expand Down
3 changes: 2 additions & 1 deletion internal/integration/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"runtime"
"testing"

"github.com/begonia-org/begonia"
"github.com/begonia-org/begonia/config"
cfg "github.com/begonia-org/begonia/internal/pkg/config"
"github.com/begonia-org/go-sdk/client"
Expand Down Expand Up @@ -47,7 +48,7 @@ func upload(t *testing.T) {
c.So(err, c.ShouldBeNil)
c.So(rsp.StatusCode, c.ShouldEqual, common.Code_OK)
c.So(rsp.Uri, c.ShouldNotBeEmpty)
conf := cfg.NewConfig(config.ReadConfig("dev"))
conf := cfg.NewConfig(config.ReadConfig(begonia.Env))

saveDir := filepath.Join(conf.GetUploadDir(), filepath.Dir(rsp.Uri))
filename = filepath.Base(rsp.Uri)
Expand Down

0 comments on commit 5f6f001

Please sign in to comment.