Skip to content

Conversation

@pinheadmz
Copy link
Member

The cmake build system creates a build/ directory and writes config.ini there, along with a tree of symlinks to test_framework and all the individual test files. This symlink breaks the fix in #30714 which resolved those symlinks, causing the TestShell to initialize in the original test directory, where config.ini does not exist.

The fix in this patch is simply not to resolve the symlinks, so TestShell uses:

  • /path/to/bitcoin/build/test/config.ini
  • /path/to/bitcoin/build/test/cache

Note that any arguments like configfile and cachedir that are passed to setup() will be too late to work around the issue since the constructor TestShell() is invoked with a file path first and that path determines config file and cache location.

Test script:

#!/usr/bin/env python3

# USAGE: shell.py /path/to/bitcoin/repo

from pathlib import Path
import sys
REPO = Path(sys.argv.pop())
sys.path.insert(0, f"{REPO / 'build' / 'test' / 'functional'}")
from test_framework.test_shell import TestShell

TestShell().setup(num_nodes=1, setup_clean_chain=True)
TestShell().shutdown()

Fails on master:

FileNotFoundError: [Errno 2] No such file or directory: '/Users/matthewzipkin/Desktop/work/bitcoin/test/config.ini'

@pinheadmz pinheadmz requested a review from theStack December 16, 2024 16:37
@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 16, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31510.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@DrahtBot DrahtBot added the Tests label Dec 16, 2024
@pinheadmz
Copy link
Member Author

whoops just found #31415 closing this as duplicate

@pinheadmz pinheadmz closed this Dec 16, 2024
@bitcoin bitcoin locked and limited conversation to collaborators Dec 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants