diff --git a/.circleci/config.yml b/.circleci/config.yml index 762bd5de7..06f5bb03b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ jobs: - checkout - restore_cache: keys: - - v2-pkg-cache + - v1-pkg-cache - run: name: tools command: | @@ -39,11 +39,11 @@ jobs: - bin - profiles - save_cache: - key: v2-pkg-cache + key: v1-pkg-cache paths: - /go/pkg - save_cache: - key: v2-tree-{{ .Environment.CIRCLE_SHA1 }} + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} paths: - /go/src/github.com/cosmos/cosmos-sdk @@ -54,9 +54,9 @@ jobs: - attach_workspace: at: /tmp/workspace - restore_cache: - key: v2-pkg-cache + key: v1-pkg-cache - restore_cache: - key: v2-tree-{{ .Environment.CIRCLE_SHA1 }} + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} - run: name: Get metalinter command: | @@ -76,9 +76,9 @@ jobs: - attach_workspace: at: /tmp/workspace - restore_cache: - key: v2-pkg-cache + key: v1-pkg-cache - restore_cache: - key: v2-tree-{{ .Environment.CIRCLE_SHA1 }} + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} - run: name: Test unit command: | @@ -92,9 +92,9 @@ jobs: - attach_workspace: at: /tmp/workspace - restore_cache: - key: v2-pkg-cache + key: v1-pkg-cache - restore_cache: - key: v2-tree-{{ .Environment.CIRCLE_SHA1 }} + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} - run: name: Test cli command: | @@ -108,9 +108,9 @@ jobs: - attach_workspace: at: /tmp/workspace - restore_cache: - key: v2-pkg-cache + key: v1-pkg-cache - restore_cache: - key: v2-tree-{{ .Environment.CIRCLE_SHA1 }} + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} - run: name: Run tests command: | @@ -132,7 +132,7 @@ jobs: - attach_workspace: at: /tmp/workspace - restore_cache: - key: v2-tree-{{ .Environment.CIRCLE_SHA1 }} + key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} - run: name: gather command: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 889b41746..4a8615977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,14 @@ ## 0.20.0 -*TBD* +*TBD* BREAKING CHANGES * Change default ports from 466xx to 266xx +FIXES +* \#1259 - fix bug where certain tests that could have a nil pointer in defer + ## 0.19.0 *June 13, 2018* @@ -42,7 +45,7 @@ FEATURES * [docs] Reorganize documentation * [docs] Update staking spec, create WIP spec for slashing, and fees -## 0.18.0 +## 0.18.0 *June 9, 2018* diff --git a/client/lcd/lcd_test.go b/client/lcd/lcd_test.go index f4406a869..d6a1b7742 100644 --- a/client/lcd/lcd_test.go +++ b/client/lcd/lcd_test.go @@ -87,7 +87,7 @@ func TestKeys(t *testing.T) { // update key jsonStr = []byte(fmt.Sprintf(`{ - "old_password":"%s", + "old_password":"%s", "new_password":"12345678901" }`, newPassword)) @@ -347,8 +347,8 @@ func TestTxs(t *testing.T) { func TestValidatorsQuery(t *testing.T) { cleanup, pks, port := InitializeTestLCD(t, 2, []sdk.Address{}) - require.Equal(t, 2, len(pks)) defer cleanup() + require.Equal(t, 2, len(pks)) validators := getValidators(t, port) assert.Equal(t, len(validators), 2) @@ -448,12 +448,12 @@ func doSend(t *testing.T, port, seed, name, password string, addr sdk.Address) ( } jsonStr := []byte(fmt.Sprintf(`{ - "name":"%s", + "name":"%s", "password":"%s", - "account_number":%d, - "sequence":%d, + "account_number":%d, + "sequence":%d, "gas": 10000, - "amount":[%s] + "amount":[%s] }`, name, password, accnum, sequence, coinbz)) res, body := Request(t, port, "POST", "/accounts/"+receiveAddrBech+"/send", jsonStr) require.Equal(t, http.StatusOK, res.StatusCode, body) @@ -478,18 +478,18 @@ func doIBCTransfer(t *testing.T, port, seed, name, password string, addr sdk.Add sequence := acc.GetSequence() // send - jsonStr := []byte(fmt.Sprintf(`{ - "name":"%s", - "password": "%s", + jsonStr := []byte(fmt.Sprintf(`{ + "name":"%s", + "password": "%s", "account_number":%d, - "sequence": %d, + "sequence": %d, "gas": 100000, "amount":[ - { - "denom": "%s", - "amount": 1 + { + "denom": "%s", + "amount": 1 } - ] + ] }`, name, password, accnum, sequence, "steak")) res, body := Request(t, port, "POST", "/ibc/testchain/"+receiveAddrBech+"/send", jsonStr) require.Equal(t, http.StatusOK, res.StatusCode, body) diff --git a/server/start_test.go b/server/start_test.go index 046bbe19b..c024546f5 100644 --- a/server/start_test.go +++ b/server/start_test.go @@ -18,6 +18,7 @@ import ( func TestStartStandAlone(t *testing.T) { home, err := ioutil.TempDir("", "mock-sdk-cmd") + require.Nil(t, err) defer func() { os.RemoveAll(home) }() diff --git a/server/test_helpers.go b/server/test_helpers.go index b1050bc6f..fc6098e3c 100644 --- a/server/test_helpers.go +++ b/server/test_helpers.go @@ -18,10 +18,10 @@ import ( // protocol is either tcp, http, etc func FreeTCPAddr() (addr, port string, err error) { l, err := net.Listen("tcp", "0.0.0.0:0") - defer l.Close() if err != nil { return "", "", err } + defer l.Close() portI := l.Addr().(*net.TCPAddr).Port port = fmt.Sprintf("%d", portI)