diff --git a/Gopkg.lock b/Gopkg.lock index 8f254d69..966507cc 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -79,6 +79,14 @@ revision = "2fee6af1a9795aafbe0253a0cfbdf668e1fb8a9a" version = "v1.8.0" +[[projects]] + digest = "1:141cc9fc6279592458b304038bd16a05ef477d125c6dad281216345a11746fd7" + name = "github.com/gofrs/uuid" + packages = ["."] + pruneopts = "" + revision = "6b08a5c5172ba18946672b49749cde22873dd7c2" + version = "v3.2.0" + [[projects]] digest = "1:68c64bb61d55dcd17c82ca0b871ddddb5ae18b30cfe26f6bfd4b6df6287dc2e0" name = "github.com/golang/mock" @@ -187,14 +195,6 @@ revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4" version = "v0.8.1" -[[projects]] - digest = "1:7f569d906bdd20d906b606415b7d794f798f91a62fcfb6a4daa6d50690fb7a3f" - name = "github.com/satori/go.uuid" - packages = ["."] - pruneopts = "" - revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3" - version = "v1.2.0" - [[projects]] digest = "1:55dcddb2ba6ab25098ee6b96f176f39305f1fde7ea3d138e7e10bb64a5bf45be" name = "github.com/shirou/gopsutil" @@ -333,6 +333,7 @@ "github.com/Percona-Lab/pt-pg-summary/models", "github.com/alecthomas/kingpin", "github.com/go-ini/ini", + "github.com/gofrs/uuid", "github.com/golang/mock/gomock", "github.com/hashicorp/go-version", "github.com/howeyc/gopass", @@ -343,7 +344,6 @@ "github.com/pborman/getopt", "github.com/percona/go-mysql/query", "github.com/pkg/errors", - "github.com/satori/go.uuid", "github.com/shirou/gopsutil/process", "github.com/sirupsen/logrus", "go.mongodb.org/mongo-driver/bson", diff --git a/Gopkg.toml b/Gopkg.toml index 8be0bdbe..370f3586 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,25 +1,3 @@ -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - [[constraint]] name = "github.com/Masterminds/semver" version = "1.4.0" @@ -48,10 +26,6 @@ name = "github.com/pkg/errors" version = "0.8.0" -[[constraint]] - name = "github.com/satori/go.uuid" - version = "1.1.0" - [[constraint]] name = "github.com/shirou/gopsutil" version = "2.17.11" diff --git a/runtests.sh b/runtests.sh new file mode 100755 index 00000000..e8fa2bd7 --- /dev/null +++ b/runtests.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +MYSQL_VERSION=$(mysql -ss -e "SELECT VERSION()") +LOGFILE=${HOME}/pt-tests-$(git rev-parse --abbrev-ref HEAD)-mysql-${MYSQL_VERSION}.log +echo "" > ${LOGFILE} + +export PERCONA_TOOLKIT_SANDBOX=${HOME}/mysql/my-5.7 +for d in $(ls -d t/*) +do + sandbox/test-env restart + prove -vw $d | tee -a ${LOGFILE} +done diff --git a/src/go/lib/versioncheck/version_check.go b/src/go/lib/versioncheck/version_check.go index 6d1a43cc..0ca5213e 100644 --- a/src/go/lib/versioncheck/version_check.go +++ b/src/go/lib/versioncheck/version_check.go @@ -10,7 +10,7 @@ import ( "strings" "time" - uuid "github.com/satori/go.uuid" + uuid "github.com/gofrs/uuid" log "github.com/sirupsen/logrus" ) @@ -52,11 +52,14 @@ func CheckUpdates(toolName, version string) (string, error) { } func checkUpdates(url string, timeout time.Duration, toolName, version string) (string, error) { - client := &http.Client{ Timeout: timeout, } - payload := fmt.Sprintf("%x;%s;%s", uuid.NewV2(uuid.DomainOrg).String(), PERCONA_TOOLKIT, version) + vuuid, err := uuid.NewV2(uuid.DomainOrg) + if err != nil { + return "", err + } + payload := fmt.Sprintf("%x;%s;%s", vuuid.String(), PERCONA_TOOLKIT, version) req, err := http.NewRequest("POST", url, strings.NewReader(payload)) if err != nil { return "", err