Skip to content

Commit

Permalink
fix(lnprototest): removing the dummy runner
Browse files Browse the repository at this point in the history
This commit remove the dummy runner because it is starting to be painful
to keep supporting it with the addition of feature.

For historical reason I think the dummy runner was used to check the
logic of the lnprototest, but with the refactoring that we are doing.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
  • Loading branch information
vincenzopalazzo committed Nov 11, 2024
1 parent ff7fc08 commit 381f3b9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 225 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ POSSIBLE_PYTEST_NAMES=pytest-3 pytest3 pytest
PYTEST := $(shell for p in $(POSSIBLE_PYTEST_NAMES); do if type $$p > /dev/null; then echo $$p; break; fi done)
TEST_DIR=tests

default: check-source check check-quotes
# We disable the default target for the moment because we
# need to fix pytest
# default: check-source check check-quotes
default: fmt check

check-pytest-found:
@if [ -z "$(PYTEST)" ]; then echo "Cannot find any pytest: $(POSSIBLE_PYTEST_NAMES)" >&2; exit 1; fi
Expand Down
1 change: 0 additions & 1 deletion lnprototest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
remote_funding_pubkey,
remote_funding_privkey,
)
from .dummyrunner import DummyRunner
from .namespace import (
peer_message_namespace,
namespace,
Expand Down
221 changes: 0 additions & 221 deletions lnprototest/dummyrunner.py

This file was deleted.

9 changes: 7 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#! /usr/bin/python3
import pytest
import importlib

import lnprototest
import pyln.spec.bolt1
import pyln.spec.bolt2
import pyln.spec.bolt7
from pyln.proto.message import MessageNamespace

from typing import Any, Callable, Generator, List


Expand All @@ -14,7 +15,6 @@ def pytest_addoption(parser: Any) -> None:
"--runner",
action="store",
help="runner to use",
default="lnprototest.DummyRunner",
)
parser.addoption(
"--runner-args",
Expand All @@ -26,6 +26,11 @@ def pytest_addoption(parser: Any) -> None:

@pytest.fixture() # type: ignore
def runner(pytestconfig: Any) -> Any:
runner_opt = pytestconfig.getoption("runner")
if runner_opt is None:
pytest.skip(
"Runner need to be specified eg. `make check PYTEST_ARGS='--runner=lnprototest.clightning.Runner'`"
)
parts = pytestconfig.getoption("runner").rpartition(".")
runner = importlib.import_module(parts[0]).__dict__[parts[2]](pytestconfig)
yield runner
Expand Down

0 comments on commit 381f3b9

Please sign in to comment.