-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrpc.nimble
100 lines (81 loc) · 3.12 KB
/
grpc.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Package
version = "0.1.13"
author = "Esteban Castro Borsani (@nitely)"
description = "Pure Nim gRPC client and server"
license = "MIT"
srcDir = "src"
skipDirs = @["tests", "examples"]
requires "nim >= 2.0.8"
requires "hyperx >= 0.1.42"
requires "https://github.com/nitely/nim-protobuf-serialization#471301dfb583a802768979e287ea2c2e51f203ab"
requires "zippy >= 0.10.14"
#task test, "Test":
# exec "nim c -r src/grpc.nim"
task exampleserve, "Example serve":
exec "nim c -r examples/tls_server.nim"
task exampleclient, "Example client":
exec "nim c -r examples/tls_client.nim"
task exampleserveinsecure, "Example serve insecure":
exec "nim c -r examples/insecure_server.nim"
task exampleclientinsecure, "Example client insecure":
exec "nim c -r examples/insecure_client.nim"
task testserve, "Test serve":
exec "nim c -r tests/testserver.nim"
task testclient, "Test client":
exec "nim c -r tests/testclient.nim"
task interopserve, "Interop serve":
exec "nim c -r tests/interop/testserver.nim"
task interoptest, "Interop test":
exec "nim c -r -d:grpcTestCompression tests/interop/testclient.nim"
task interoptest2, "Interop test without compression":
# go server does not support compression tests
exec "nim c -r tests/interop/testclient.nim"
task interopserveinsec, "Interop serve insecure":
exec "nim c -r -d:grpcTestNoSsl tests/interop/testserver.nim"
task interoptestinsec, "Interop test insecure":
exec "nim c -r -d:grpcTestNoSsl -d:grpcTestCompression tests/interop/testclient.nim"
task interoptestinsec2, "Interop test insecure":
exec "nim c -r -d:grpcTestNoSsl tests/interop/testclient.nim"
task gointeropserve, "Go interop serve":
# GRPC_GO_LOG_SEVERITY_LEVEL=info
echo "Go serve forever"
exec "./go_server --use_tls --tls_cert_file $HYPERX_TEST_CERTFILE --tls_key_file $HYPERX_TEST_KEYFILE --port 8223"
task gointeroptest, "Go interop test":
template goTest(testName: string): untyped =
echo "Go test: " & testName
exec "./go_client --use_tls --server_port 8223 --test_case " & testName
goTest "empty_unary"
goTest "large_unary"
goTest "client_streaming"
goTest "server_streaming"
goTest "ping_pong"
goTest "empty_stream"
goTest "custom_metadata"
goTest "status_code_and_message"
goTest "special_status_message"
goTest "unimplemented_method"
goTest "unimplemented_service"
goTest "cancel_after_begin"
goTest "cancel_after_first_response"
goTest "timeout_on_sleeping_server"
task gointeropserveinsec, "Go interop serve insecure":
echo "Go serve forever"
exec "./go_server --port 8333"
task gointeroptestinsec, "Go interop test insecure":
template goTest(testName: string): untyped =
echo "Go test: " & testName
exec "./go_client --server_port 8333 --test_case " & testName
goTest "empty_unary"
goTest "large_unary"
goTest "client_streaming"
goTest "server_streaming"
goTest "ping_pong"
goTest "empty_stream"
goTest "custom_metadata"
goTest "status_code_and_message"
goTest "special_status_message"
goTest "unimplemented_method"
goTest "unimplemented_service"
goTest "cancel_after_begin"
goTest "cancel_after_first_response"
goTest "timeout_on_sleeping_server"