Skip to content

Commit

Permalink
Perform integration test with ibc-go simapp on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
soareschen committed Mar 22, 2022
1 parent bc989c3 commit 8c2cffc
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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 8c2cffc

Please sign in to comment.