-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
70 lines (65 loc) · 1.61 KB
/
main.go
File metadata and controls
70 lines (65 loc) · 1.61 KB
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
package main
import (
"fmt"
"os"
"github.com/ryoya-fujimoto/grpc-testing/cmd"
"github.com/urfave/cli/v2"
)
func main() {
app := cli.NewApp()
app.Name = "grpc-testing"
app.Usage = "The scenario based grpc runner and tester tool"
app.Commands = []*cli.Command{
{
Name: "add",
Usage: "add test case file",
Action: cmd.Add,
ArgsUsage: "`test file`",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "proto_path",
Usage: "Protofiles root path",
},
&cli.StringSliceFlag{
Name: "protofiles",
Usage: "Protofiles to include. You can use grob patterns.",
},
},
},
{
Name: "validate",
Usage: "validate test case files with schemas",
Action: cmd.Validate,
ArgsUsage: "`test file(can use glob)`",
},
{
Name: "run",
Usage: "Requests grpc to server using input in test case file, and output response.",
Action: cmd.Run,
ArgsUsage: "`hostname` `test file(can use glob)` `[(optional) test name]`",
Flags: []cli.Flag{
&cli.StringSliceFlag{
Name: "header",
Usage: "Additional RPC headers in 'name: value' format.",
},
},
},
{
Name: "test",
Usage: "Requests grpc to server using input in test case file, and compare between response and output parameter.",
Action: cmd.Test,
ArgsUsage: "`hostname` `test file(can use glob)` `[(optional) test name]`",
Flags: []cli.Flag{
&cli.StringSliceFlag{
Name: "header",
Usage: "Additional RPC headers in 'name: value' format.",
},
},
},
}
err := app.Run(os.Args)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
}