From 8c2cffc0d377b3487f9339717ca2ba2e18ae19e9 Mon Sep 17 00:00:00 2001 From: Soares Chen Date: Tue, 22 Mar 2022 16:32:08 +0100 Subject: [PATCH 1/5] Perform integration test with ibc-go simapp on CI --- .github/workflows/integration.yaml | 36 +++++++++++++++++++++++ tools/test-framework/src/chain/driver.rs | 14 ++++++--- tools/test-framework/src/chain/version.rs | 6 ++-- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 7414f50fb4..c336aa0960 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -75,6 +75,42 @@ jobs: test -p ibc-integration-test --no-fail-fast -- \ --nocapture + ibc-go-integration-test: + runs-on: ubuntu-latest + strategy: + matrix: + ibc-go-version: + - v2 + - v3 + steps: + - uses: actions/checkout@v2 + - uses: cachix/install-nix-action@v15 + with: + install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install + install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' + extra_nix_config: | + experimental-features = nix-command flakes + - uses: cachix/cachix-action@v10 + with: + name: cosmos + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: test + args: -p ibc-integration-test --no-fail-fast --no-run + - env: + RUST_LOG: info + RUST_BACKTRACE: 1 + CHAIN_COMMAND_PATH: simd + run: | + nix shell github:informalsystems/cosmos.nix/soares/ibc-go-simapp#ibc-go-${{ matrix.ibc-go-version }}-simapp -c cargo \ + test -p ibc-integration-test --no-fail-fast -- \ + --nocapture + ordered-channel-test: runs-on: ubuntu-latest steps: diff --git a/tools/test-framework/src/chain/driver.rs b/tools/test-framework/src/chain/driver.rs index 71b191afdd..e193f88539 100644 --- a/tools/test-framework/src/chain/driver.rs +++ b/tools/test-framework/src/chain/driver.rs @@ -58,7 +58,7 @@ pub struct ChainDriver { */ pub command_path: String, - pub command_version: Version, + pub command_version: Option, /** The ID of the chain. @@ -110,8 +110,7 @@ impl ChainDriver { ) -> Result { // Assume we're on Gaia 6 if we can't get a version // (eg. with `icad`, which returns an empty string). - let command_version = - get_chain_command_version(&command_path).unwrap_or_else(|_| Version::new(6, 0, 0)); + let command_version = get_chain_command_version(&command_path)?; Ok(Self { command_path, @@ -382,6 +381,13 @@ impl ChainDriver { Ok(()) } + pub fn is_v6_or_later(&self) -> bool { + match &self.command_version { + Some(version) => version.major >= 6, + None => true, + } + } + /** Start a full node by running in the background `gaiad start`. @@ -408,7 +414,7 @@ impl ChainDriver { &format!("localhost:{}", self.grpc_web_port), ]; - let args: Vec<&str> = if self.command_version.major >= 6 { + let args: Vec<&str> = if self.is_v6_or_later() { let mut list = base_args.to_vec(); list.extend_from_slice(&extra_args); list diff --git a/tools/test-framework/src/chain/version.rs b/tools/test-framework/src/chain/version.rs index eba4cb2d53..2119c4ed14 100644 --- a/tools/test-framework/src/chain/version.rs +++ b/tools/test-framework/src/chain/version.rs @@ -4,7 +4,7 @@ use tracing::debug; use crate::chain::exec::simple_exec; use crate::error::{handle_generic_error, Error}; -pub fn get_chain_command_version(command: &str) -> Result { +pub fn get_chain_command_version(command: &str) -> Result, Error> { let output = simple_exec("version-command", command, &["version"])?; // gaia6 somehow outputs version string result in STDERR @@ -21,7 +21,9 @@ pub fn get_chain_command_version(command: &str) -> Result { debug!("parsing version string: {}", version_str); - let version = Version::parse(version_str).map_err(handle_generic_error)?; + let version = Version::parse(version_str) + .map_err(handle_generic_error) + .ok(); Ok(version) } From 8edf458820fb514d3c2bf35189c79db7f6546eb3 Mon Sep 17 00:00:00 2001 From: Soares Chen Date: Tue, 22 Mar 2022 19:43:44 +0100 Subject: [PATCH 2/5] Add ibc-go-ics29-simapp --- .github/workflows/integration.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index c336aa0960..db07666b5b 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -79,9 +79,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ibc-go-version: - - v2 - - v3 + simapp: + - ibc-go-v2-simapp + - ibc-go-v3-simapp + - ibc-go-ics29-simapp steps: - uses: actions/checkout@v2 - uses: cachix/install-nix-action@v15 @@ -107,7 +108,7 @@ jobs: RUST_BACKTRACE: 1 CHAIN_COMMAND_PATH: simd run: | - nix shell github:informalsystems/cosmos.nix/soares/ibc-go-simapp#ibc-go-${{ matrix.ibc-go-version }}-simapp -c cargo \ + nix shell github:informalsystems/cosmos.nix/soares/ibc-go-simapp#${{ matrix.simapp }} -c cargo \ test -p ibc-integration-test --no-fail-fast -- \ --nocapture From f87f0d61bcbbc3ea5617e1d40ca52438ad241a49 Mon Sep 17 00:00:00 2001 From: Soares Chen Date: Tue, 22 Mar 2022 20:34:12 +0100 Subject: [PATCH 3/5] Bump --- .github/workflows/integration.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index db07666b5b..1addcb3bdd 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -109,8 +109,7 @@ jobs: CHAIN_COMMAND_PATH: simd run: | nix shell github:informalsystems/cosmos.nix/soares/ibc-go-simapp#${{ matrix.simapp }} -c cargo \ - test -p ibc-integration-test --no-fail-fast -- \ - --nocapture + test -p ibc-integration-test --no-fail-fast -- --nocapture ordered-channel-test: runs-on: ubuntu-latest From d7450e41864d64fb545fdc7194219b005e159ba9 Mon Sep 17 00:00:00 2001 From: Soares Chen Date: Wed, 23 Mar 2022 10:30:30 +0100 Subject: [PATCH 4/5] Use Cosmos.nix master, remove gaia4 EOL --- .github/workflows/integration.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 1addcb3bdd..89bfbb8e72 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -44,7 +44,6 @@ jobs: strategy: matrix: gaiad: - - gaia4 - gaia5 - gaia6 steps: @@ -108,7 +107,7 @@ jobs: RUST_BACKTRACE: 1 CHAIN_COMMAND_PATH: simd run: | - nix shell github:informalsystems/cosmos.nix/soares/ibc-go-simapp#${{ matrix.simapp }} -c cargo \ + nix shell github:informalsystems/cosmos.nix#${{ matrix.simapp }} -c cargo \ test -p ibc-integration-test --no-fail-fast -- --nocapture ordered-channel-test: From ab08978710c9ae3e32415b2628148ec1dbc194a8 Mon Sep 17 00:00:00 2001 From: Soares Chen Date: Wed, 23 Mar 2022 12:32:16 +0100 Subject: [PATCH 5/5] Use gaia6-ordered from master --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 89bfbb8e72..7b03a6c061 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -136,7 +136,7 @@ jobs: RUST_LOG: info RUST_BACKTRACE: 1 run: | - nix shell github:informalsystems/cosmos.nix/gaia-ordered#gaia6-ordered -c cargo \ + nix shell github:informalsystems/cosmos.nix#gaia6-ordered -c cargo \ test -p ibc-integration-test --features ordered --no-fail-fast -- \ --nocapture --test-threads=1 test_ordered_channel