Repository navigation
cmake, test: Enable running individual functional tests - #226
Conversation
Create functional test symlinks.
ae2b782 to
4d0e0fd
Compare
|
Would it make sense to do the functional test framework changes on top of the autotools build system as well (before cmake), considering out-of-tree builds? |
|
cc @achow101 |
Well, creating a symlink for each functional test does not look trivial for |
| parser.add_argument("--noshutdown", dest="noshutdown", default=False, action="store_true", | ||
| help="Don't stop bitcoinds after the test execution") | ||
| parser.add_argument("--cachedir", dest="cachedir", default=os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + "/../../cache"), | ||
| parser.add_argument("--cachedir", dest="cachedir", default=os.path.abspath(os.path.dirname(test_file) + "/../../cache"), |
There was a problem hiding this comment.
Is this correct? Previously, the path was test/functional/test_framework/../../cache (aka test/cache), now it is test/functional/../../cache (aka cache).
Why not:
| parser.add_argument("--cachedir", dest="cachedir", default=os.path.abspath(os.path.dirname(test_file) + "/../../cache"), | |
| parser.add_argument("--cachedir", dest="cachedir", default=os.path.abspath(os.path.dirname(__file__) + "/../../cache"), |
There was a problem hiding this comment.
Is this correct?
It is (mostly; see the last paragraph of this comment).
now it is
test/functional/../../cache(akacache).
That is correct with a clarification. It is build_dir/cache, not source_dir/cache.
Why not:
Suggested change
parser.add_argument("--cachedir", dest="cachedir", default=os.path.abspath(os.path.dirname(test_file) + "/../../cache"), parser.add_argument("--cachedir", dest="cachedir", default=os.path.abspath(os.path.dirname(__file__) + "/../../cache"),
Using __file__ won't work because it ends in the source tree on POSIX systems. For more details, please refer to https://discuss.python.org/t/symlink-resolution-in-starting-script-path/36537.
Perhaps, one path level can be skipped:
| parser.add_argument("--cachedir", dest="cachedir", default=os.path.abspath(os.path.dirname(test_file) + "/../../cache"), | |
| parser.add_argument("--cachedir", dest="cachedir", default=os.path.abspath(os.path.dirname(test_file) + "/../cache"), |
which ends in the build_dir/test/cache path.
There was a problem hiding this comment.
Using
__file__won't work because it ends in the source tree on POSIX systems. For more details, please refer to https://discuss.python.org/t/symlink-resolution-in-starting-script-path/36537.
Ah, so the test framework changes could be split up into a separate pull against upstream master, because this affects all symlinks (whether created by cmake or not) on POSIX? I am just thinking how to split the massive cmake change into smaller blobs that can be landed/reviewed independently and in advance.
Perhaps, one path level can be skipped:
Yes, this is what I was trying to suggest. Previously the cache was in test/cache and now it should be as well, no?
There was a problem hiding this comment.
Perhaps, one path level can be skipped:
Yes, this is what I was trying to suggest. Previously the cache was in
test/cacheand now it should be as well, no?
Thanks! Done.
In CMake-based build system (1) `config.ini` is created in the build directory, and (2) `cache` must also be created in the same directory. This change enables running individual functional tests from the build directory.
|
post merge ACK Tested and every test file looks to be correctly symlinked. Also called each test file individually and all worked as expected. |
Resolves #146.
Done.
Done.
Works as expected now.