-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applies multinodessuite in twonodessuite (#1031)
* Sets timeout for codexclient httpClient. Adds reliable transfer test. * disable new test to check timeout setting in CI * restores new test * adds heartbeat log and logfile to ci output * fixes suite * fixes blocked output stream by switching to multinode fixture * new twonodessuite based on multinodesuite * Applies updated twonodessuite * removes heartbeat log * applies multinodesuite in testsales * applies multinodesuite in testmarketplace * fixes account fetch for host and client in testmarketplace * adds waitTillNextPeriod at end of marketplace test * Uses marketplacesuite in testmarketplace
- Loading branch information
1 parent
c498e2f
commit 20bb5e5
Showing
12 changed files
with
199 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,66 @@ | ||
import std/unittest | ||
import std/tempfiles | ||
import codex/conf | ||
import codex/utils/fileutils | ||
import ./nodes | ||
import ../asynctest | ||
import ../checktest | ||
import ./codexprocess | ||
import ./nodeprocess | ||
import ../examples | ||
|
||
suite "Command line interface": | ||
asyncchecksuite "Command line interface": | ||
|
||
let key = "4242424242424242424242424242424242424242424242424242424242424242" | ||
|
||
proc startCodex(args: seq[string]): Future[CodexProcess] {.async.} = | ||
return await CodexProcess.startNode( | ||
args, | ||
false, | ||
"cli-test-node" | ||
) | ||
|
||
test "complains when persistence is enabled without ethereum account": | ||
let node = startNode(@[ | ||
let node = await startCodex(@[ | ||
"persistence" | ||
]) | ||
node.waitUntilOutput("Persistence enabled, but no Ethereum account was set") | ||
node.stop() | ||
await node.waitUntilOutput("Persistence enabled, but no Ethereum account was set") | ||
await node.stop() | ||
|
||
test "complains when ethereum private key file has wrong permissions": | ||
let unsafeKeyFile = genTempPath("", "") | ||
discard unsafeKeyFile.writeFile(key, 0o666) | ||
let node = startNode(@[ | ||
let node = await startCodex(@[ | ||
"persistence", | ||
"--eth-private-key=" & unsafeKeyFile]) | ||
node.waitUntilOutput("Ethereum private key file does not have safe file permissions") | ||
node.stop() | ||
await node.waitUntilOutput("Ethereum private key file does not have safe file permissions") | ||
await node.stop() | ||
discard removeFile(unsafeKeyFile) | ||
|
||
let | ||
marketplaceArg = "--marketplace-address=" & $EthAddress.example | ||
expectedDownloadInstruction = "Proving circuit files are not found. Please run the following to download them:" | ||
|
||
test "suggests downloading of circuit files when persistence is enabled without accessible r1cs file": | ||
let node = startNode(@["persistence", "prover", marketplaceArg]) | ||
node.waitUntilOutput(expectedDownloadInstruction) | ||
node.stop() | ||
let node = await startCodex(@["persistence", "prover", marketplaceArg]) | ||
await node.waitUntilOutput(expectedDownloadInstruction) | ||
await node.stop() | ||
|
||
test "suggests downloading of circuit files when persistence is enabled without accessible wasm file": | ||
let node = startNode(@[ | ||
let node = await startCodex(@[ | ||
"persistence", | ||
"prover", | ||
marketplaceArg, | ||
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs" | ||
]) | ||
node.waitUntilOutput(expectedDownloadInstruction) | ||
node.stop() | ||
await node.waitUntilOutput(expectedDownloadInstruction) | ||
await node.stop() | ||
|
||
test "suggests downloading of circuit files when persistence is enabled without accessible zkey file": | ||
let node = startNode(@[ | ||
let node = await startCodex(@[ | ||
"persistence", | ||
"prover", | ||
marketplaceArg, | ||
"--circom-r1cs=tests/circuits/fixtures/proof_main.r1cs", | ||
"--circom-wasm=tests/circuits/fixtures/proof_main.wasm" | ||
]) | ||
node.waitUntilOutput(expectedDownloadInstruction) | ||
node.stop() | ||
await node.waitUntilOutput(expectedDownloadInstruction) | ||
await node.stop() |
Oops, something went wrong.