Skip to content

Commit

Permalink
fix: update daily test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Apr 25, 2022
1 parent 50e2812 commit ba3f219
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 36 deletions.
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions applications/daily_tests/automatic_recovery_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ async function run(options = {}) {
options.seedWords
);

await wallet.startNew();
await wallet.init();
await wallet.start();

let startTime = new Date();

Expand All @@ -91,7 +92,9 @@ async function run(options = {}) {
let recoveredAmount = 0;
if (recoveredAmountMatch[2] === "T") {
// convert to micro tari
recoveredAmount = round(parseFloat(recoveredAmountMatch[1]) * 1000000);
recoveredAmount = round(
parseFloat(recoveredAmountMatch[1]) * 1000000
);
} else {
recoveredAmount = parseInt(recoveredAmountMatch[1]);
}
Expand Down
17 changes: 9 additions & 8 deletions applications/daily_tests/automatic_sync_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const path = require("path");
const helpers = require("./helpers");
const BaseNodeProcess = require("integration_tests/helpers/baseNodeProcess");

const NETWORK = "DIBBLER";
const NETWORK = "dibbler";

const SyncType = {
Archival: "Archival",
Expand Down Expand Up @@ -59,12 +59,14 @@ async function run(options) {
const baseNode = new BaseNodeProcess("compile", true);
await baseNode.init();

// Bypass tor for outbound TCP (faster but less private)
process.env[`TARI_BASE_NODE__${NETWORK}__TOR_PROXY_BYPASS_FOR_OUTBOUND_TCP`] =
"true";
let config = {
// Bypass tor for outbound TCP (faster but less private)
[`${NETWORK}.base_node.p2p.transport.tor.proxy_bypass_for_outbound_tcp`]: true,
};

// Set pruning horizon in config file if `pruned` command line arg is present
if (options.syncType === SyncType.Pruned) {
process.env[`TARI_BASE_NODE__${NETWORK}__PRUNING_HORIZON`] = 20;
config[`${NETWORK}.base_node.storage.pruning_horizon`] = 20;
}

if (options.forceSyncPeer) {
Expand All @@ -73,11 +75,10 @@ async function run(options) {
forcedSyncPeersStr = options.forceSyncPeer.join(",");
}
console.log(`Force sync peer set to ${forcedSyncPeersStr}`);
process.env[`TARI_BASE_NODE__${NETWORK}__FORCE_SYNC_PEERS`] =
forcedSyncPeersStr;
config[`${NETWORK}.base_node.force_sync_peers`] = forcedSyncPeersStr;
}

await baseNode.start();
await baseNode.start({ network: NETWORK, config });

await fs.mkdir(path.dirname(options.log), { recursive: true });
let logfile = await fs.open(options.log, "w+");
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/features/support/wallet_cli_steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Then(
async function (name, is_not, password) {
let wallet = this.getWallet(name);
try {
await wallet.start(password);
await wallet.start({ password });
} catch (error) {
expect(error).to.equal(
is_not === "not" ? "Incorrect password" : undefined
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/features/support/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class CustomWorld {

async startNode(name, args) {
const node = this.seeds[name] || this.nodes[name];
await node.start(args);
await node.start({ args });
console.log("\n", name, "started\n");
}

Expand Down
10 changes: 6 additions & 4 deletions integration_tests/helpers/baseNodeProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,21 +252,23 @@ class BaseNodeProcess {
return await this.createGrpcClient();
}

async start(opts = []) {
async start(opts = {}) {
const args = [
"--non-interactive-mode",
"--watch",
"status",
"--base-path",
".",
"--network",
"localnet",
opts.network || "localnet",
];
if (this.logFilePath) {
args.push("--log-config", this.logFilePath);
}
args.concat(opts);
const overrides = this.getOverrides();
if (opts.args) {
args.concat(opts.args);
}
const overrides = Object.assign(this.getOverrides(), opts.config);
Object.keys(overrides).forEach((k) => {
args.push("-p");
args.push(`${k}=${overrides[k]}`);
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/helpers/walletProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,25 +213,25 @@ class WalletProcess {
});
}

async start(password) {
async start(opts = {}) {
const args = [
"--base-path",
".",
"--password",
`${password ? password : "kensentme"}`,
opts.password || "kensentme",
"--seed-words-file-name",
this.seedWordsFile,
"--non-interactive",
"--network",
"localnet",
opts.network || (this.options || {}).network || "localnet",
];
if (this.recoverWallet) {
args.push("--recover", "--seed-words", this.seedWords);
}
if (this.logFilePath) {
args.push("--log-config", this.logFilePath);
}
const overrides = this.getOverrides();
const overrides = Object.assign(this.getOverrides(), opts.config);
Object.keys(overrides).forEach((k) => {
args.push("-p");
args.push(`${k}=${overrides[k]}`);
Expand Down

0 comments on commit ba3f219

Please sign in to comment.