From 9ce3a9a62fa1b8dfe6baa667e546f933baef05dd Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 3 Mar 2022 23:03:06 +1000 Subject: [PATCH] fix(ci): check for adityapk00/lightwalletd behaviour in test harness (#3705) * fix(ci): remove an unused trigger path * doc(ci): explain lightwalletd trigger paths * fix(test): check for adityapk00/lightwalletd behaviour in test harness * fix(ci): work around buildx command error * fix(ci): revert the workaround --- .github/workflows/ci.yml | 1 - .github/workflows/zcash-lightwalletd.yml | 7 +++++++ zebrad/tests/acceptance.rs | 14 ++++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f85adc1f..e5d0845fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,6 @@ on: - '**/Cargo.lock' - '**/deny.toml' # workflow definitions - - 'docker/**' - '.github/workflows/ci.yml' env: diff --git a/.github/workflows/zcash-lightwalletd.yml b/.github/workflows/zcash-lightwalletd.yml index b00da49bf..c356f1bf9 100644 --- a/.github/workflows/zcash-lightwalletd.yml +++ b/.github/workflows/zcash-lightwalletd.yml @@ -6,10 +6,17 @@ on: branches: - 'main' paths: + # rebuild lightwalletd whenever the related Zebra code changes + # + # TODO: this code isn't compiled in this docker image + # rebuild whenever the actual code at adityapk00/lightwalletd/master changes - 'zebra-rpc/**' - 'zebrad/tests/acceptance.rs' - 'zebrad/src/config.rs' - 'zebrad/src/commands/start.rs' + # workflow definitions + # + # unlike the Zebra code, these workflow definitions do change the docker image - 'docker/zcash-lightwalletd/Dockerfile' - '.github/workflows/zcash-lightwalletd.yml' diff --git a/zebrad/tests/acceptance.rs b/zebrad/tests/acceptance.rs index 0b7a3abf4..616f2159f 100644 --- a/zebrad/tests/acceptance.rs +++ b/zebrad/tests/acceptance.rs @@ -1688,15 +1688,16 @@ fn lightwalletd_integration() -> Result<()> { // // TODO: update the missing method name when we add a new Zebra RPC - // Note: // zcash/lightwalletd calls getbestblockhash here, but // adityapk00/lightwalletd calls getblock let result = lightwalletd.expect_stdout_line_matches("Method not found.*error zcashd getblock rpc"); let (_, zebrad) = zebrad.kill_on_error(result)?; - let result = lightwalletd.expect_stdout_line_matches( - "Lightwalletd died with a Fatal error. Check logfile for details", - ); + + // zcash/lightwalletd exits with a fatal error here, but + // adityapk00/lightwalletd keeps trying the mempool + let result = + lightwalletd.expect_stdout_line_matches("Mempool refresh error: -32601: Method not found"); let (_, zebrad) = zebrad.kill_on_error(result)?; // Cleanup both processes @@ -1710,9 +1711,10 @@ fn lightwalletd_integration() -> Result<()> { // If the test fails here, see the [note on port conflict](#Note on port conflict) // - // TODO: change lightwalletd to `assert_was_killed` when enough RPCs are implemented + // zcash/lightwalletd exits by itself, but + // adityapk00/lightwalletd keeps on going, so it gets killed by the test harness. lightwalletd_output - .assert_was_not_killed() + .assert_was_killed() .wrap_err("Possible port conflict. Are there other acceptance tests running?")?; zebrad_output .assert_was_killed()