From ce17627ab0a6a6e4cbc3ea8d0e3532256f22d81a Mon Sep 17 00:00:00 2001 From: Impala123 <91881574+Impala123@users.noreply.github.com> Date: Tue, 5 Oct 2021 20:33:37 +0200 Subject: [PATCH] fix: auto update cucumber tests, reduced timeout (#3418) Description --- This fixes issues with the auto update tests. Motivation and Context --- Make it work How Has This Been Tested? --- Using cucumber. I did add a string to the dns.rs query_txt() result to actually test, since I can't modify DNS TEXT records... push "base-node:macos-aarch64:99.8.12:6e77da12535e0ed7851761ae6c6729f2dd3ae8050840e8c08e10e279dadfde8a" maybe would could add the macos-aarch64 to the DNS record? --- .../features/BaseNodeAutoUpdate.feature | 3 -- .../features/WalletAutoUpdate.feature | 3 -- integration_tests/features/support/steps.js | 30 +++++++++++------- integration_tests/helpers/config.js | 3 ++ meta/hashes.txt.bad.sig | Bin 0 -> 1001 bytes 5 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 meta/hashes.txt.bad.sig diff --git a/integration_tests/features/BaseNodeAutoUpdate.feature b/integration_tests/features/BaseNodeAutoUpdate.feature index 02b5a2dd45..d5807462cc 100644 --- a/integration_tests/features/BaseNodeAutoUpdate.feature +++ b/integration_tests/features/BaseNodeAutoUpdate.feature @@ -1,13 +1,10 @@ @auto_update Feature: AutoUpdate - # Not sure why this takes so long on CI - @long-running @broken Scenario: Auto update finds a new update on base node Given I have a node NODE_A with auto update enabled Then NODE_A has a new software update - @broken Scenario: Auto update ignores update with invalid signature on base node Given I have a node NODE_A with auto update configured with a bad signature And I wait 10 seconds diff --git a/integration_tests/features/WalletAutoUpdate.feature b/integration_tests/features/WalletAutoUpdate.feature index 4967d2ffbc..58ff8f8d46 100644 --- a/integration_tests/features/WalletAutoUpdate.feature +++ b/integration_tests/features/WalletAutoUpdate.feature @@ -1,13 +1,10 @@ @auto_update Feature: AutoUpdate - # Not sure why this takes so long on CI - @long-running @broken Scenario: Auto update finds a new update on wallet Given I have a wallet WALLET with auto update enabled Then WALLET has a new software update - @broken Scenario: Auto update ignores update with invalid signature on wallet Given I have a wallet WALLET with auto update configured with a bad signature And I wait 10 seconds diff --git a/integration_tests/features/support/steps.js b/integration_tests/features/support/steps.js index 9dccf054d8..2a7b2f6777 100644 --- a/integration_tests/features/support/steps.js +++ b/integration_tests/features/support/steps.js @@ -21,11 +21,11 @@ const TransactionBuilder = require("../../helpers/transactionBuilder"); let lastResult; const AUTOUPDATE_HASHES_TXT_URL = - "https://raw.githubusercontent.com/sdbondi/tari/autoupdate-test-branch/meta/hashes.txt"; + "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt"; const AUTOUPDATE_HASHES_TXT_SIG_URL = - "https://github.com/sdbondi/tari/raw/autoupdate-test-branch/meta/good.sig"; + "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt.sig"; const AUTOUPDATE_HASHES_TXT_BAD_SIG_URL = - "https://github.com/sdbondi/tari/raw/autoupdate-test-branch/meta/bad.sig"; + "https://raw.githubusercontent.com/tari-project/tari/development/meta/hashes.txt.bad.sig"; Given(/I have a seed node (.*)/, { timeout: 20 * 1000 }, async function (name) { return await this.createSeedNode(name); @@ -91,6 +91,7 @@ Given( const node = await this.createNode(name, { common: { auto_update: { + check_interval: 10, enabled: true, dns_hosts: ["_test_autoupdate.tari.io"], hashes_url: AUTOUPDATE_HASHES_TXT_URL, @@ -110,6 +111,7 @@ Given( const node = await this.createNode(name, { common: { auto_update: { + check_interval: 10, enabled: true, dns_hosts: ["_test_autoupdate.tari.io"], hashes_url: AUTOUPDATE_HASHES_TXT_URL, @@ -129,6 +131,7 @@ Given( await this.createAndAddWallet(name, "", { common: { auto_update: { + check_interval: 10, enabled: true, dns_hosts: ["_test_autoupdate.tari.io"], hashes_url: AUTOUPDATE_HASHES_TXT_URL, @@ -146,6 +149,7 @@ Given( await this.createAndAddWallet(name, "", { common: { auto_update: { + check_interval: 10, enabled: true, dns_hosts: ["_test_autoupdate.tari.io"], hashes_url: AUTOUPDATE_HASHES_TXT_URL, @@ -970,12 +974,14 @@ Then( let client = await this.getNodeOrWalletClient(name); await sleep(5000); await waitFor( - async () => client.checkForUpdates().has_update, + async () => (await client.checkForUpdates()).has_update, false, 60 * 1000 ); - expect(client.checkForUpdates().has_update, "There should be no update").to - .be.false; + expect( + (await client.checkForUpdates()).has_update, + "There should be no update" + ).to.be.false; } ); @@ -985,14 +991,14 @@ Then( async function (name) { let client = await this.getNodeOrWalletClient(name); await waitFor( - async () => { - return client.checkForUpdates().has_update; - }, + async () => (await client.checkForUpdates()).has_update, true, - 1150 * 1000 + 60 * 1000 ); - expect(client.checkForUpdates().has_update, "There should be update").to.be - .true; + expect( + (await client.checkForUpdates()).has_update, + "There should be update" + ).to.be.true; } ); diff --git a/integration_tests/helpers/config.js b/integration_tests/helpers/config.js index ef06a75449..200fac6fbb 100644 --- a/integration_tests/helpers/config.js +++ b/integration_tests/helpers/config.js @@ -44,6 +44,9 @@ function mapEnvs(options) { ? "true" : "false"; } + if (auto_update.check_interval) { + res.TARI_COMMON__AUTO_UPDATE__CHECK_INTERVAL = auto_update.check_interval; + } if (auto_update.dns_hosts) { res.TARI_COMMON__AUTO_UPDATE__DNS_HOSTS = auto_update.dns_hosts.join(","); } diff --git a/meta/hashes.txt.bad.sig b/meta/hashes.txt.bad.sig new file mode 100644 index 0000000000000000000000000000000000000000..8dbfb087bf8da017adf3b528f66d61f60ee51640 GIT binary patch literal 1001 zcmYjPO-~b16rCA{wk)OvtU&n?s#R!g0b9BNBtt8$0+k9Pg<3=bgQlhmMXVv#jSDp< z?%bIe7rJ6)OxQGRjE02^-KY!QnV7iXFL+MwWMXpeIp^LtGw;s3?_jU0MRi4WDIHCI zJ-U6cSGA!%u&SLC631^WFl=wT?+B(*SP|H*Ypz%!%S zIy-SjZeJ_f*&CqIrv$(z61vT?mk_Gusy&b z5()dw@X$CCV;Gc+NZH^Ys^Y-~#4S6UZ-?zknNlc5R$$m#w-40J#%u)c*_K^w*x9dL z4}6MkUq*1dkYch08x3$>)5pL!Pk|B+7Us^4f`Rg48XVk;#Tq`pm(tI7&?r9#3?eko z*GG_Y`s0hx9E{EbbNzn)Hm!1ZAc@e#`Z+Jd3%W87>XRzibPZ1CqcEqXv{2#b^j6LR z$j-(~N6ofGkb?>)+(#hR=x61LMaY>zD|oq&6Id=T$bxm)Cwe3WcUXI514!2FGE930 zw0;)EV-O@noSqsO^)6^LJTxiAmEJLLjX5ES@Gx&D8xSOGq1K6a<~YDhf8M-=w0T;1 zlYmYUup9AVN3HPnlZY7v!13NeSeq_!_*x3Ij_8f^>pb|2h5S@z6Xx415HQfVVVyxU zGJY`U{85cVIX8iuf6TkZD*%j@K0TZAZNpic=cgwIVzLHKvNiV6h_J>BcOL<;(HKv! L%X---^?u_Y?e=g^ literal 0 HcmV?d00001