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: update daily test configuration #4049

Merged
merged 6 commits into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion applications/daily_tests/automatic_recovery_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ async function run(options = {}) {
let recoveredAmount = 0;
if (recoveredAmountMatch[2] === "T") {
// convert to micro tari
recoveredAmount = round(parseFloat(recoveredAmountMatch[1]) * 1000000);
recoveredAmount = Math.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
4 changes: 2 additions & 2 deletions base_layer/wallet/tests/transaction_service_tests/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ fn manage_single_transaction() {
.block_on(alice_ts.send_transaction(
bob_node_identity.public_key().clone(),
value,
MicroTari::from(20),
MicroTari::from(4),
"".to_string()
))
.is_err());
Expand All @@ -557,7 +557,7 @@ fn manage_single_transaction() {
.block_on(alice_ts.send_transaction(
bob_node_identity.public_key().clone(),
value,
MicroTari::from(20),
MicroTari::from(4),
message,
))
.expect("Alice sending tx");
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