Tests: torrents #397
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
torrent.rs is at 19% of its lines:
fetch(58 lines),seedandnewnever run, and neither do scan.rs'sspawn_torrentandtorrent_one(49 lines) or ctx.rs'storrents. Torrent support is wanted (it stays); a regression in it would go unseen until a feed with a .torrent enclosure failed in production.Tests to add:
torrent_deferred), not downloaded as a filefetch_internal), the torrent completes, its file lands under the feed's folder, and the slot is freed (ipx_torrent_slots_freeback to 2)Seen with the coverage of both suites merged line by line (cargo:
sh scripts/coverage.sh, browser:sh scripts/coverage.sh api; reports in target/coverage/cargo, api and page; #390, #394), as of 2026-11-07. A test added here shows in Grafana's Coverage row at the next run.Tests added in
1253b47. torrent.rs: a swarm on 127.0.0.1 (a seeding librqbit session, and a web server serving the .torrent and acting as its tracker): spawn_torrent downloads it through ipx's session into own_folder, records the row done with that folder, the file matches the seed's, and the slot is free (2 again); torrent_file through the guarded client is refused from 127.0.0.1 unless fetch_internal lists it. scan.rs: a .torrent enclosure goes to the torrent worker (counted in torrents, not downloaded; 'downloading' while it waits for a slot), and with torrents off is skipped and still counted. Test sessions use no DHT or LAN discovery. Not done: shutdown while a torrent runs. Spawned torrents are tasks on the daemon's runtime and end when it does; testing that belongs with the daemon's shutdown tests in #400.