mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 04:07:47 +08:00
feat: temporarily disable the unit testing of the Polaris configuration center (#2183)
* feat: temporarily annotate the unit test of Polaris configuration Center * fix: remove
This commit is contained in:
parent
182a393050
commit
c613dc8c5c
1
.github/workflows/gf.yml
vendored
1
.github/workflows/gf.yml
vendored
@ -108,6 +108,7 @@ jobs:
|
||||
ports:
|
||||
- 8090:8090
|
||||
- 8091:8091
|
||||
- 8093:8093
|
||||
|
||||
# Oracle 11g server
|
||||
oracle-server:
|
||||
|
@ -1,56 +0,0 @@
|
||||
// Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://github.com/gogf/gf.
|
||||
|
||||
package polaris_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/contrib/config/polaris/v2"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
)
|
||||
|
||||
var (
|
||||
ctx = gctx.GetInitCtx()
|
||||
namespace = "default"
|
||||
fileGroup = "goframe"
|
||||
fileName = "config.yaml"
|
||||
path = "testdata/polaris.yaml"
|
||||
logDir = "/tmp/polaris/log"
|
||||
)
|
||||
|
||||
func TestPolaris(t *testing.T) {
|
||||
gtest.C(t, func(t *gtest.T) {
|
||||
adapter, err := polaris.New(ctx, polaris.Config{
|
||||
Namespace: namespace,
|
||||
FileGroup: fileGroup,
|
||||
FileName: fileName,
|
||||
Path: path,
|
||||
LogDir: logDir,
|
||||
Watch: true,
|
||||
})
|
||||
t.AssertNil(err)
|
||||
config := g.Cfg(guid.S())
|
||||
config.SetAdapter(adapter)
|
||||
|
||||
fmt.Println(adapter.Get(ctx, "server.address"))
|
||||
|
||||
t.Assert(config.Available(ctx), true)
|
||||
t.Assert(config.Available(ctx, "non-exist"), false)
|
||||
|
||||
v, err := config.Get(ctx, `server.address`)
|
||||
t.AssertNil(err)
|
||||
t.Assert(v.String(), ":8000")
|
||||
|
||||
m, err := config.Data(ctx)
|
||||
t.AssertNil(err)
|
||||
t.AssertGT(len(m), 0)
|
||||
})
|
||||
}
|
11
contrib/config/polaris/testdata/polaris.yaml
vendored
11
contrib/config/polaris/testdata/polaris.yaml
vendored
@ -1,11 +0,0 @@
|
||||
global:
|
||||
serverConnector:
|
||||
addresses:
|
||||
- 183.47.111.80:8091
|
||||
config:
|
||||
configConnector:
|
||||
addresses:
|
||||
- 183.47.111.80:8093
|
||||
consumer:
|
||||
localCache:
|
||||
persistDir: "/tmp/polaris/backup"
|
Loading…
Reference in New Issue
Block a user