This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Remove dependency on imdl
to run tests?
#241
Labels
You can continue the conversation there. Go to discussion →
imdl
to run tests?
#241
We are using the intermodal console command to generate torrents for testing.
Whenever we need a test torrent, we generate a random text file and then use the
imdl
command to create the torrent file. You can read this PR comment to understand how test torrent can be generated usingimdl
.We have a wrapper for the
imdl
command. See https://github.com/torrust/torrust-index-backend/blob/develop/tests/common/contexts/torrent/file.rs#L32-L52Recently we have started creating the test torrent direct the same way we build to torrent files for the API endpoint to download the torrent file. That endpoint builds the torrent file from that data in the database. On this PR, we introduced a new endpoint to generate random torrent files we needed to test the frontend. We wanted to test the torrent upload with cypress.
Now that we have started generating test torrents directly without using a third-party package, I suggest removing the dependency on
imdl
to run unit tests.The module to generate and parse torrent files for testing is: https://github.com/torrust/torrust-index-backend/blob/develop/tests/common/contexts/torrent/file.rs
But I see two problems:
imdl
to parse torrent files. We could also use our code to parse torrent files but ...I've opened an issue on the intermodal repo asking them for a package. If they release a package, we could start using the package instead using the console command. Alternatively, we could create our own package to create/parse torrent files.
One thing I miss from
imdl
is it does not give you thepieces
. THis is an example output forimdl
in json format:And this is what you get using another service like: https://chocobo1.github.io/bencode_online/
The text was updated successfully, but these errors were encountered: