Skip to content

Commit

Permalink
fix: rpc server build tags and tests (#356)
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy authored Jul 26, 2024
1 parent 91797db commit 3eb613f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 54 deletions.
4 changes: 2 additions & 2 deletions examples/plugin/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build native
// +build native
//go:build !rpc
// +build !rpc

package main

Expand Down
13 changes: 2 additions & 11 deletions pkg/kcl/api_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build native
// +build native
//go:build !rpc
// +build !rpc

package kcl

Expand Down Expand Up @@ -31,15 +31,6 @@ func TestNativeRun(t *testing.T) {
fmt.Println(yaml)
}

func ExampleNativeRunPaths() {
yaml := MustRunPaths([]string{"testdata/1.k", "testdata/2.k"}).GetRawYamlResult()
fmt.Println(yaml)

// output:
// a: b
// c: d
}

func TestNativeRunWithPlugin(t *testing.T) {
plugin.RegisterPlugin(plugin.Plugin{
Name: "my_plugin",
Expand Down
17 changes: 0 additions & 17 deletions pkg/service/rest_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,6 @@ import (
"kcl-lang.io/kcl-go/pkg/spec/gpyrpc"
)

func TestCallRestMethod_ping(t *testing.T) {
var args = gpyrpc.Ping_Args{Value: "ping"}
var result gpyrpc.Ping_Result

var err = CallRestMethod(
"http://"+tRestServerAddr, "BuiltinService.Ping",
&args, &result,
)
if err != nil {
t.Fatal(err)
}

if result.Value != args.Value {
t.Fatalf("expect %q, got %q", args.Value, result.Value)
}
}

func TestCallRestMethod_noMethod(t *testing.T) {
var args = gpyrpc.Ping_Args{Value: "ping"}
var result gpyrpc.Ping_Result
Expand Down
24 changes: 0 additions & 24 deletions pkg/service/rest_server_test.go

This file was deleted.

0 comments on commit 3eb613f

Please sign in to comment.