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

chore: fix system test for v2 #23328

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/v2-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
- name: system tests v2
if: env.GIT_DIFF
run: |
COSMOS_BUILD_OPTIONS=v2 make test-system
make test-system
- uses: actions/upload-artifact@v4
if: failure()
with:
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/testing.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ test-all: test-unit test-integration test-ledger-mock test-race
.PHONY: test-system
test-system: build
mkdir -p ./tests/systemtests/binaries/
cp $(BUILDDIR)/simd$(if $(findstring v2,$(COSMOS_BUILD_OPTIONS)),v2) ./tests/systemtests/binaries/
$(MAKE) -C tests/systemtests test
cp $(BUILDDIR)/simdv2 ./tests/systemtests/binaries/
COSMOS_BUILD_OPTIONS=v2 $(MAKE) -C tests/systemtests test


TEST_PACKAGES=./...
Expand Down
74 changes: 41 additions & 33 deletions tests/systemtests/tx_test.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert. See #23290 (comment)
It should keep failing until we have a fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed by #23262

Original file line number Diff line number Diff line change
Expand Up @@ -344,52 +344,60 @@ func TestGetTxEvents_GRPCGateway(t *testing.T) {
expLen int
}{
{
"empty params",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs", baseURL),
true,
"query cannot be empty", 0,
name: "empty params",
url: fmt.Sprintf("%s/cosmos/tx/v1beta1/txs", baseURL),
expErr: true,
expErrMsg: "query cannot be empty",
expLen: 0,
},
{
"without pagination",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s", baseURL, bankMsgSendEventAction),
false,
"", 2,
name: "without pagination",
url: fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s", baseURL, bankMsgSendEventAction),
expErr: false,
expErrMsg: "",
expLen: 2,
},
{
"with pagination",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&page=%d&limit=%d", baseURL, bankMsgSendEventAction, 1, 1),
false,
"", 1,
name: "with pagination",
url: fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&page=%d&limit=%d", baseURL, bankMsgSendEventAction, 1, 1),
expErr: false,
expErrMsg: "",
expLen: 1,
},
{
"valid request: order by asc",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s&order_by=ORDER_BY_ASC", baseURL, bankMsgSendEventAction, "message.module='bank'"),
false,
"", 2,
name: "invalid request: invalid order by",
url: fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s&order_by=invalid_order", baseURL, bankMsgSendEventAction, "message.module='bank'"),
expErr: true,
expErrMsg: "cannot parse 'order_by'",
expLen: 0,
},
{
"valid request: order by desc",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s&order_by=ORDER_BY_DESC", baseURL, bankMsgSendEventAction, "message.module='bank'"),
false,
"", 2,
name: "expect pass with multiple-events",
url: fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s", baseURL, bankMsgSendEventAction, "message.module='bank'"),
expErr: false,
expErrMsg: "",
expLen: 2,
},
{
"invalid request: invalid order by",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s&order_by=invalid_order", baseURL, bankMsgSendEventAction, "message.module='bank'"),
true,
"is not a valid tx.OrderBy", 0,
name: "expect pass with escape event",
url: fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s", baseURL, "message.action%3D'/cosmos.bank.v1beta1.MsgSend'"),
expErr: false,
expErrMsg: "",
expLen: 2,
},
{
"expect pass with multiple-events",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&query=%s", baseURL, bankMsgSendEventAction, "message.module='bank'"),
false,
"", 2,
name: "valid request: order by asc",
url: fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&order_by=1", baseURL, bankMsgSendEventAction),
expErr: false,
expErrMsg: "",
expLen: 2,
},
{
"expect pass with escape event",
fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s", baseURL, "message.action%3D'/cosmos.bank.v1beta1.MsgSend'"),
false,
"", 2,
name: "valid request: order by desc",
url: fmt.Sprintf("%s/cosmos/tx/v1beta1/txs?query=%s&order_by=2", baseURL, bankMsgSendEventAction),
expErr: false,
expErrMsg: "",
expLen: 2,
},
}
for _, tc := range testCases {
Expand All @@ -401,7 +409,7 @@ func TestGetTxEvents_GRPCGateway(t *testing.T) {
} else {
require.NoError(t, err)
txs := gjson.Get(string(res), "txs").Array()
require.Equal(t, len(txs), tc.expLen)
require.Equal(t, tc.expLen, len(txs))
}
})
}
Expand Down
Loading