pytest: Mark some tests as skippable that are too bitcoin-specific

This commit is contained in:
Christian Decker 2019-09-18 21:55:41 +02:00 committed by Rusty Russell
parent 181764b12d
commit e23d8a4aff
6 changed files with 15 additions and 3 deletions

View File

@ -134,6 +134,7 @@ def test_bad_opening(node_factory):
@unittest.skipIf(not DEVELOPER, "gossip without DEVELOPER=1 is slow") @unittest.skipIf(not DEVELOPER, "gossip without DEVELOPER=1 is slow")
@unittest.skipIf(TEST_NETWORK != 'regtest', "Fee computation and limits are network specific")
def test_opening_tiny_channel(node_factory): def test_opening_tiny_channel(node_factory):
# Test custom min-capacity-sat parameters # Test custom min-capacity-sat parameters
# #
@ -1959,11 +1960,12 @@ def test_change_chaining(node_factory, bitcoind):
l1.rpc.fundchannel(l3.info['id'], 10**7, minconf=0) l1.rpc.fundchannel(l3.info['id'], 10**7, minconf=0)
def test_feerate_spam(node_factory): def test_feerate_spam(node_factory, chainparams):
l1, l2 = node_factory.line_graph(2) l1, l2 = node_factory.line_graph(2)
slack = 25000000 if not chainparams['elements'] else 35000000
# Pay almost everything to l2. # Pay almost everything to l2.
l1.pay(l2, 10**9 - 25000000) l1.pay(l2, 10**9 - slack)
# It will send this once (may have happened before line_graph's wait) # It will send this once (may have happened before line_graph's wait)
wait_for(lambda: l1.daemon.is_in_log('Setting REMOTE feerate to 15000')) wait_for(lambda: l1.daemon.is_in_log('Setting REMOTE feerate to 15000'))

View File

@ -23,7 +23,8 @@ def test_db_dangling_peer_fix(node_factory):
l2.fund_channel(l1, 200000, wait_for_active=True) l2.fund_channel(l1, 200000, wait_for_active=True)
def test_block_backfill(node_factory, bitcoind): @unittest.skipIf(TEST_NETWORK != 'regtest', "Address is network specific")
def test_block_backfill(node_factory, bitcoind, chainparams):
"""Test whether we backfill data from the blockchain correctly. """Test whether we backfill data from the blockchain correctly.
For normal operation we will process any block after the initial start For normal operation we will process any block after the initial start
@ -120,6 +121,7 @@ def test_max_channel_id(node_factory, bitcoind):
@unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db") @unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db")
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot") @unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
@unittest.skipIf(TEST_NETWORK != 'regtest', "The network must match the DB snapshot")
def test_scid_upgrade(node_factory): def test_scid_upgrade(node_factory):
# Created through the power of sed "s/X'\([0-9]*\)78\([0-9]*\)78\([0-9]*\)'/X'\13A\23A\3'/" # Created through the power of sed "s/X'\([0-9]*\)78\([0-9]*\)78\([0-9]*\)'/X'\13A\23A\3'/"

View File

@ -1,5 +1,6 @@
from collections import Counter from collections import Counter
from fixtures import * # noqa: F401,F403 from fixtures import * # noqa: F401,F403
from fixtures import TEST_NETWORK
from lightning import RpcError from lightning import RpcError
from utils import wait_for, TIMEOUT, only_one, sync_blockheight from utils import wait_for, TIMEOUT, only_one, sync_blockheight
@ -1508,6 +1509,7 @@ def test_gossip_no_backtalk(node_factory):
@unittest.skipIf(not DEVELOPER, "Needs --dev-gossip") @unittest.skipIf(not DEVELOPER, "Needs --dev-gossip")
@unittest.skipIf(TEST_NETWORK != 'regtest', "Channel announcement contains genesis hash, receiving node discards on mismatch")
def test_gossip_ratelimit(node_factory): def test_gossip_ratelimit(node_factory):
# These make the channel exist, but we use our own gossip. # These make the channel exist, but we use our own gossip.
l1, l2 = node_factory.line_graph(2, wait_for_announce=True) l1, l2 = node_factory.line_graph(2, wait_for_announce=True)

View File

@ -1,4 +1,5 @@
from fixtures import * # noqa: F401,F403 from fixtures import * # noqa: F401,F403
from fixtures import TEST_NETWORK
from lightning import RpcError from lightning import RpcError
from utils import only_one, DEVELOPER, wait_for, wait_channel_quiescent from utils import only_one, DEVELOPER, wait_for, wait_channel_quiescent
@ -123,6 +124,7 @@ def test_invoice_preimage(node_factory):
@unittest.skipIf(not DEVELOPER, "gossip without DEVELOPER=1 is slow") @unittest.skipIf(not DEVELOPER, "gossip without DEVELOPER=1 is slow")
@unittest.skipIf(TEST_NETWORK != 'regtest', "Amounts too low, dominated by fees in elements")
def test_invoice_routeboost(node_factory, bitcoind): def test_invoice_routeboost(node_factory, bitcoind):
"""Test routeboost 'r' hint in bolt11 invoice. """Test routeboost 'r' hint in bolt11 invoice.
""" """

View File

@ -1,6 +1,7 @@
from bitcoin.rpc import RawProxy from bitcoin.rpc import RawProxy
from decimal import Decimal from decimal import Decimal
from fixtures import * # noqa: F401,F403 from fixtures import * # noqa: F401,F403
from fixtures import TEST_NETWORK
from flaky import flaky # noqa: F401 from flaky import flaky # noqa: F401
from lightning import RpcError from lightning import RpcError
from threading import Event from threading import Event

View File

@ -1,4 +1,5 @@
from fixtures import * # noqa: F401,F403 from fixtures import * # noqa: F401,F403
from fixtures import TEST_NETWORK
from flaky import flaky # noqa: F401 from flaky import flaky # noqa: F401
from lightning import RpcError, Millisatoshi from lightning import RpcError, Millisatoshi
from utils import DEVELOPER, wait_for, only_one, sync_blockheight, SLOW_MACHINE, TIMEOUT, VALGRIND from utils import DEVELOPER, wait_for, only_one, sync_blockheight, SLOW_MACHINE, TIMEOUT, VALGRIND
@ -560,6 +561,7 @@ def test_sendpay(node_factory):
assert payments[0]['payment_preimage'] == preimage3 assert payments[0]['payment_preimage'] == preimage3
@unittest.skipIf(TEST_NETWORK != 'regtest', "The reserve computation is bitcoin specific")
def test_sendpay_cant_afford(node_factory): def test_sendpay_cant_afford(node_factory):
l1, l2 = node_factory.line_graph(2, fundamount=10**6) l1, l2 = node_factory.line_graph(2, fundamount=10**6)
@ -2251,6 +2253,7 @@ def test_channel_spendable_capped(node_factory, bitcoind):
assert l1.rpc.listpeers()['peers'][0]['channels'][0]['spendable_msat'] == Millisatoshi(0xFFFFFFFF) assert l1.rpc.listpeers()['peers'][0]['channels'][0]['spendable_msat'] == Millisatoshi(0xFFFFFFFF)
@unittest.skipIf(TEST_NETWORK != 'regtest', 'The numbers below are bitcoin specific')
def test_channel_drainage(node_factory, bitcoind): def test_channel_drainage(node_factory, bitcoind):
"""Test channel drainage. """Test channel drainage.