Skip to content

Commit

Permalink
try to fix the indentity file problem in circleci
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnaveira committed Jun 23, 2022
1 parent 8585858 commit 0c53e79
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
4 changes: 1 addition & 3 deletions integration_tests/features/ValidatorNode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ Feature: Validator Node
And I create 40 NFTs
And I mine 3 blocks

# Broken: needs a contract definition before publishing acceptance, however this is currently not easily done because
# GRPC methods need to be added and you cannot use the cli for a wallet while that wallet is already running
@dan @critical @broken
@dan @critical
Scenario: Publish contract acceptance
Given I have a seed node NODE1
And I have wallet WALLET1 connected to all seed nodes
Expand Down
24 changes: 20 additions & 4 deletions integration_tests/helpers/validatorNodeProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ValidatorNodeProcess {
this.port = await getFreePort();
this.grpcPort = await getFreePort();
this.name = `ValidatorNode${this.port}-${this.name}`;
this.nodeFile = this.nodeFile || "nodeid.json";
this.nodeFile = this.nodeFile || "validator_node_id.json";

let instance = 0;
do {
Expand Down Expand Up @@ -163,16 +163,32 @@ class ValidatorNodeProcess {
fs.mkdirSync(this.baseDir + "/log", { recursive: true });
}

// to avoid writing permission errors, we copy the reference identity file to the temp folder
let identity_file_name = "validator_node_id.json";
let identity_source_path = path.resolve(
`./fixtures/${identity_file_name}`
);
let identity_destination_path = path.resolve(
`${this.baseDir}/${identity_file_name}`
);
fs.copyFile(identity_source_path, identity_destination_path, (err) => {
if (err) {
console.log(
"Error Found while copying validator identity file to temp folder: ",
err
);
throw err;
}
console.log("Validator identity file was copied to destination");
});

let envs = [];
if (!this.excludeTestEnvars) {
envs = this.getOverrides();
}

let customArgs = {
"validator_node.p2p.transport.type": "tcp",
"validator_node.identity_file": path.resolve(
"./fixtures/validator_node_id.json"
),
};
if (this.baseNodeAddress) {
customArgs["validator_node.base_node_grpc_address"] =
Expand Down

0 comments on commit 0c53e79

Please sign in to comment.