From bc6aeeb4f1f62909be07a2509b3e473dff8fbaf5 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 10 Jul 2016 16:16:06 +0800 Subject: [PATCH] add https test. Signed-off-by: Bo-Yi Wu --- glide.lock | 368 ++++++++---------------------------------- glide.yaml | 1 + go.test.sh | 3 +- gorush/server_test.go | 2 +- 4 files changed, 73 insertions(+), 301 deletions(-) diff --git a/glide.lock b/glide.lock index 1df0ac3..1fb0107 100644 --- a/glide.lock +++ b/glide.lock @@ -1,149 +1,99 @@ -hash: 9aca7e6e492e8151c2c1ba7d36ff7180be424e2ea707ace1958926d5f06968af -updated: 2016-06-28T11:30:38.463742812+08:00 +hash: d182f8dc3162313af09e706a0ba4901218d9ccde609ee7d39c6aae5e891f20ee +updated: 2016-07-10T15:59:10.549227418+08:00 imports: -- name: github.com/alecthomas/kingpin - version: 30de531dd802b2b402bf7dfd89515d6722a56a35 -- name: github.com/alecthomas/template - version: a0175ee3bccc567396460bf5acd36800cb10c49c +- name: github.com/appleboy/gorush + version: def178ca0ec2106752c3b4909d99c968567a75ee subpackages: - - parse -- name: github.com/alecthomas/units - version: 2efee857e7cfd4f3d0138cc3cbb1b4966962b93a -- name: github.com/aliafshar/toylog - version: 11d228569d74fd7a2c9d50016043ccc31e6832ed + - config + - gorush + - storage/boltdb + - storage/memory + - storage/redis - name: github.com/asdine/storm - version: 6e68f8e0b4e06912498cd60a1ca508bdf5ae013f + version: 00b2f2df7ab7af9db746b826649395628cb5374e subpackages: - codec - codec/gob - index -- name: github.com/astaxie/beego - version: 88c5dfa6ead42e624c2e7d9e04eab6cb2d07412a - subpackages: - - context - - config - - grace - - logs - - session - - toolbox - - utils - - orm -- name: github.com/beego/goyaml2 - version: 5545475820ddd4db3f90a4900d44b65d077d702d -- name: github.com/beego/x2j - version: a0352aadc5420072ebe692481a5d6913d77f8cf0 -- name: github.com/belogik/goes - version: e54d722c3aff588e4c737fe11c07359019240824 - name: github.com/boltdb/bolt - version: 3f7947a25d970e1e5f512276c14d5dcf731ccd5e -- name: github.com/bradfitz/gomemcache - version: fb1f79c6b65acda83063cbc69f6bba1522558bfc - subpackages: - - memcache + version: acc803f0ced151102ed51bf824f8709ebd6602bc - name: github.com/buger/jsonparser version: 183ade1ac7705adf72585f92410fc0912783217a -- name: github.com/BurntSushi/toml - version: f0aeabca5a127c4078abb8c8d64298b147264b55 -- name: github.com/clbanning/x2j - version: f6421fb8583d19dfa0846d81e33a672addd7beeb -- name: github.com/codegangsta/inject - version: 33e0aa1cb7c019ccc3fbe049a8262a6403d30504 -- name: github.com/codegangsta/negroni - version: dcaac9107a7a6ba4cf5143afc145e2b70a1c12c2 -- name: github.com/couchbase/cbauth - version: 4a6d537777f57b291a8126f94dfbe3201c1d4efc - subpackages: - - cbauthimpl - - revrpc - - metakv - - service - - saslauthd -- name: github.com/couchbase/go-couchbase - version: e7e0e4cc00545f11130a22025222a48c0bfd4821 - subpackages: - - platform - - trace -- name: github.com/couchbase/go_n1ql - version: 6cf4e348b127e21f56e53eb8c3faaea56afdc588 -- name: github.com/couchbase/gomemcached - version: 6172a8c61c821c420071fe9e20e74d8e24c8cbd5 - subpackages: - - client - - server -- name: github.com/couchbase/goutils - version: 5823a0cbaaa9008406021dc5daf80125ea30bba6 - subpackages: - - logging -- name: github.com/couchbaselabs/go_n1ql - version: 6cf4e348b127e21f56e53eb8c3faaea56afdc588 -- name: github.com/cupcake/rdb - version: 90399abcaaff31d7844fbae7f9acb27109946f7f - subpackages: - - nopdecoder - - crc64 -- name: github.com/davecgh/go-spew - version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d - subpackages: - - spew -- name: github.com/dchest/siphash - version: 6d8617816bb5d8268011ffbfb8720f17ce9af63c -- name: github.com/dgrijalva/jwt-go - version: f0777076321ab64f6efc15a82d9d23b98539b943 -- name: github.com/dgryski/go-ddmin - version: f7df7ebd4081e6d5d5efc4c70e9c871c9af4ccc0 -- name: github.com/dustin/go-broadcast - version: 3bdf6d4a7164a50bc19d5f230e2981d87d2584f1 -- name: github.com/edsrzf/mmap-go - version: 935e0e8a636ca4ba70b713f3e38a19e1b77739e8 - name: github.com/fvbock/endless version: 2cdc20a776897c0f406853c048c33e2c1a9f0ebf -- name: github.com/garyburd/redigo - version: b8dc90050f24c1a73a52f107f3f575be67b21b7c - subpackages: - - redis - - internal - name: github.com/gin-gonic/gin version: f931d1ea80ae95a6fc739213cdd9399bd2967fb6 subpackages: - binding - render -- name: github.com/go-martini/martini - version: c257c412d547ac70fcaf5596c1a50a7cb832c1fc -- name: github.com/go-sql-driver/mysql - version: 3654d25ec346ee8ce71a68431025458d52a38ac0 -- name: github.com/gocraft/web - version: 12b4630b4fee3e485b334c4d544bd9dd68fb3d4f -- name: github.com/goji/param - version: 0b4aa9fcd96f890c0ae685fc425d85b80a7bed52 - name: github.com/golang/protobuf version: 2402d76f3d41f928c7902a765dfc872356dd3aad subpackages: - proto - - proto/testdata -- name: github.com/golang/snappy - version: d9eb7a3d35ec988b8585d4a0068e462c27d28380 - name: github.com/google/go-gcm version: 190e93b4cedb43562b5bd558eb1a1bbd38695bcd -- name: github.com/gorilla/context - version: aed02d124ae4a0e94fea4541c8effd05bf0c8296 -- name: github.com/gorilla/mux - version: 9fa818a44c2bf1396a17f9d5a3c0f6dd39d2ff8e - name: github.com/jpillora/backoff version: 0496a6c14df020789376f4d4a261273d5ddb36ec -- name: github.com/julienschmidt/httprouter - version: 77366a47451a56bb3ba682481eed85b64fea14e8 -- name: github.com/klauspost/compress - version: 14eb9c4951195779ecfbec34431a976de7335b0a +- name: github.com/manucorporat/sse + version: ee05b128a739a0fb76c7ebd3ae4810c1de808d6d +- name: github.com/mattn/go-xmpp + version: e44d1877bb457f5c3991903e9934a31e55c3a2ad +- name: github.com/pborman/uuid + version: c55201b036063326c5b1b89ccfe45a184973d073 +- name: github.com/sideshow/apns2 + version: eacc6af2afb61c660381cd3b75a6ecc2fefffcdc subpackages: - - flate - - gzip - - zlib -- name: github.com/klauspost/cpuid - version: 09cded8978dc9e80714c4d85b0322337b0a1e5e0 -- name: github.com/klauspost/crc32 - version: 19b0b332c9e4516a6370a0456e6182c3b5036720 + - certificate + - payload +- name: github.com/Sirupsen/logrus + version: 4b6ea7319e214d98c938f12692336f7ca9348d6b +- name: github.com/stretchr/testify + version: d77da356e56a7428ad25149ca77381849a6a5232 + subpackages: + - assert +- name: github.com/thoas/stats + version: 69e3c072eec2df2df41afe6214f62eb940e4cd80 +- name: golang.org/x/crypto + version: c2f4947f41766b144bb09066e919466da5eddeae + subpackages: + - pkcs12 + - pkcs12/internal/rc2 +- name: golang.org/x/net + version: f315505cf3349909cdf013ea56690da34e96a451 + subpackages: + - context + - http2 + - http2/hpack +- name: golang.org/x/sys + version: a408501be4d17ee978c04a618e7a1b22af058c0e + subpackages: + - unix +- name: gopkg.in/appleboy/gin-status-api.v1 + version: d41a075a5a6883245b7fdefbefd4fa4d1462e1f1 +- name: gopkg.in/appleboy/gofight.v1 + version: 1a36a6d5ab10fba252a9cbecb1bcb72f9a2e6770 +- name: gopkg.in/bsm/ratelimit.v1 + version: db14e161995a5177acef654cb0dd785e8ee8bc22 +- name: gopkg.in/fukata/golang-stats-api-handler.v1 + version: 90f0b59102629831cc109845475a8d77043412ec +- name: gopkg.in/go-playground/validator.v8 + version: c193cecd124b5cc722d7ee5538e945bdb3348435 +- name: gopkg.in/redis.v3 + version: b5e368500d0a508ef8f16e9c2d4025a8a46bcc29 + subpackages: + - internal + - internal/consistenthash + - internal/hashtag + - internal/pool +- name: gopkg.in/yaml.v2 + version: a83829b6f1293c91addabc89d0571c246397bbf4 +testImports: +- name: github.com/davecgh/go-spew + version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d + subpackages: + - spew - name: github.com/labstack/echo - version: fa80ead5e2739b8e63076081e275d80c96cd7ad7 + version: 451b2ccc9ffda7fd7fad2027b75d93b18ff87cbe subpackages: - engine - test @@ -152,194 +102,14 @@ imports: version: 722aa12d41c236ce78ff48eac1cafe0107ecdc9d subpackages: - log - - bytes - color -- name: github.com/lib/pq - version: 4dd446efc17690bc53e154025146f73203b18309 - subpackages: - - oid -- name: github.com/mailru/easyjson - version: 69e532648c145d4ae3b9214d166e20938eae8ef3 - subpackages: - - jlexer - - jwriter - - buffer -- name: github.com/manucorporat/sse - version: ee05b128a739a0fb76c7ebd3ae4810c1de808d6d -- name: github.com/manucorporat/stats - version: 8f2d6ace262eba462e9beb552382c98be51d807b - name: github.com/mattn/go-colorable version: 9056b7a9f2d1f2d96498d6d146acd1f9d5ed3d59 - name: github.com/mattn/go-isatty version: 56b76bdf51f7708750eac80fa38b952bb9f32639 -- name: github.com/mattn/go-xmpp - version: aeb80ddc4dc7a688339c4cb746e8a0d79f9a3812 -- name: github.com/onsi/ginkgo - version: 059cec02d342bab423425a99b191186a03255e9e - subpackages: - - config - - internal/codelocation - - internal/failer - - internal/remote - - internal/suite - - internal/testingtproxy - - internal/writer - - reporters - - reporters/stenographer - - types - - ginkgo/convert - - ginkgo/interrupthandler - - ginkgo/nodot - - ginkgo/testrunner - - ginkgo/testsuite - - ginkgo/watch - - internal/leafnodes -- name: github.com/onsi/gomega - version: 0df7b7fdb38123c12a1f569f0affb2c2a7bd72cf - subpackages: - - internal/assertion - - internal/asyncassertion - - internal/testingtsupport - - matchers - - types - - internal/oraclematcher - - matchers/support/goraph/bipartitegraph - - matchers/support/goraph/edge - - matchers/support/goraph/node - - matchers/support/goraph/util -- name: github.com/Pallinder/go-randomdata - version: 104cc800bd6434e70cb0c3ad08c4541f4f2eb48b -- name: github.com/pborman/uuid - version: c55201b036063326c5b1b89ccfe45a184973d073 - name: github.com/pmezard/go-difflib version: 792786c7400a136282c1664665ae0a8db921c6c2 subpackages: - difflib -- name: github.com/pquerna/ffjson - version: a16f62ecdaf7d13077d64d3cdb1cc43486119809 - subpackages: - - fflib/v1 - - fflib/v1/internal -- name: github.com/Sereal/Sereal - version: 835611bf2e782a6bb3fb2e212038019fb67fe1a9 - subpackages: - - Go/sereal -- name: github.com/siddontang/go - version: 354e14e6c093c661abb29fd28403b3c19cff5514 - subpackages: - - ioutil2 - - filelock - - hack - - log - - num - - snappy - - sync2 -- name: github.com/siddontang/ledisdb - version: ca344836ab73bdff9b84d75496862d9fa60c09ad - subpackages: - - config - - ledis - - rpl - - store - - store/driver - - store/goleveldb - - store/leveldb - - store/rocksdb -- name: github.com/siddontang/rdb - version: fc89ed2e418d27e3ea76e708e54276d2b44ae9cf -- name: github.com/sideshow/apns2 - version: 873d6f531482befe8177997be72eacf61c72d5a2 - subpackages: - - certificate - - payload -- name: github.com/Sirupsen/logrus - version: 4b6ea7319e214d98c938f12692336f7ca9348d6b -- name: github.com/ssdb/gossdb - version: 8d1dc1f3aff77506a891268fb787b0ae5e3b351c - subpackages: - - ssdb -- name: github.com/stretchr/objx - version: cbeaeb16a013161a98496fad62933b1d21786672 -- name: github.com/stretchr/testify - version: f390dcf405f7b83c997eac1b06768bb9f44dec18 - subpackages: - - assert - - http - - mock -- name: github.com/syndtr/goleveldb - version: fa5b5c78794bc5c18f330361059f871ae8c2b9d6 - subpackages: - - leveldb - - leveldb/cache - - leveldb/filter - - leveldb/iterator - - leveldb/opt - - leveldb/storage - - leveldb/util - - leveldb/comparer - - leveldb/errors - - leveldb/journal - - leveldb/memdb - - leveldb/table -- name: github.com/thoas/stats - version: 69e3c072eec2df2df41afe6214f62eb940e4cd80 -- name: github.com/ugorji/go - version: b94837a2404ab90efe9289e77a70694c355739cb - subpackages: - - codec -- name: github.com/valyala/fasthttp - version: 29a4c4d6c1764a7986e68ab18c4b83f0e08c2df8 - subpackages: - - fasthttputil - - expvarhandler - name: github.com/valyala/fasttemplate version: 3b874956e03f1636d171bda64b130f9135f42cff -- name: github.com/wendal/errors - version: f66c77a7882b399795a8987ebf87ef64a427417e -- name: github.com/zenazn/goji - version: 64eb34159fe53473206c2b3e70fe396a639452f2 - subpackages: - - bind - - graceful - - web - - web/middleware - - graceful/listener - - web/mutil -- name: golang.org/x/crypto - version: f3241ce8505855877cc8a9717bd61a0f7c4ea83c - subpackages: - - pkcs12 - - ssh/terminal - - pkcs12/internal/rc2 -- name: golang.org/x/net - version: f315505cf3349909cdf013ea56690da34e96a451 - subpackages: - - context - - http2 - - http2/hpack -- name: gopkg.in/airbrake/gobrake.v2 - version: 31c8ff1fb8b79a6947e6565e9a6df535f98a6b94 -- name: gopkg.in/alecthomas/kingpin.v2 - version: 8cccfa8eb2e3183254457fb1749b2667fbc364c7 -- name: gopkg.in/appleboy/gin-status-api.v1 - version: d41a075a5a6883245b7fdefbefd4fa4d1462e1f1 -- name: gopkg.in/appleboy/gofight.v1 - version: c44e131161d0a8a4973d27603f415b04685bbd81 -- name: gopkg.in/bsm/ratelimit.v1 - version: db14e161995a5177acef654cb0dd785e8ee8bc22 -- name: gopkg.in/fukata/golang-stats-api-handler.v1 - version: 90f0b59102629831cc109845475a8d77043412ec -- name: gopkg.in/gemnasium/logrus-airbrake-hook.v2 - version: 31e6fd4bd5a98d8ee7673d24bc54ec73c31810dd -- name: gopkg.in/go-playground/validator.v8 - version: c193cecd124b5cc722d7ee5538e945bdb3348435 -- name: gopkg.in/redis.v3 - version: a905127dc89ca51a241eacf70757a40423ab93d0 - subpackages: - - internal - - internal/consistenthash - - internal/hashtag - - internal/pool -- name: gopkg.in/yaml.v2 - version: a83829b6f1293c91addabc89d0571c246397bbf4 -devImports: [] diff --git a/glide.yaml b/glide.yaml index f007c25..7881c69 100644 --- a/glide.yaml +++ b/glide.yaml @@ -15,5 +15,6 @@ import: - package: github.com/stretchr/testify - package: github.com/asdine/storm - package: gopkg.in/appleboy/gofight.v1 + version: v1.0.1 - package: github.com/buger/jsonparser - package: github.com/thoas/stats diff --git a/go.test.sh b/go.test.sh index 96295a8..b5bbe28 100755 --- a/go.test.sh +++ b/go.test.sh @@ -6,12 +6,13 @@ output() { printf "\033[32m" echo $1 printf "\033[0m" - exit 0 + exit 1 } coverage_mode=$1 test -z $coverage_mode && output "Usage: $0 coverage_mode" +test -z $(which glide) && output "glide command not found" test -f coverage.txt && rm -rf coverage.txt echo "mode: ${coverage_mode}" > coverage.txt diff --git a/gorush/server_test.go b/gorush/server_test.go index 57320a1..2555e1b 100644 --- a/gorush/server_test.go +++ b/gorush/server_test.go @@ -59,7 +59,7 @@ func TestRunTLSServer(t *testing.T) { // otherwise the main thread will complete time.Sleep(5 * time.Millisecond) - assert.Error(t, RunHTTPServer()) + gofight.TestRequest(t, "https://localhost:8087/api/stat/go") } func TestRootHandler(t *testing.T) {