Files
EdgeNode/internal/monitor/value_queue_test.go

34 lines
755 B
Go
Raw Normal View History

2024-05-17 18:30:33 +08:00
// Copyright 2021 GoEdge goedge.cdn@gmail.com. All rights reserved.
2021-11-10 21:51:56 +08:00
package monitor
import (
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeNode/internal/rpc"
2024-01-21 11:13:30 +08:00
"github.com/TeaOSLab/EdgeNode/internal/utils/testutils"
2021-11-10 21:51:56 +08:00
_ "github.com/iwind/TeaGo/bootstrap"
"github.com/iwind/TeaGo/logs"
"google.golang.org/grpc/status"
"testing"
)
func TestValueQueue_RPC(t *testing.T) {
2024-01-21 11:13:30 +08:00
if !testutils.IsSingleTesting() {
return
}
2021-11-10 21:51:56 +08:00
rpcClient, err := rpc.SharedRPC()
if err != nil {
t.Fatal(err)
}
2022-08-24 20:04:46 +08:00
_, err = rpcClient.NodeValueRPC.CreateNodeValue(rpcClient.Context(), &pb.CreateNodeValueRequest{})
2021-11-10 21:51:56 +08:00
if err != nil {
2022-08-24 20:04:46 +08:00
statusErr, ok := status.FromError(err)
2021-11-10 21:51:56 +08:00
if ok {
logs.Println(statusErr.Code())
}
t.Fatal(err)
}
t.Log("ok")
}