Skip to content

Commit

Permalink
test(systemtest): fix cometbft client (backport #22835) (#22836)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
mergify[bot] and julienrbrt authored Dec 11, 2024
1 parent d6d1777 commit 25d0b70
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions tests/systemtests/cometbft_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ import (
qtypes "github.com/cosmos/cosmos-sdk/types/query"
)

func TestQueryStatus(t *testing.T) {
systest.Sut.ResetChain(t)
cli := systest.NewCLIWrapper(t, systest.Sut, systest.Verbose)
systest.Sut.StartChain(t)

var resp string
if systest.IsV2() {
resp = cli.CustomQuery("comet", "status")
} else {
resp = cli.CustomQuery("status")
}

// make sure the output has the validator moniker.
assert.Contains(t, resp, "\"moniker\":\"node0\"")
}

func TestQueryNodeInfo(t *testing.T) {
systest.Sut.ResetChain(t)
systest.Sut.StartChain(t)
Expand Down Expand Up @@ -176,7 +192,6 @@ func TestLatestValidatorSet_GRPCGateway(t *testing.T) {
}
rsp := systest.GetRequest(t, baseurl+tc.url)
assert.Equal(t, len(vals), int(gjson.GetBytes(rsp, "pagination.total").Int()))

})
}
}
Expand Down Expand Up @@ -213,7 +228,7 @@ func TestValidatorSetByHeight(t *testing.T) {
}
}

func TestValidatorSetByHeight_GRPCRestGateway(t *testing.T) {
func TestValidatorSetByHeight_GRPCGateway(t *testing.T) {
systest.Sut.ResetChain(t)
systest.Sut.StartChain(t)

Expand All @@ -239,15 +254,17 @@ func TestValidatorSetByHeight_GRPCRestGateway(t *testing.T) {
if tc.expErr {
errMsg := gjson.GetBytes(rsp, "message").String()
assert.Contains(t, errMsg, tc.expErrMsg)
} else {
assert.Equal(t, len(vals), int(gjson.GetBytes(rsp, "pagination.total").Int()))
return
}
assert.Equal(t, len(vals), int(gjson.GetBytes(rsp, "pagination.total").Int()))
})
}
}

func TestABCIQuery(t *testing.T) {
systest.Sut.ResetChain(t)
systest.Sut.StartChain(t)
_ = systest.Sut.AwaitNextBlock(t, time.Second*3)

qc := cmtservice.NewServiceClient(systest.Sut.RPCClient(t))
cdc := codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
Expand Down

0 comments on commit 25d0b70

Please sign in to comment.