Skip to content

Conversation

@davidgumberg
Copy link

@davidgumberg davidgumberg commented Nov 12, 2025

Bumps the included test framework to Bitcoin Core 30.0, and update example scenarios. Presently, bumping and fixing the tests happen in separate commits for ease of review, but I'm happy to squash if commits being atomic is preferred.

This PR also includes an unrelated change I found helpful: Enabling CI tests on all branches so contributors to warnet will have CI run on their branches without having to open a PR against main.

Opening as a draft as this is still failing CI at the moment.

@davidgumberg davidgumberg marked this pull request as draft November 12, 2025 19:18
Copy link
Contributor

@pinheadmz pinheadmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concept ACK, did quick review in the browser. I'll dig in to the CI failures next.
THANKS!


def main():
LNInit().main()
LNInit(__file__).main()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding this to every scenario, and since we don't use the value anyway, why not just add a dummy to Commander constructor:

class Commander(BitcoinTestFramework):
    def __init__(self):
        super().__init__(__file__) # or None

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that's much better, I've taken this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: Ah, I've just remembered why I did it this way: https://github.com/bitcoin/bitcoin/blob/v30.0/test/functional/test_framework/test_framework.py#L134-L136:

class BitcoinTestMetaClass(type):
    """Metaclass for BitcoinTestFramework.

    Ensures that any attempt to register a subclass of `BitcoinTestFramework`
    adheres to a standard whereby the subclass overrides `set_test_params` and
    `run_test` but DOES NOT override either `__init__` or `main`. If any of
    those standards are violated, a ``TypeError`` is raised."""

    def __new__(cls, clsname, bases, dct):
        if not clsname == 'BitcoinTestFramework':
            if '__init__' in dct or 'main' in dct:
                raise TypeError("BitcoinTestFramework subclasses may not override "
                                "'__init__' or 'main'")

Can be reproduced or verified as follows:

```bash
git clone [email protected]:bitcoin/bitcoin.git --depth 1 --branch 30.x tmp
rm -rf resources/scenarios/test_framework/
mv tmp/test/functional/test_framework/ resources/scenarios/
rm -rf tmp
```
@davidgumberg davidgumberg force-pushed the 2025-10-28-update_test_framework branch 3 times, most recently from 88acd58 to b2127dc Compare November 12, 2025 22:22
The repetitive part of this diff can reproduced with:

```bash
sed -i -e 's/\s*().main\s*()/("").main()/' $(git ls-files 'resources/*.py')
```

Which mostly comes from this scripted diff from bitcoin/bitcoin:
bitcoin/bitcoin@a047344
@davidgumberg davidgumberg force-pushed the 2025-10-28-update_test_framework branch from b2127dc to 6fde7ae Compare November 13, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants