Skip to content

Commit

Permalink
Update CI Documentation (#7539)
Browse files Browse the repository at this point in the history
* wip: working on design doc

* chore: updating readme

* chore: finalizing readme

* add extra note and fix linter

* chore: updating some docstrings

* chore: added links to created issues
  • Loading branch information
chatton authored Nov 20, 2024
1 parent ae3dffb commit a766bce
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 120 deletions.
14 changes: 3 additions & 11 deletions cmd/build_test_matrix/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"io/fs"
"os"
"path/filepath"
"slices"
"sort"
"strings"
)
Expand Down Expand Up @@ -80,15 +81,6 @@ func getExcludedTestFunctions() []string {
return strings.Split(exclusions, ",")
}

func contains(s string, items []string) bool {
for _, elem := range items {
if elem == s {
return true
}
}
return false
}

// getGithubActionMatrixForTests returns a json string representing the contents that should go in the matrix
// field in a github action workflow. This string can be used with `fromJSON(str)` to dynamically build
// the workflow matrix to include all E2E tests under the e2eRootDirectory directory.
Expand All @@ -115,11 +107,11 @@ func getGithubActionMatrixForTests(e2eRootDirectory, testName string, suite stri
return nil
}

if testName != "" && contains(testName, testCases) {
if testName != "" && slices.Contains(testCases, testName) {
testCases = []string{testName}
}

if contains(suiteNameForFile, excludedItems) {
if slices.Contains(excludedItems, suiteNameForFile) {
return nil
}

Expand Down
5 changes: 1 addition & 4 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@ e2e-test: init cleanup-ibc-test-containers
e2e-suite: init cleanup-ibc-test-containers
RUN_SUITE="true" ./scripts/run-e2e.sh "" $(entrypoint)

compatibility-tests:
./scripts/run-compatibility-tests.sh $(release_branch)

.PHONY: cleanup-ibc-test-containers e2e-test compatibility-tests init
.PHONY: cleanup-ibc-test-containers e2e-test init
158 changes: 86 additions & 72 deletions e2e/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion e2e/relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (r Map) AddRelayer(testName string, ibcrelayer ibc.Wallet) {
r[testName][ibcrelayer] = true
}

// containsRelayer returns true if the given relayer is in the relayer set for the given test name.
// ContainsRelayer returns true if the given relayer is in the relayer set for the given test name.
func (r Map) ContainsRelayer(testName string, wallet ibc.Wallet) bool {
if relayerSet, ok := r[testName]; ok {
return relayerSet[wallet]
Expand Down
10 changes: 7 additions & 3 deletions e2e/sample.config.extended.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ chains:
binary: simd # override with CHAIN_BINARY

activeRelayer: hermes # override with RELAYER_ID

# relayers provides a list all possible relayers that will be usable within a test
# NOTE: the activeRelayer field, must match the id specified in one of the relayers in this list.
# if that is not the case, validation will fail.
relayers:
- id: hermes
image: ghcr.io/informalsystems/hermes
tag: "1.10.0"
tag: "1.10.0" # override with RELAYER_TAG
- id: rly
image: ghcr.io/cosmos/relayer
tag: "latest"
tag: "latest" # override with RELAYER_TAG
- id: hyperspace
image: ghcr.io/misko9/hyperspace
tag: "20231122v39"
tag: "20231122v39" # override with RELAYER_TAG

cometbft:
logLevel: info
Expand Down
14 changes: 1 addition & 13 deletions e2e/sample.config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# This file contains a bare minimum configuration for running e2e tests.

# | Environment Variable | Description | Default Value |
# |----------------------|-------------------------------------------|------------------------------|
# | CHAIN_IMAGE | The image that will be used for the chain | ghcr.io/cosmos/ibc-go-simd |
# | CHAIN_A_TAG | The tag used for chain A | N/A |
# | CHAIN_B_TAG | The tag used for chain B | N/A |
# | CHAIN_BINARY | The binary used in the container | simd |
# | RELAYER_TAG | The tag used for the relayer | 1.10.0 |
# | RELAYER_ID | The type of relayer to use (rly/hermes) | hermes |

# see sample.config.extended.yaml for a fully configured sample.
# set env E2E_CONFIG_PATH to point to this file to use it.

# for a more detailed configuration, see sample.config.extended.yaml.
---
chains:
- tag: main # override with CHAIN_A_TAG
Expand Down
14 changes: 0 additions & 14 deletions e2e/scripts/run-compatibility-tests.sh

This file was deleted.

2 changes: 2 additions & 0 deletions e2e/testsuite/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func SDKEncodingConfig() *testutil.TestEncodingConfig {
}
}

// codecAndEncodingConfig returns the codec and encoding config used in the E2E tests.
// Note: any new types added to the codec must be added here.
func codecAndEncodingConfig() (*codec.ProtoCodec, testutil.TestEncodingConfig) {
cfg := testutil.MakeTestEncodingConfig()

Expand Down
2 changes: 1 addition & 1 deletion e2e/testsuite/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ func newDefaultSimappConfig(cc ChainConfig, name, chainID, denom string, cometCf
configFileOverrides := make(map[string]any)
tmTomlOverrides := make(interchaintestutil.Toml)

tmTomlOverrides["log_level"] = cometCfg.LogLevel // change to debug in ~/.ibc-go-e2e-config.json to increase cometbft logging.
tmTomlOverrides["log_level"] = cometCfg.LogLevel // change to debug in the e2e test config to increase cometbft logging.
configFileOverrides["config/config.toml"] = tmTomlOverrides

return ibc.ChainConfig{
Expand Down
2 changes: 1 addition & 1 deletion e2e/testsuite/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
)

// BroadcastMessages broadcasts the provided messages to the given chain and signs them on behalf of the provided user.
// Once the broadcast response is returned, we wait for a few blocks to be created on both chain A and chain B.
// Once the broadcast response is returned, we wait for a few blocks to be created on the chain the message was broadcast to.
func (s *E2ETestSuite) BroadcastMessages(ctx context.Context, chain ibc.Chain, user ibc.Wallet, msgs ...sdk.Msg) sdk.TxResponse {
cosmosChain, ok := chain.(*cosmos.CosmosChain)
if !ok {
Expand Down

0 comments on commit a766bce

Please sign in to comment.