add test_cli to ci

This commit is contained in:
rigelrozanski 2018-05-31 14:45:07 -07:00
parent 1f1097c4d3
commit 0b6aa3c047
2 changed files with 26 additions and 7 deletions

View File

@ -85,6 +85,22 @@ jobs:
export PATH="$GOBIN:$PATH"
make test_unit
test_cli:
<<: *defaults
parallelism: 1
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
key: v1-pkg-cache
- restore_cache:
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Test cli
command: |
export PATH="$GOBIN:$PATH"
make test_cli
test_cover:
<<: *defaults
parallelism: 4
@ -141,6 +157,9 @@ workflows:
- test_unit:
requires:
- setup_dependencies
- test_cli:
requires:
- setup_dependencies
- test_cover:
requires:
- setup_dependencies

View File

@ -110,18 +110,18 @@ func TestGaiaCLICreateValidator(t *testing.T) {
cvStr += fmt.Sprintf(" --name=%v", "bar")
cvStr += fmt.Sprintf(" --address-validator=%v", barCech)
cvStr += fmt.Sprintf(" --pubkey=%v", barCeshPubKey)
cvStr += fmt.Sprintf(" --amount=%v", "3steak")
cvStr += fmt.Sprintf(" --amount=%v", "1steak")
cvStr += fmt.Sprintf(" --moniker=%v", "bar-vally")
executeWrite(t, cvStr, pass)
time.Sleep(time.Second * 5) // waiting for some blocks to pass
time.Sleep(time.Second * 3) // waiting for some blocks to pass
barAcc = executeGetAccount(t, fmt.Sprintf("gaiacli account %v %v", barCech, flags))
require.Equal(t, int64(7), barAcc.GetCoins().AmountOf("steak"), "%v", barAcc)
require.Equal(t, int64(9), barAcc.GetCoins().AmountOf("steak"), "%v", barAcc)
validator := executeGetValidator(t, fmt.Sprintf("gaiacli validator %v %v", barCech, flags))
assert.Equal(t, validator.Owner.String(), barCech)
assert.Equal(t, int64(3), validator.PoolShares)
validator := executeGetValidator(t, fmt.Sprintf("gaiacli validator --output=json %v %v", barCech, flags))
assert.Equal(t, validator.Owner, barAddr)
assert.Equal(t, "1/1", validator.PoolShares.Amount.String())
// TODO timeout issues if not connected to the internet
// unbond a single share
@ -193,6 +193,6 @@ func executeGetValidator(t *testing.T, cmdStr string) stake.Validator {
var validator stake.Validator
cdc := app.MakeCodec()
err := cdc.UnmarshalJSON([]byte(out), &validator)
require.NoError(t, err, "out %v, err %v", out, err)
require.NoError(t, err, "out %v\n, err %v", out, err)
return validator
}