feat: support setup/teardown hooks

Change-Id: I148e11c190859b57dd5268cfe5643762e43bd64a
This commit is contained in:
buyuxiang
2022-02-22 21:00:52 +08:00
parent 4992e2e87b
commit 82d9dce168
7 changed files with 56 additions and 1 deletions

View File

@@ -55,3 +55,11 @@ func Concatenate(args ...interface{}) (interface{}, error) {
}
return result, nil
}
func SetupHookExample(args string) string {
return fmt.Sprintf("step name: %v, setup...", args)
}
func TeardownHookExample(args string) string {
return fmt.Sprintf("step name: %v, teardown...", args)
}

View File

@@ -10,5 +10,7 @@ func main() {
plugin.Register("sum_two_string", SumTwoString)
plugin.Register("sum_strings", SumStrings)
plugin.Register("concatenate", Concatenate)
plugin.Register("setup_hook_example", SetupHookExample)
plugin.Register("teardown_hook_example", TeardownHookExample)
plugin.Serve()
}