diff --git a/metadata/report/nacos/report_test.go b/metadata/report/nacos/report_test.go index be01eb22f7e95966c3bf816fdf648629b64380a3..81432ff2aeee3c6aa06a56a840115c6fc9c83352 100644 --- a/metadata/report/nacos/report_test.go +++ b/metadata/report/nacos/report_test.go @@ -19,6 +19,7 @@ package nacos import ( "encoding/json" + "net/http" "strconv" "testing" ) @@ -36,6 +37,9 @@ import ( ) func TestNacosMetadataReport_CRUD(t *testing.T) { + if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil { + return + } rpt := newTestReport() assert.NotNil(t, rpt) diff --git a/registry/nacos/registry_test.go b/registry/nacos/registry_test.go index d0311b200b27081c60bc97b2307a54774ca977bd..a07b41941701c4d615f17955c666c4bb8bea8013 100644 --- a/registry/nacos/registry_test.go +++ b/registry/nacos/registry_test.go @@ -19,6 +19,7 @@ package nacos import ( "encoding/json" + "net/http" "net/url" "strconv" "testing" @@ -35,6 +36,9 @@ import ( ) func TestNacosRegistry_Register(t *testing.T) { + if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil { + return + } regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) urlMap := url.Values{} urlMap.Set(constant.GROUP_KEY, "guangzhou-idc") @@ -64,6 +68,9 @@ func TestNacosRegistry_Register(t *testing.T) { } func TestNacosRegistry_Subscribe(t *testing.T) { + if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil { + return + } regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) urlMap := url.Values{} urlMap.Set(constant.GROUP_KEY, "guangzhou-idc") @@ -102,6 +109,9 @@ func TestNacosRegistry_Subscribe(t *testing.T) { } func TestNacosRegistry_Subscribe_del(t *testing.T) { + if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil { + return + } regurl, _ := common.NewURL("registry://console.nacos.io:80", common.WithParamsValue(constant.ROLE_KEY, strconv.Itoa(common.PROVIDER))) urlMap := url.Values{} urlMap.Set(constant.GROUP_KEY, "guangzhou-idc") diff --git a/registry/nacos/service_discovery_test.go b/registry/nacos/service_discovery_test.go index 119be0b3aad3a828470c8c72c775abaada9512c2..0628e991ae64c3a0ba44dc24b606826d7724c01e 100644 --- a/registry/nacos/service_discovery_test.go +++ b/registry/nacos/service_discovery_test.go @@ -19,6 +19,7 @@ package nacos import ( "math/rand" + "net/http" "strconv" "testing" "time" @@ -81,6 +82,9 @@ func TestNacosServiceDiscovery_Destroy(t *testing.T) { } func TestNacosServiceDiscovery_CRUD(t *testing.T) { + if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil { + return + } prepareData() extension.SetEventDispatcher("mock", func() observer.EventDispatcher { return &dispatcher.MockEventDispatcher{}