Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(systemtest): fix cometbft client (backport #22835) #22836

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading