3 Star 0 Fork 0

mirrors_vmware-archive/cf-sli

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 1.57 KB
一键复制 编辑 原始数据 按行查看 历史
Jesse Malone 提交于 2020-05-27 15:38 . Adding a check for app routability
package main
import (
"encoding/json"
"flag"
"fmt"
"github.com/pivotal-cloudops/cf-sli/http_wrapper"
"os"
uuid "github.com/nu7hatch/gouuid"
"github.com/pivotal-cloudops/cf-sli/cf_wrapper"
"github.com/pivotal-cloudops/cf-sli/config"
"github.com/pivotal-cloudops/cf-sli/logger"
"github.com/pivotal-cloudops/cf-sli/sli_executor"
)
type Output struct {
StartTime float64 `json:"app_start_time_in_sec"`
StopTime float64 `json:"app_stop_time_in_sec"`
StartStatus int `json:"app_start_status"`
StopStatus int `json:"app_stop_status"`
}
func main() {
var config config.Config
var cf_cli cf_wrapper.CfWrapper
http_wrapper := &http_wrapper.HttpWrapper{}
app_bits_path := flag.String("app-bits", "./assets/ruby_simple", "App bits path")
configLocation := flag.String("config", "./.config", "Config path")
flag.Parse()
err := config.LoadConfig(*configLocation)
if err != nil {
fmt.Fprint(os.Stderr, "Failed to load .config :\n")
fmt.Fprint(os.Stderr, err)
fmt.Fprint(os.Stderr, "\n")
os.Exit(1)
}
guid, err := uuid.NewV4()
if err != nil {
panic(err)
}
app_name := "cf-sli-app-" + guid.String()[0:18]
sli_executor := sli_executor.NewSliExecutor(cf_cli, http_wrapper, logger.NewLogger())
result, err := sli_executor.RunTest(app_name, *app_bits_path, config)
output := &Output{
StartTime: result.StartTime.Seconds(),
StopTime: result.StopTime.Seconds(),
StartStatus: result.StartStatus,
StopStatus: result.StopStatus,
}
json_output, err := json.Marshal(output)
if err != nil {
panic(err)
}
fmt.Fprintf(os.Stdout, string(json_output))
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_vmware-archive/cf-sli.git
git@gitee.com:mirrors_vmware-archive/cf-sli.git
mirrors_vmware-archive
cf-sli
cf-sli
master

搜索帮助