Skip to content

Commit

Permalink
e2e: optimise running of params tests/set default allowed clients con…
Browse files Browse the repository at this point in the history
…ditionally on version (#4428)

* wip: fixing failing params test

* fine tuned host enabled params test

* Use slices.DeleteFunc, fix LocalhostClientFeatureReleases docstring.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
  • Loading branch information
Carlos Rodriguez and DimitrisJim authored Aug 24, 2023
1 parent 0ba21dc commit dd85040
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 50 deletions.
3 changes: 1 addition & 2 deletions .github/compatibility-test-matrices/main/client-chain-b.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestClient_Update_Misbehaviour",
"TestAllowedClientsParam"
"TestClient_Update_Misbehaviour"
],
"relayer-type": [
"rly"
Expand Down
3 changes: 1 addition & 2 deletions .github/compatibility-test-matrices/main/ica-chain-a.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
"TestControllerEnabledParam"
],
"relayer-type": [
"rly"
Expand Down
1 change: 0 additions & 1 deletion .github/compatibility-test-matrices/main/ica-chain-b.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
],
"relayer-type": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
"TestMsgTransfer_WithMemo"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
"TestMsgTransfer_WithMemo"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
"TestMsgTransfer_WithMemo"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
"TestMsgTransfer_WithMemo"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestClient_Update_Misbehaviour",
"TestAllowedClientsParam"
"TestClient_Update_Misbehaviour"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
"TestControllerEnabledParam"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
],
"relayer-type": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
"TestMsgTransfer_WithMemo"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestClient_Update_Misbehaviour",
"TestAllowedClientsParam"
"TestClient_Update_Misbehaviour"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
"TestControllerEnabledParam"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
],
"relayer-type": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
"TestMsgTransfer_WithMemo"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestClient_Update_Misbehaviour",
"TestAllowedClientsParam"
"TestClient_Update_Misbehaviour"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
"TestControllerEnabledParam"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
],
"relayer-type": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
"TestMsgTransfer_WithMemo"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
],
"test": [
"TestClientUpdateProposal_Succeeds",
"TestClient_Update_Misbehaviour",
"TestAllowedClientsParam"
"TestClient_Update_Misbehaviour"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
"TestControllerEnabledParam"
],
"relayer-type": [
"rly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"TestMsgSendTx_SuccessfulTransfer",
"TestMsgSendTx_FailedTransfer_InsufficientFunds",
"TestMsgSendTx_SuccessfulTransfer_AfterReopeningICA",
"TestControllerEnabledParam",
"TestHostEnabledParam"
],
"relayer-type": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
"TestMsgTransfer_Succeeds_Nonincentivized",
"TestMsgTransfer_Fails_InvalidAddress",
"TestMsgTransfer_Timeout_Nonincentivized",
"TestMsgTransfer_WithMemo",
"TestSendEnabledParam",
"TestReceiveEnabledParam"
"TestMsgTransfer_WithMemo"
],
"relayer-type": [
"rly"
Expand Down
8 changes: 7 additions & 1 deletion e2e/tests/core/02-client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package client
import (
"context"
"fmt"
"slices"
"sort"
"strings"
"testing"
Expand Down Expand Up @@ -269,7 +270,12 @@ func (s *ClientTestSuite) TestAllowedClientsParam() {

t.Run("ensure allowed clients are set to the default", func(t *testing.T) {
allowedClients := s.QueryAllowedClients(ctx, chainA)
s.Require().Equal(clienttypes.DefaultAllowedClients, allowedClients)

defaultAllowedClients := clienttypes.DefaultAllowedClients
if !testvalues.LocalhostClientFeatureReleases.IsSupported(chainAVersion) {
defaultAllowedClients = slices.DeleteFunc(defaultAllowedClients, func(s string) bool { return s == ibcexported.Localhost })
}
s.Require().Equal(defaultAllowedClients, allowedClients)
})

allowedClient := ibcexported.Solomachine
Expand Down
7 changes: 7 additions & 0 deletions e2e/testvalues/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,10 @@ var TotalEscrowFeatureReleases = semverutil.FeatureReleases{
var IbcErrorsFeatureReleases = semverutil.FeatureReleases{
MajorVersion: "v8.0",
}

// LocalhostClientFeatureReleases represents the releases the localhost client was released in.
var LocalhostClientFeatureReleases = semverutil.FeatureReleases{
MinorVersions: []string{
"v7.1",
},
}

0 comments on commit dd85040

Please sign in to comment.