fixing integration tests

This commit is contained in:
Lex Berezhny 2019-01-21 23:58:43 -05:00
parent d5f2832b2f
commit 1ae1137005
2 changed files with 15 additions and 21 deletions

View file

@ -25,8 +25,7 @@ jobs:
- pip install -e .[test] - pip install -e .[test]
script: script:
- HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.core tests.unit.cryptstream tests.unit.database tests.unit.dht tests.unit.lbryfilemanager tests.unit.lbrynet_daemon tests.unit.schema tests.unit.wallet tests.unit.components tests.unit.test_conf - HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.core tests.unit.cryptstream tests.unit.database tests.unit.dht tests.unit.lbryfilemanager tests.unit.lbrynet_daemon tests.unit.schema tests.unit.wallet tests.unit.components tests.unit.test_conf
- HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.test_cli #- HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.test_cli tests.unit.analytics
#- HOME=/tmp coverage run -p --source=lbrynet -m twisted.trial --reactor=asyncio tests.unit.analytics
after_success: after_success:
- coverage combine - coverage combine
- bash <(curl -s https://codecov.io/bash) - bash <(curl -s https://codecov.io/bash)

View file

@ -16,7 +16,7 @@ from torba.testcase import IntegrationTestCase
import lbrynet.schema import lbrynet.schema
lbrynet.schema.BLOCKCHAIN_NAME = 'lbrycrd_regtest' lbrynet.schema.BLOCKCHAIN_NAME = 'lbrycrd_regtest'
from lbrynet import conf as lbry_conf from lbrynet.conf import Config
from lbrynet.extras.daemon.Daemon import Daemon, jsonrpc_dumps_pretty from lbrynet.extras.daemon.Daemon import Daemon, jsonrpc_dumps_pretty
from lbrynet.extras.wallet import LbryWalletManager from lbrynet.extras.wallet import LbryWalletManager
from lbrynet.extras.daemon.Components import WalletComponent from lbrynet.extras.daemon.Components import WalletComponent
@ -63,19 +63,16 @@ class CommandTestCase(IntegrationTestCase):
logging.getLogger('lbrynet.p2p').setLevel(self.VERBOSITY) logging.getLogger('lbrynet.p2p').setLevel(self.VERBOSITY)
logging.getLogger('lbrynet.daemon').setLevel(self.VERBOSITY) logging.getLogger('lbrynet.daemon').setLevel(self.VERBOSITY)
lbry_conf.settings = None conf = Config()
lbry_conf.initialize_settings( conf.data_dir = self.wallet_node.data_path
load_conf_file=False, conf.wallet_dir = self.wallet_node.data_path
data_dir=self.wallet_node.data_path, conf.download_dir = self.wallet_node.data_path
wallet_dir=self.wallet_node.data_path, conf.share_usage_data = False
download_dir=self.wallet_node.data_path conf.use_upnp = False
) conf.reflect_uploads = False
lbry_conf.settings['use_upnp'] = False conf.blockchain_name = 'lbrycrd_regtest'
lbry_conf.settings['reflect_uploads'] = False conf.lbryum_servers = [('localhost', 50001)]
lbry_conf.settings['blockchain_name'] = 'lbrycrd_regtest' conf.known_dht_nodes = []
lbry_conf.settings['lbryum_servers'] = [('localhost', 50001)]
lbry_conf.settings['known_dht_nodes'] = []
lbry_conf.settings.node_id = None
await self.account.ensure_address_gap() await self.account.ensure_address_gap()
address = (await self.account.receiving.get_addresses(limit=1, only_usable=True))[0] address = (await self.account.receiving.get_addresses(limit=1, only_usable=True))[0]
@ -89,14 +86,12 @@ class CommandTestCase(IntegrationTestCase):
self.wallet_component._running = True self.wallet_component._running = True
return self.wallet_component return self.wallet_component
skip = [ conf.components_to_skip = [
DHT_COMPONENT, UPNP_COMPONENT, HASH_ANNOUNCER_COMPONENT, DHT_COMPONENT, UPNP_COMPONENT, HASH_ANNOUNCER_COMPONENT,
PEER_PROTOCOL_SERVER_COMPONENT, REFLECTOR_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT PEER_PROTOCOL_SERVER_COMPONENT, REFLECTOR_COMPONENT, EXCHANGE_RATE_MANAGER_COMPONENT
] ]
analytics_manager = FakeAnalytics() self.daemon = Daemon(conf, ComponentManager(
self.daemon = Daemon(analytics_manager, ComponentManager( conf, skip_components=conf.components_to_skip, wallet=wallet_maker
analytics_manager=analytics_manager,
skip_components=skip, wallet=wallet_maker
)) ))
await self.daemon.setup() await self.daemon.setup()
self.daemon.wallet_manager = self.wallet_component.wallet_manager self.daemon.wallet_manager = self.wallet_component.wallet_manager