Skip to content
Snippets Groups Projects
Commit 1880e239 authored by Jake Taylor's avatar Jake Taylor :lips:
Browse files

Merge branch 'release' into 'master'

Release

See merge request elixxir/user-discovery-bot!81
parents 490db069 38e758de
No related branches found
No related tags found
No related merge requests found
...@@ -30,10 +30,13 @@ stages: ...@@ -30,10 +30,13 @@ stages:
- setup - setup
- test - test
- build - build
- tag
setup: setup:
stage: setup stage: setup
image: $DOCKER_IMAGE image: $DOCKER_IMAGE
except:
- tags
script: script:
- go mod vendor -v - go mod vendor -v
- go build ./... - go build ./...
...@@ -45,6 +48,8 @@ setup: ...@@ -45,6 +48,8 @@ setup:
test: test:
stage: test stage: test
image: $DOCKER_IMAGE image: $DOCKER_IMAGE
except:
- tags
coverage: '/^total:\s+\(statements\)\s+\d+\.\d+\%$/' coverage: '/^total:\s+\(statements\)\s+\d+\.\d+\%$/'
script: script:
- GO111MODULE=off go get -u github.com/haya14busa/goverage - GO111MODULE=off go get -u github.com/haya14busa/goverage
...@@ -71,19 +76,26 @@ test: ...@@ -71,19 +76,26 @@ test:
build: build:
stage: build stage: build
image: $DOCKER_IMAGE image: $DOCKER_IMAGE
except:
- tags
script: script:
- mkdir -p release - mkdir -p release
- go generate cmd/version.go
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' ./... - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' ./...
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/udb.linux64 main.go - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/udb.linux64 main.go
- GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/udb.win64 main.go - GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/udb.win64 main.go
- GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/udb.win32 main.go - GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/udb.win32 main.go
- GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/udb.darwin64 main.go - GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/udb.darwin64 main.go
- ./release/udb.linux64 --version
- git remote add origin_tags git@gitlab.com:elixxir/user-discovery-bot.git || true
- git remote set-url origin_tags git@gitlab.com:elixxir/user-discovery-bot.git || true
- git tag $(./release/udb.linux64 --version | grep "Elixxir User Discovery Bot v"| cut -d ' ' -f5) -f
- git push origin_tags -f --tags
artifacts: artifacts:
paths: paths:
- release/ - release/
tag:
stage: tag
only:
- master
image: $DOCKER_IMAGE
script:
- git remote add origin_tags git@gitlab.com:elixxir/user-discovery-bot.git || true
- git remote set-url origin_tags git@gitlab.com:elixxir/user-discovery-bot.git || true
- git tag $(./release/udb.linux64 version | grep "Elixxir User Discovery Bot v"| cut -d ' ' -f5) -f
- git push origin_tags -f --tags
\ No newline at end of file
////////////////////////////////////////////////////////////////////////////////
// Copyright © 2018 Privategrity Corporation /
// /
// All rights reserved. /
////////////////////////////////////////////////////////////////////////////////
// The following directive is necessary to make the package coherent:
// +build ignore
// This program generates cmd/version_vars.go. It can be invoked by running
// go generate
package main
import (
"bufio"
"io/ioutil"
"log"
"os"
"os/exec"
"strings"
"text/template"
"time"
)
func GenerateGitVersion() string {
cmd := exec.Command("git", "show", "--oneline")
stdoutStderr, err := cmd.CombinedOutput()
if err != nil {
log.Fatal(err)
}
scanner := bufio.NewScanner(strings.NewReader(string(stdoutStderr)))
for scanner.Scan() {
return scanner.Text()
}
return "UNKNOWNVERSION"
}
func ReadGlideLock() string {
r, _ := ioutil.ReadFile("../glide.lock")
return string(r)
}
func main() {
gitversion := GenerateGitVersion()
glidedependencies := ReadGlideLock()
f, err := os.Create("version_vars.go")
die(err)
defer f.Close()
packageTemplate.Execute(f, struct {
Timestamp time.Time
GITVER string
GLIDEDEPS string
}{
Timestamp: time.Now(),
GITVER: gitversion,
GLIDEDEPS: glidedependencies,
})
}
func die(err error) {
if err != nil {
log.Fatal(err)
}
}
var packageTemplate = template.Must(template.New("").Parse(
"// Code generated by go generate; DO NOT EDIT.\n" +
"// This file was generated by robots at\n" +
"// {{ .Timestamp }}\n" +
"package cmd\n\n" +
"const GITVERSION = `{{ .GITVER }}`\n" +
"const SEMVER = \"0.0.1\"\n" +
"const GLIDEDEPS = `{{ .GLIDEDEPS }}`\n"))
...@@ -23,7 +23,6 @@ import ( ...@@ -23,7 +23,6 @@ import (
var cfgFile string var cfgFile string
var verbose bool var verbose bool
var showVer bool
var noTLS bool var noTLS bool
// RootCmd represents the base command when called without any subcommands // RootCmd represents the base command when called without any subcommands
...@@ -33,11 +32,6 @@ var RootCmd = &cobra.Command{ ...@@ -33,11 +32,6 @@ var RootCmd = &cobra.Command{
Long: `This bot provides user lookup and search functions on cMix`, Long: `This bot provides user lookup and search functions on cMix`,
Args: cobra.NoArgs, Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
if showVer {
printVersion()
return
}
sess := viper.GetString("sessionfile") sess := viper.GetString("sessionfile")
if sess == "" { if sess == "" {
sess = "udb-session.blob" sess = "udb-session.blob"
...@@ -96,8 +90,6 @@ func init() { ...@@ -96,8 +90,6 @@ func init() {
"config file (default is $PWD/udb.yaml)") "config file (default is $PWD/udb.yaml)")
RootCmd.Flags().BoolVarP(&verbose, "verbose", "v", false, RootCmd.Flags().BoolVarP(&verbose, "verbose", "v", false,
"Verbose mode for debugging") "Verbose mode for debugging")
RootCmd.Flags().BoolVarP(&showVer, "version", "V", false,
"Show the server version information.")
RootCmd.Flags().BoolVarP(&noTLS, "noTLS", "", false, RootCmd.Flags().BoolVarP(&noTLS, "noTLS", "", false,
"Set to ignore TLS") "Set to ignore TLS")
} }
......
...@@ -4,32 +4,43 @@ ...@@ -4,32 +4,43 @@
// All rights reserved. / // All rights reserved. /
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Handles command-line version functionality
package cmd package cmd
import ( import (
"fmt" "fmt"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"gitlab.com/elixxir/primitives/utils"
) )
//go:generate go run gen.go // Change this value to set the version for this build
// The above generates: GITVERSION, GLIDEDEPS, and SEMVER const currentVersion = "1.0.0"
func init() { func printVersion() {
RootCmd.AddCommand(versionCmd) fmt.Printf("Elixxir User Discovery Bot v%s -- %s\n\n", SEMVER, GITVERSION)
fmt.Printf("Dependencies:\n\n%s\n", DEPENDENCIES)
} }
func printVersion() { func init() {
fmt.Printf("Elixxir User Discovery Bot v%s -- %s\n\n", SEMVER, RootCmd.AddCommand(versionCmd)
GITVERSION) RootCmd.AddCommand(generateCmd)
fmt.Printf("Dependencies:\n\n%s\n", GLIDEDEPS)
} }
var versionCmd = &cobra.Command{ var versionCmd = &cobra.Command{
Use: "version", Use: "version",
Short: "Print the version number of Elixxir UDB", Short: "Print the version and dependency information for the Elixxir binary",
Long: `Print the version number of Elixxir User Discovery bot. This Long: `Print the version and dependency information for the Elixxir binary`,
also prints the glide cache versions of all of its dependencies.`,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
printVersion() printVersion()
}, },
} }
var generateCmd = &cobra.Command{
Use: "generate",
Short: "Generates version and dependency information for the Elixxir binary",
Long: `Generates version and dependency information for the Elixxir binary`,
Run: func(cmd *cobra.Command, args []string) {
utils.GenerateVersionFile(currentVersion)
},
}
// Code generated by go generate; DO NOT EDIT. // Code generated by go generate; DO NOT EDIT.
// This file was generated by robots at // This file was generated by robots at
// 2020-02-06 13:56:24.650286 -0800 PST m=+0.008491867 // 2020-02-07 14:51:51.405198 -0800 PST m=+0.012105072
package cmd package cmd
const GITVERSION = `96d0527 Merge remote-tracking branch 'origin/release' into release` const GITVERSION = `38b062f Merge remote-tracking branch 'origin/release' into release`
const SEMVER = "0.0.1" const SEMVER = "1.0.0"
const GLIDEDEPS = `` const DEPENDENCIES = `module gitlab.com/elixxir/user-discovery-bot
go 1.13
require (
github.com/go-pg/pg v8.0.6+incompatible
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/mattn/go-shellwords v1.0.10
github.com/mitchellh/go-homedir v1.1.0
github.com/onsi/ginkgo v1.12.0 // indirect
github.com/onsi/gomega v1.9.0 // indirect
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v0.0.5
github.com/spf13/jwalterweatherman v1.1.0
github.com/spf13/viper v1.6.2
gitlab.com/elixxir/client v1.1.1
gitlab.com/elixxir/comms v0.0.0-20200206201144-aa6e356b3770
gitlab.com/elixxir/crypto v0.0.0-20200206203107-b8926242da23
gitlab.com/elixxir/primitives v0.0.0-20200207213955-5ca320a16dec
golang.org/x/crypto v0.0.0-20200207205829-a95e85b341fd // indirect
google.golang.org/genproto v0.0.0-20200207204624-4f3edf09f4f6 // indirect
mellium.im/sasl v0.2.1 // indirect
)
`
...@@ -4,7 +4,6 @@ go 1.13 ...@@ -4,7 +4,6 @@ go 1.13
require ( require (
github.com/go-pg/pg v8.0.6+incompatible github.com/go-pg/pg v8.0.6+incompatible
github.com/golang/protobuf v1.3.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect
github.com/mattn/go-shellwords v1.0.10 github.com/mattn/go-shellwords v1.0.10
github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir v1.1.0
...@@ -14,11 +13,11 @@ require ( ...@@ -14,11 +13,11 @@ require (
github.com/spf13/cobra v0.0.5 github.com/spf13/cobra v0.0.5
github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/jwalterweatherman v1.1.0
github.com/spf13/viper v1.6.2 github.com/spf13/viper v1.6.2
gitlab.com/elixxir/client v0.2.1-0.20200206212827-b9878e95bdca gitlab.com/elixxir/client v1.1.1-0.20200206231036-aa1e40f18ade
gitlab.com/elixxir/comms v0.0.0-20200206201144-aa6e356b3770 gitlab.com/elixxir/comms v0.0.0-20200206201144-aa6e356b3770
gitlab.com/elixxir/crypto v0.0.0-20200206203107-b8926242da23 gitlab.com/elixxir/crypto v0.0.0-20200206203107-b8926242da23
gitlab.com/elixxir/primitives v0.0.0-20200131183153-e93c6b75019f gitlab.com/elixxir/primitives v0.0.0-20200207225613-9a4445ddec16
golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a // indirect golang.org/x/crypto v0.0.0-20200207205829-a95e85b341fd // indirect
google.golang.org/grpc v1.27.1 // indirect google.golang.org/genproto v0.0.0-20200207204624-4f3edf09f4f6 // indirect
mellium.im/sasl v0.2.1 // indirect mellium.im/sasl v0.2.1 // indirect
) )
...@@ -242,22 +242,20 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr ...@@ -242,22 +242,20 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
gitlab.com/elixxir/client v0.2.1-0.20200206212827-b9878e95bdca h1:iSgE/wL9sPP4p13sZc58K6iqcOd64fKHMMl7tR8yhbc= gitlab.com/elixxir/client v1.1.1-0.20200206231036-aa1e40f18ade h1:S1zugSH1092jsKmbknphiup0C/d/cqKzRUGigxJr00E=
gitlab.com/elixxir/client v0.2.1-0.20200206212827-b9878e95bdca/go.mod h1:OMY/xu8Zt+redhmKVv92ayFSUNySamLH373L2TVvJso= gitlab.com/elixxir/client v1.1.1-0.20200206231036-aa1e40f18ade/go.mod h1:hJm04oEgf6Fglqpo/f+bdkGHp8iZVA3KFk5tvK4Oq2Q=
gitlab.com/elixxir/comms v0.0.0-20200130173653-721e14282756 h1:RYVhlBpxk2BmTPh/LBHHAdFkrfxOyD5TCsNfGphJL3w=
gitlab.com/elixxir/comms v0.0.0-20200130173653-721e14282756/go.mod h1:DblaR0msnWpNGzNK2fXvXbfGZQNPH4KPiBl4YkkGF4Y=
gitlab.com/elixxir/comms v0.0.0-20200206201144-aa6e356b3770 h1:zYoqjUaa94+uqznpNb6UT+6aiDNBBfva4LmwFeq+rzU= gitlab.com/elixxir/comms v0.0.0-20200206201144-aa6e356b3770 h1:zYoqjUaa94+uqznpNb6UT+6aiDNBBfva4LmwFeq+rzU=
gitlab.com/elixxir/comms v0.0.0-20200206201144-aa6e356b3770/go.mod h1:DblaR0msnWpNGzNK2fXvXbfGZQNPH4KPiBl4YkkGF4Y= gitlab.com/elixxir/comms v0.0.0-20200206201144-aa6e356b3770/go.mod h1:DblaR0msnWpNGzNK2fXvXbfGZQNPH4KPiBl4YkkGF4Y=
gitlab.com/elixxir/crypto v0.0.0-20191121235352-86d305a9b253 h1:BqgqJ0mLANRjhAFLvGAcB5AWdgAnFZhsGx0qTk5G+3Y= gitlab.com/elixxir/crypto v0.0.0-20191121235352-86d305a9b253 h1:BqgqJ0mLANRjhAFLvGAcB5AWdgAnFZhsGx0qTk5G+3Y=
gitlab.com/elixxir/crypto v0.0.0-20191121235352-86d305a9b253/go.mod h1:+46Zj/NE6JEkXExYnzdvvDokPpDbA+fJsRszvrezK9k= gitlab.com/elixxir/crypto v0.0.0-20191121235352-86d305a9b253/go.mod h1:+46Zj/NE6JEkXExYnzdvvDokPpDbA+fJsRszvrezK9k=
gitlab.com/elixxir/crypto v0.0.0-20200205173613-ec404dbd2ad2 h1:9i1dWxx/zMAFDM3aM1WaT/AmeJ5d2mIky18fwRSLs6U=
gitlab.com/elixxir/crypto v0.0.0-20200205173613-ec404dbd2ad2/go.mod h1:wWulHuSqxiGhvasduZrtyTTqy+7y5ebe440GdORhzig=
gitlab.com/elixxir/crypto v0.0.0-20200206203107-b8926242da23 h1:J9MKdOxLGzDZoLy2Q0CAxPlPjSH+k4NG3JhgvatAZjo= gitlab.com/elixxir/crypto v0.0.0-20200206203107-b8926242da23 h1:J9MKdOxLGzDZoLy2Q0CAxPlPjSH+k4NG3JhgvatAZjo=
gitlab.com/elixxir/crypto v0.0.0-20200206203107-b8926242da23/go.mod h1:wWulHuSqxiGhvasduZrtyTTqy+7y5ebe440GdORhzig= gitlab.com/elixxir/crypto v0.0.0-20200206203107-b8926242da23/go.mod h1:wWulHuSqxiGhvasduZrtyTTqy+7y5ebe440GdORhzig=
gitlab.com/elixxir/primitives v0.0.0-20191028233752-882c08b8f095/go.mod h1:+UiRRWzNpl/WoWUuQtJSoimfXImJAJ5lrrmg0pQKY3g= gitlab.com/elixxir/primitives v0.0.0-20191028233752-882c08b8f095/go.mod h1:+UiRRWzNpl/WoWUuQtJSoimfXImJAJ5lrrmg0pQKY3g=
gitlab.com/elixxir/primitives v0.0.0-20200106183011-a68f1e6f188e/go.mod h1:g9v3S34ZUeqGRiOTV7esByK8a5TovJ3YgTv/328ny6w= gitlab.com/elixxir/primitives v0.0.0-20200106183011-a68f1e6f188e/go.mod h1:g9v3S34ZUeqGRiOTV7esByK8a5TovJ3YgTv/328ny6w=
gitlab.com/elixxir/primitives v0.0.0-20200131183153-e93c6b75019f h1:F0YwFZz4umoXOJ+xX34WIRrucuLgHCSyKxWOKGaEt5g= gitlab.com/elixxir/primitives v0.0.0-20200131183153-e93c6b75019f h1:F0YwFZz4umoXOJ+xX34WIRrucuLgHCSyKxWOKGaEt5g=
gitlab.com/elixxir/primitives v0.0.0-20200131183153-e93c6b75019f/go.mod h1:REJMcwIcyxh74VSHqy4S9yYiaEsQYObOPglRExDpk14= gitlab.com/elixxir/primitives v0.0.0-20200131183153-e93c6b75019f/go.mod h1:REJMcwIcyxh74VSHqy4S9yYiaEsQYObOPglRExDpk14=
gitlab.com/elixxir/primitives v0.0.0-20200207225613-9a4445ddec16 h1:ifJ/7gl7odnp8iz09ranziiSmH+ZI4CalQW2PQn0W6M=
gitlab.com/elixxir/primitives v0.0.0-20200207225613-9a4445ddec16/go.mod h1:REJMcwIcyxh74VSHqy4S9yYiaEsQYObOPglRExDpk14=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
...@@ -281,6 +279,8 @@ golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPh ...@@ -281,6 +279,8 @@ golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a h1:aczoJ0HPNE92XKa7DrIzkNN6esOKO2TBwiiYoKcINhA= golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a h1:aczoJ0HPNE92XKa7DrIzkNN6esOKO2TBwiiYoKcINhA=
golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200206161412-a0c6ece9d31a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200207205829-a95e85b341fd h1:Wf+k80tMDcKkeQiGIgNFmhv4GDSTXoUBhm+33x2ApdA=
golang.org/x/crypto v0.0.0-20200207205829-a95e85b341fd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
...@@ -379,6 +379,8 @@ google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb h1:ADPHZzpzM4tk4V4 ...@@ -379,6 +379,8 @@ google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb h1:ADPHZzpzM4tk4V4
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67 h1:MBO9fkVSrTpJ8vgHLPi5gb+ZWXEy7/auJN8yqyu9EiE= google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67 h1:MBO9fkVSrTpJ8vgHLPi5gb+ZWXEy7/auJN8yqyu9EiE=
google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200205142000-a86caf926a67/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/genproto v0.0.0-20200207204624-4f3edf09f4f6 h1:tirixpud1WdjE3/NrL9ar4ot0ADfwls8sOcIf1ivRDw=
google.golang.org/genproto v0.0.0-20200207204624-4f3edf09f4f6/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.0 h1:G+97AoqBnmZIT91cLG/EkCoK9NSelj64P8bOHHNmGn0= google.golang.org/grpc v1.21.0 h1:G+97AoqBnmZIT91cLG/EkCoK9NSelj64P8bOHHNmGn0=
......
...@@ -15,11 +15,9 @@ import ( ...@@ -15,11 +15,9 @@ import (
// Smoke test for main // Smoke test for main
func TestMainSmoke(t *testing.T) { func TestMainSmoke(t *testing.T) {
cmd.RootCmd.SetArgs([]string{"--version"}) cmd.RootCmd.SetArgs([]string{"version"})
main() main()
cmd.RootCmd.SetArgs([]string{"--version", "--config", "sampleconfig.yaml"}) command := exec.Command("go", "run", "main.go", "version")
main()
command := exec.Command("go", "run", "main.go", "--version")
err := command.Run() err := command.Run()
if e, ok := err.(*exec.ExitError); ok && !e.Success() { if e, ok := err.(*exec.ExitError); ok && !e.Success() {
t.Errorf("Smoke test failed with %v", e) t.Errorf("Smoke test failed with %v", e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment