Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rpc server build tags and tests #356

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading