Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: auto update cucumber tests, reduced timeout #3418

Merged
merged 2 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions integration_tests/features/BaseNodeAutoUpdate.feature
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 0 additions & 3 deletions integration_tests/features/WalletAutoUpdate.feature
Original file line number Diff line number Diff line change
@@ -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
Expand Down
30 changes: 18 additions & 12 deletions integration_tests/features/support/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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;
}
);

Expand All @@ -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;
}
);

Expand Down
3 changes: 3 additions & 0 deletions integration_tests/helpers/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(",");
}
Expand Down
Binary file added meta/hashes.txt.bad.sig
Binary file not shown.