From 704e244782348be62c1c4cd228980832f59c080f Mon Sep 17 00:00:00 2001 From: Shon Feder Date: Mon, 15 Jun 2020 07:34:37 -0400 Subject: [PATCH] Add integration test pinned to tendermint-go v0.33.5 (#324) * Add integration test pinned to tendermint-go v0.33 Closes #304 Also renames test-integration-ignored to test-integration-latest. With this change, CI runs two integration tests: 1. A `stable` test to protect against regressions, run against a pinned version of the tendermint/tendermint docker image. 2. A `latest` test to track whether we're maintaining parity with the latest development version of tendermint-go. Signed-off-by: Shon Feder * Remove test for hardcoded ABCI version Hardcoding a test for the version in this way makes it impossible to run the integration tests against different ABCI versions. This change proposes one solution to address this problem and to the underlying issue behind, e.g., - #249 - #238 - #233 My sense is that, if we want to set a strict abci version requirement for the rpc client, then we should put that in the source code itself. E.g., we might put a check on the client that ensures the abci version is within a specified version range known to be supported. If the version is outside that range, we could either error out or log errors/warning to alert users that we don't guarantee compatibility. However, the current approach of hardcoding in a version in the integration test seems to create a lot of busy work due to uninformative test failures and it's not obvious what value it delivers. If the integration tests are meant to test that the RPC client integrates correctly with ACBI, should we really consider integration to have failed when everything works as expected while interfacing with an older (or newer) version? Signed-off-by: Shon Feder * Update changelog Signed-off-by: Shon Feder --- .github/workflows/rust.yml | 28 ++++++++++++++++++++++++++-- CHANGES.md | 3 ++- tendermint/tests/integration.rs | 1 - 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 531d07d6c..a8c622c53 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -61,11 +61,35 @@ jobs: command: test args: --all-features --no-fail-fast - test-integration-ignored: + # TODO(shonfeder): remove duplication once GitHub addresses one of these + # - https://github.community/t/support-for-yaml-anchors/16128/15 + # - https://github.community/t/reusing-sharing-inheriting-steps-between-jobs-declarations/16851/13 + # - https://github.community/t/using-matrix-variable-in-docker-image-name/17296 + test-integration-stable: runs-on: ubuntu-latest services: tendermint: - image: tendermint/tendermint + image: tendermint/tendermint:v0.33.5 + ports: + - 26656:26656 + - 26657:26657 + - 26660:26660 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + args: -p tendermint --test integration --no-fail-fast -- --ignored + + test-integration-latest: + runs-on: ubuntu-latest + services: + tendermint: + image: tendermint/tendermint:latest ports: - 26656:26656 - 26657:26657 diff --git a/CHANGES.md b/CHANGES.md index 0c55ca3a2..154eed96f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,7 +6,8 @@ CommitSig: - Added CommitSig timestamp zero-check compatibility code [#259](https://github.com/informalsystems/tendermint-rs/issues/259) Testing: -- Updated abci_info test to 0.17.0 ([#249](https://github.com/informalsystems/tendermint-rs/issues/249)) +- Add integration test to track tendermint-go v0.33.5 ([#324](https://github.com/informalsystems/tendermint-rs/pull/324)) +- Remove test for hard-coded version in `abci_info` ([#324](https://github.com/informalsystems/tendermint-rs/pull/324)) Serialization: - Refactor serializers library to use modules, give a nicer annotation to structs and separated into its own folder. ([#247](https://github.com/informalsystems/tendermint-rs/issues/247)) diff --git a/tendermint/tests/integration.rs b/tendermint/tests/integration.rs index bebb20211..80e587080 100644 --- a/tendermint/tests/integration.rs +++ b/tendermint/tests/integration.rs @@ -35,7 +35,6 @@ mod rpc { async fn abci_info() { let abci_info = localhost_rpc_client().abci_info().await.unwrap(); - assert_eq!(&abci_info.version, "0.17.0"); assert_eq!(abci_info.app_version, 1u64); // the kvstore app's reply will contain "{\"size\":0}" as data right from the start assert_eq!(&abci_info.data, "{\"size\":0}");