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

Support configuration file for e2e tests #3260

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e8e5760
support configuration file for e2e tests
chatton Mar 8, 2023
0d6ad85
return chain a tag if b tag is not specified
chatton Mar 8, 2023
1506784
apply env var overrides correctly
chatton Mar 8, 2023
cb5453b
correctly specify chain IDs
chatton Mar 8, 2023
2da60ba
chore: change tendermint logging to debug for e2e
colin-axner Mar 9, 2023
f8d3fd5
fix: correctly set override
colin-axner Mar 9, 2023
ffd1bc6
Merge branch 'main' into colin/e2e-logging
chatton Mar 10, 2023
5d981e8
adding script to init the config file
chatton Mar 10, 2023
0430410
cleaning up test config merging and fixing init script
chatton Mar 10, 2023
b6d433d
added upgrade configs to sample config
chatton Mar 10, 2023
3d64b25
remove upgrade plans
chatton Mar 10, 2023
5854ee1
added explicit environmental variable name requirement
chatton Mar 10, 2023
58994aa
merge main
chatton Mar 13, 2023
b29c48c
chore: change log level to info
colin-axner Mar 13, 2023
504aa0c
Merge branch 'colin/e2e-logging' of github.com:cosmos/ibc-go into col…
colin-axner Mar 13, 2023
1ce1e55
Merge branch 'main' into colin/e2e-logging
colin-axner Mar 13, 2023
b37861d
Merge branch 'main' into cian/issue#3254-add-support-for-config-file-…
chatton Mar 13, 2023
62ebe60
merge main
chatton Mar 14, 2023
c5ff4ae
cleaned up loading config from env
chatton Mar 14, 2023
2d1a8c7
update to use damiannolan/rly image
chatton Mar 14, 2023
b879999
make init run before e2e test
chatton Mar 14, 2023
69035aa
Merge branch 'colin/e2e-logging' into cian/issue#3254-add-support-for…
chatton Mar 14, 2023
fb99afc
add support for cometbft logging
chatton Mar 14, 2023
163bafa
Merge branch 'main' into cian/issue#3254-add-support-for-config-file-…
chatton Mar 14, 2023
6164983
merge main
chatton Mar 14, 2023
d6c1bd2
Merge branch 'main' into cian/issue#3254-add-support-for-config-file-…
chatton Mar 14, 2023
36ea3c1
changed structure to yaml to enable comments in the config file
chatton Mar 14, 2023
b2fb47e
changed tags to yaml
chatton Mar 14, 2023
a022e9f
Merge branch 'main' into cian/issue#3254-add-support-for-config-file-…
chatton Mar 14, 2023
99ccccc
cleaned up comment in config file
chatton Mar 14, 2023
46caa85
Merge branch 'cian/issue#3254-add-support-for-config-file-for-running…
chatton Mar 14, 2023
f188d36
added option to force dump logs
chatton Mar 14, 2023
0bee55f
Merge branch 'main' into cian/issue#3254-add-support-for-config-file-…
chatton Mar 14, 2023
5c0b820
fixed e2e readme
chatton Mar 14, 2023
03b11dc
correctly handle dumpLogs value
chatton Mar 15, 2023
960b594
Merge branch 'main' into cian/issue#3254-add-support-for-config-file-…
chatton Mar 15, 2023
d6d13df
merge main
chatton Mar 20, 2023
f1d5a0f
Merge branch 'main' into cian/issue#3254-add-support-for-config-file-…
chatton Mar 20, 2023
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
7 changes: 5 additions & 2 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ cleanup-ibc-test-containers:
$(DOCKER) rm $$id ; \
done

e2e-test: cleanup-ibc-test-containers
init:
./scripts/init.sh

e2e-test: init cleanup-ibc-test-containers
Copy link
Contributor Author

Choose a reason for hiding this comment

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

addition of init here means we shouldn't need to do anything to get the default config created.

./scripts/run-e2e.sh $(test) $(entrypoint)

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

.PHONY: cleanup-ibc-test-containers e2e-test compatibility-tests
.PHONY: cleanup-ibc-test-containers e2e-test compatibility-tests init
8 changes: 7 additions & 1 deletion e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ be quite common in most tests.

Tests can be run using a Makefile target under the e2e directory. `e2e/Makefile`

There are several envinronment variables that alter the behaviour of the make target.
The tests can be configured using a configuration file or environment variables.

See [the example](./sample.config.yaml) to get started. The default location the tests look is `~/.ibc-go-e2e-config.yaml`
But this can be specified directly using the `E2E_CONFIG_PATH` environment variable.

There are several environment variables that alter the behaviour of the make target which will override any
options specified in your config file.

| Environment Variable | Description | Default Value |
|----------------------|-------------------------------------------|---------------|
Expand Down
6 changes: 4 additions & 2 deletions e2e/relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ const (
// Config holds configuration values for the relayer used in the tests.
type Config struct {
// Tag is the tag used for the relayer image.
Tag string
Tag string `yaml:"tag"`
// Type specifies the type of relayer that this is.
Type string
Type string `yaml:"type"`
// Image is the image that should be used for the relayer.
Image string `yaml:"image"`
}

// New returns an implementation of ibc.Relayer depending on the provided RelayerType.
Expand Down
40 changes: 40 additions & 0 deletions e2e/sample.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This file contains configuration for running e2e tests.
# Many of these fields can be overridden with environment variables.
# All fields that support this have the corresponding environment variable name in a comment beside the field.

---
chains:
# the entry at index 0 corresponds to CHAIN_A
- chainId: chain-a
numValidators: 1
numFullNodes: 0
image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE
tag: main # override with CHAIN_A_TAG
binary: simd # override with CHAIN_BINARY

# the entry at index 1 corresponds to CHAIN_B
- chainId: chain-b
numValidators: 1
numFullNodes: 0
image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE
tag: main # override with CHAIN_B_TAG
binary: simd # override with CHAIN_BINARY

relayer:
type: rly # override with RELAYER_TYPE
image: damiannolan/rly
tag: latest # override with RELAYER_TAG

cometbft:
logLevel: info

debug:
# setting this value to true will force log collection even if the test passes.
dumpLogs: false

# Required only for upgrade tests.
# Chain A will be upgraded the specified tag.
# The plan name must be registered as an upgrade handler in the given tag.
upgrade:
planName: ""
tag: ""
20 changes: 20 additions & 0 deletions e2e/scripts/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

set -euo pipefail

# ensure_config_file makes sure there is a config file for the e2e tests either by creating a new one using the sample,
# it is copied to either the default location or the specified env location.
function ensure_config_file(){
local config_file_path="${HOME}/.ibc-go-e2e-config.yaml"
if [[ ! -z "${E2E_CONFIG_PATH:-}" ]]; then
config_file_path="${E2E_CONFIG_PATH}"
fi
if [[ ! -f "${config_file_path}" ]]; then
echo "creating e2e config file from sample."
echo "copying sample.config.yaml to ${config_file_path}"
cp sample.config.yaml "${config_file_path}"
fi
echo "using config file at ${config_file_path} for e2e test"
}

ensure_config_file
4 changes: 0 additions & 4 deletions e2e/scripts/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ set -eo pipefail
TEST="${1}"
ENTRY_POINT="${2:-}"

export CHAIN_A_TAG="${CHAIN_A_TAG:-main}"
export CHAIN_IMAGE="${CHAIN_IMAGE:-ghcr.io/cosmos/ibc-go-simd}"
export CHAIN_BINARY="${CHAIN_BINARY:-simd}"

# if jq is installed, we can automatically determine the test entrypoint.
if command -v jq > /dev/null; then
cd ..
Expand Down
Loading