Skip to content

Commit

Permalink
Disable rust during unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
egbertbouman committed Feb 20, 2024
1 parent 773de58 commit 47229f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/tribler/core/components/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def tribler_config(tmp_path) -> TriblerConfig:
config.torrent_checking.enabled = False
config.ipv8.enabled = False
config.ipv8.walk_scaling_enabled = False
config.ipv8.rust_endpoint = False
config.discovery_community.enabled = False
config.libtorrent.enabled = False
config.libtorrent.dht_readiness_timeout = 0
Expand Down
10 changes: 4 additions & 6 deletions src/tribler/core/components/ipv8/ipv8_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def run(self):
self.rendevous_hook = RendezvousHook(self.rendezvous_db)

port = config.ipv8.port
address = config.ipv8.address
address = '127.0.0.1' if config.gui_test_mode else config.ipv8.address
self.logger.info('Starting ipv8')
self.logger.info(f'Port: {port}. Address: {address}')
ipv8_config_builder = (ConfigBuilder()
Expand All @@ -67,12 +67,10 @@ async def run(self):
.set_working_directory(str(config.state_dir))
.set_walker_interval(config.ipv8.walk_interval))

INTERFACES["UDPIPv4"] = UDPEndpoint
if config.ipv8.rust_endpoint and not config.gui_test_mode:
INTERFACES["UDPIPv4"] = UDPEndpoint

Check warning on line 71 in src/tribler/core/components/ipv8/ipv8_component.py

View check run for this annotation

Codecov / codecov/patch

src/tribler/core/components/ipv8/ipv8_component.py#L71

Added line #L71 was not covered by tests

if config.gui_test_mode:
endpoint = DispatcherEndpoint([])
else:
endpoint = DispatcherEndpoint(["UDPIPv4"], UDPIPv4={'port': port, 'ip': address})
endpoint = DispatcherEndpoint(["UDPIPv4"], UDPIPv4={'port': port, 'ip': address})

ipv8 = IPv8(ipv8_config_builder.finalize(),
enable_statistics=config.ipv8.statistics and not config.gui_test_mode,
Expand Down
1 change: 1 addition & 0 deletions src/tribler/core/components/ipv8/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Ipv8Settings(TriblerConfigSection):
enabled: bool = True
port: int = 7759
address: str = '0.0.0.0'
rust_endpoint: bool = True
bootstrap_override: Optional[str] = None
statistics: bool = False
rendezvous_stats: bool = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@pytest.fixture(name='socks5_server')
async def fixture_socks5_server(free_port):
socks5_server = Socks5Server(free_port, Mock())
socks5_server = Socks5Server(1, free_port, Mock())
yield socks5_server
await socks5_server.stop()

Expand Down

0 comments on commit 47229f2

Please sign in to comment.