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:
houseme 2022-10-09 21:42:32 +08:00 committed by GitHub
parent 182a393050
commit c613dc8c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 67 deletions

View File

@ -108,6 +108,7 @@ jobs:
ports:
- 8090:8090
- 8091:8091
- 8093:8093
# Oracle 11g server
oracle-server:

View File

@ -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)
})
}

View File

@ -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"