-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[test] functional: allow custom cwd, use tmpdir as default #15415
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
Conversation
|
I use this in #14912 in order to mock a hardware wallet. The functional first generates a signed PSBT which it writes to a file. The test node then calls a mock signer python script, which reads that file. The latter scripts gets it Perhaps the tmp root dir of the functional tests runner is a better choice? cc @jnewbery |
|
Why would you want to do this? Imo you can't rely a user is doing the same. I'd prefer to pass in the absulute paths from outside or specify with a flag that it should be run from relative to the datadir |
|
@MarcoFalke this only affects the test suite. The mock signer script I created isn't itself part of the test suite, so it has no idea where everything lives on the system. Note that the real thing (HWI) doesn't care where it's called from. It doesn't need to know where Bitcoin Core lives. |
Why? Is that a requirement? |
|
If you call that script from bitcoind, you might as well pass the datadir to the script? |
2fc2f3e to
3d323a6
Compare
|
@MarcoFalke that would involve something like this: That |
|
You can pass the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NACK, this should be added to the specific test that needs it, not globally
I don't want to modify the real world behaviour of |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
3d323a6 to
6496bc9
Compare
|
I simplified it: it now merely sets the default It's now actually a bug fix: try creating a directory |
6496bc9 to
9548f93
Compare
Please elaborate. this should not happen |
|
Before this PR the test suite would launch nodes with the self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" does not exist')
self.nodes[0].assert_start_raises_init_error(['-walletdir=wallets'], 'Error: Specified -walletdir "wallets" is a relative path', cwd=data_dir())
self.nodes[0].assert_start_raises_init_error(['-walletdir=debug.log'], 'Error: Specified -walletdir "debug.log" is not a directory', cwd=data_dir())That first test will fail if the directory you launch the test from contains a This PR fixes that by setting The existing behavior of |
9548f93 to
2cb2f54
Compare
|
utACK 2cb2f54 |
b828ff7 to
e3e1a56
Compare
|
@MarcoFalke I suppose you've retracted your NACK above? |
|
utACK e3e1a56 |
Yes, this is a bugfix as pointed out by @Sjors in an earlier comment |
…as default e3e1a56 [test] functional: set cwd of nodes to tmpdir (Sjors Provoost) Pull request description: Any process launched by bitcoind will have `self.datadir` as its `cwd`. Tree-SHA512: 0b311643bb96c7dc2f693774620173243b3add40bf373284695af2f0071823b23485289fd2ffe152b7f63e0bfe989b16720077cfc2ce33905f9b8e7f2630f3c0
|
utACK e3e1a56 |
…efault Summary: [test] functional: set cwd of nodes to tmpdir (Sjors Provoost) Pull request description: Any process launched by bitcoind will have `self.datadir` as its `cwd`. bitcoin/bitcoin@e3e1a56 --- Depends on D7080 Backport of Core [[bitcoin/bitcoin#15415 | PR15415]] Test Plan: ninja test_runner.py Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7081
Any process launched by bitcoind will have
self.datadiras itscwd.