From c89018f51e57a3f6105f3427242e368f6c43fd84 Mon Sep 17 00:00:00 2001 From: Yu Shuaipeng Date: Wed, 7 Feb 2018 15:28:14 +0800 Subject: [PATCH 1/2] update check --- _vendor/src/github.com/pingcap/check/check.go | 16 +++++++++++++- .../src/github.com/pingcap/check/checkers.go | 2 +- _vendor/src/github.com/pingcap/check/run.go | 2 ++ glide.lock | 21 +++---------------- glide.yaml | 2 +- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/_vendor/src/github.com/pingcap/check/check.go b/_vendor/src/github.com/pingcap/check/check.go index c9485e70447de..fc535bc38fa0e 100644 --- a/_vendor/src/github.com/pingcap/check/check.go +++ b/_vendor/src/github.com/pingcap/check/check.go @@ -534,6 +534,7 @@ type RunConf struct { BenchmarkTime time.Duration // Defaults to 1 second BenchmarkMem bool KeepWorkDir bool + Exclude string } // Create a new suiteRunner able to run all methods in the given suite. @@ -578,6 +579,17 @@ func newSuiteRunner(suite interface{}, runConf *RunConf) *suiteRunner { } } + var excludeRegexp *regexp.Regexp + if conf.Exclude != "" { + if regexp, err := regexp.Compile(conf.Exclude); err != nil { + msg := "Bad exclude expression: " + err.Error() + runner.tracker.result.RunError = errors.New(msg) + return runner + } else { + excludeRegexp = regexp + } + } + for i := 0; i != suiteNumMethods; i++ { method := newMethod(suiteValue, i) switch method.Info.Name { @@ -598,7 +610,9 @@ func newSuiteRunner(suite interface{}, runConf *RunConf) *suiteRunner { continue } if filterRegexp == nil || method.matches(filterRegexp) { - runner.tests = append(runner.tests, method) + if excludeRegexp == nil || !method.matches(excludeRegexp) { + runner.tests = append(runner.tests, method) + } } } } diff --git a/_vendor/src/github.com/pingcap/check/checkers.go b/_vendor/src/github.com/pingcap/check/checkers.go index bac338729c887..3749545873763 100644 --- a/_vendor/src/github.com/pingcap/check/checkers.go +++ b/_vendor/src/github.com/pingcap/check/checkers.go @@ -212,7 +212,7 @@ type hasLenChecker struct { // The HasLen checker verifies that the obtained value has the // provided length. In many cases this is superior to using Equals -// in conjuction with the len function because in case the check +// in conjunction with the len function because in case the check // fails the value itself will be printed, instead of its length, // providing more details for figuring the problem. // diff --git a/_vendor/src/github.com/pingcap/check/run.go b/_vendor/src/github.com/pingcap/check/run.go index bf0d65ac9e54e..afa631f470484 100644 --- a/_vendor/src/github.com/pingcap/check/run.go +++ b/_vendor/src/github.com/pingcap/check/run.go @@ -42,6 +42,7 @@ var ( newBenchMem = flag.Bool("check.bmem", false, "Report memory benchmarks") newListFlag = flag.Bool("check.list", false, "List the names of all tests that will be run") newWorkFlag = flag.Bool("check.work", false, "Display and do not remove the test working directory") + newExcludeFlag = flag.String("check.exclude", "", "Regular expression to exclude tests to run") ) var CustomVerboseFlag bool @@ -62,6 +63,7 @@ func TestingT(testingT *testing.T) { BenchmarkTime: benchTime, BenchmarkMem: *newBenchMem, KeepWorkDir: *oldWorkFlag || *newWorkFlag, + Exclude: *newExcludeFlag, } if *oldListFlag || *newListFlag { w := bufio.NewWriter(os.Stdout) diff --git a/glide.lock b/glide.lock index b7089c11e5f04..361e76c8c4a7d 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 8d417eb10577464722137ba91ba0d045cccf47b81f9ea4f21d9e133410f3cf46 -updated: 2017-10-23T20:08:13.880281979+08:00 +hash: c478c01828fcb1cc64c867d184887920674563c9a0b6549e36463ef7a518f07d +updated: 2018-02-07T15:25:46.034782+08:00 imports: - name: bitbucket.org/ww/goautoneg version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675 @@ -24,14 +24,6 @@ imports: - etcdserver/etcdserverpb - mvcc/mvccpb - pkg/tlsutil -- name: github.com/coreos/go-systemd - version: 48702e0da86bd25e76cfef347e2adeb434a0d0a6 - subpackages: - - journal -- name: github.com/coreos/pkg - version: 3ac0863d7acf3bc44daf49afef8919af12f704ef - subpackages: - - capnslog - name: github.com/cznic/golex version: da5a7153a51074477ecac5c45a7e5182a0c72448 subpackages: @@ -103,7 +95,7 @@ imports: - name: github.com/peterh/liner version: 3f3a91ddf7d2784892a58e27ddf48d70e3304bb7 - name: github.com/pingcap/check - version: 9b266636177e249ec28b0aeffe8e86bc272bb481 + version: 1c287c953996ab3a0bf535dba9d53d809d3dc0b6 - name: github.com/pingcap/goleveldb version: 8d44bfdf1030639ae7130922c95df12d6d4da3b6 subpackages: @@ -130,8 +122,6 @@ imports: - pkg/pdpb - pkg/raft_serverpb - pkg/tikvpb -- name: github.com/pingcap/mysqlx-driver - version: 2d8314d333881ae8b5947623d6ff49741707a31a - name: github.com/pingcap/mysqlx_driver version: 2d8314d333881ae8b5947623d6ff49741707a31a repo: git@github.com:pingcap/mysqlx-driver.git @@ -139,7 +129,6 @@ imports: version: 91e4257196bb714005f80a6e075bc1e19a9687b1 subpackages: - pd-client - - pkg/logutil - name: github.com/pingcap/tipb version: eccd39c3992538c382a6351430a77233f42b1344 subpackages: @@ -177,10 +166,6 @@ imports: version: ba1b36c82c5e05c4f912a88eab0dcd91a171688f - name: github.com/spaolacci/murmur3 version: 0d12bf811670bf6a1a63828dfbd003eded177fce -- name: github.com/syndtr/goleveldb - version: b89cc31ef7977104127d34c1bd31ebd1a9db2199 - subpackages: - - leveldb/comparer - name: github.com/twinj/uuid version: 70cac2bcd273ef6a371bb96cde363d28b68734c3 - name: golang.org/x/net diff --git a/glide.yaml b/glide.yaml index b80a8b1e2236e..604d60e7a4156 100644 --- a/glide.yaml +++ b/glide.yaml @@ -49,7 +49,7 @@ import: - package: github.com/peterh/liner version: 3f3a91ddf7d2784892a58e27ddf48d70e3304bb7 - package: github.com/pingcap/check - version: 9b266636177e249ec28b0aeffe8e86bc272bb481 + version: 1c287c953996ab3a0bf535dba9d53d809d3dc0b6 - package: github.com/pingcap/goleveldb version: 8d44bfdf1030639ae7130922c95df12d6d4da3b6 subpackages: From 929d0922d2fc3ae7b1e621e1f5d1fb341e3b54b9 Mon Sep 17 00:00:00 2001 From: Yu Shuaipeng Date: Wed, 7 Feb 2018 15:34:14 +0800 Subject: [PATCH 2/2] fix glide.lock --- glide.lock | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/glide.lock b/glide.lock index 361e76c8c4a7d..9a96290bc6e38 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: c478c01828fcb1cc64c867d184887920674563c9a0b6549e36463ef7a518f07d -updated: 2018-02-07T15:25:46.034782+08:00 +hash: 8d417eb10577464722137ba91ba0d045cccf47b81f9ea4f21d9e133410f3cf46 +updated: 2017-10-23T20:08:13.880281979+08:00 imports: - name: bitbucket.org/ww/goautoneg version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675 @@ -24,6 +24,14 @@ imports: - etcdserver/etcdserverpb - mvcc/mvccpb - pkg/tlsutil +- name: github.com/coreos/go-systemd + version: 48702e0da86bd25e76cfef347e2adeb434a0d0a6 + subpackages: + - journal +- name: github.com/coreos/pkg + version: 3ac0863d7acf3bc44daf49afef8919af12f704ef + subpackages: + - capnslog - name: github.com/cznic/golex version: da5a7153a51074477ecac5c45a7e5182a0c72448 subpackages: @@ -122,6 +130,8 @@ imports: - pkg/pdpb - pkg/raft_serverpb - pkg/tikvpb +- name: github.com/pingcap/mysqlx-driver + version: 2d8314d333881ae8b5947623d6ff49741707a31a - name: github.com/pingcap/mysqlx_driver version: 2d8314d333881ae8b5947623d6ff49741707a31a repo: git@github.com:pingcap/mysqlx-driver.git @@ -129,6 +139,7 @@ imports: version: 91e4257196bb714005f80a6e075bc1e19a9687b1 subpackages: - pd-client + - pkg/logutil - name: github.com/pingcap/tipb version: eccd39c3992538c382a6351430a77233f42b1344 subpackages: @@ -166,6 +177,10 @@ imports: version: ba1b36c82c5e05c4f912a88eab0dcd91a171688f - name: github.com/spaolacci/murmur3 version: 0d12bf811670bf6a1a63828dfbd003eded177fce +- name: github.com/syndtr/goleveldb + version: b89cc31ef7977104127d34c1bd31ebd1a9db2199 + subpackages: + - leveldb/comparer - name: github.com/twinj/uuid version: 70cac2bcd273ef6a371bb96cde363d28b68734c3 - name: golang.org/x/net