Skip to content

Commit

Permalink
Perform integration test with ibc-go simapp on CI (#1996)
Browse files Browse the repository at this point in the history
* Perform integration test with ibc-go simapp on CI

* Add ibc-go-ics29-simapp

* Bump

* Use Cosmos.nix master, remove gaia4 EOL

* Use gaia6-ordered from master
  • Loading branch information
soareschen authored Mar 23, 2022
1 parent 43e5ccf commit 20e5fe6
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
strategy:
matrix:
gaiad:
- gaia4
- gaia5
- gaia6
steps:
Expand Down Expand Up @@ -75,6 +74,42 @@ jobs:
test -p ibc-integration-test --no-fail-fast -- \
--nocapture
ibc-go-integration-test:
runs-on: ubuntu-latest
strategy:
matrix:
simapp:
- ibc-go-v2-simapp
- ibc-go-v3-simapp
- ibc-go-ics29-simapp
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#${{ matrix.simapp }} -c cargo \
test -p ibc-integration-test --no-fail-fast -- --nocapture
ordered-channel-test:
runs-on: ubuntu-latest
steps:
Expand All @@ -101,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
Expand Down
14 changes: 10 additions & 4 deletions tools/test-framework/src/chain/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct ChainDriver {
*/
pub command_path: String,

pub command_version: Version,
pub command_version: Option<Version>,

/**
The ID of the chain.
Expand Down Expand Up @@ -110,8 +110,7 @@ impl ChainDriver {
) -> Result<Self, Error> {
// 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,
Expand Down Expand Up @@ -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`.
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tools/test-framework/src/chain/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Version, Error> {
pub fn get_chain_command_version(command: &str) -> Result<Option<Version>, Error> {
let output = simple_exec("version-command", command, &["version"])?;

// gaia6 somehow outputs version string result in STDERR
Expand All @@ -21,7 +21,9 @@ pub fn get_chain_command_version(command: &str) -> Result<Version, Error> {

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)
}

0 comments on commit 20e5fe6

Please sign in to comment.