beyond-all-reason/pr-downloader

Add integration test for maps download

p2004a opened this issue · 0 comments

p2004a commented

Task is to extend https://github.com/beyond-all-reason/pr-downloader/blob/master/test/functional_test.py with test for map downloads as currently only game downloads using Rapid are tested.


pr-downloader takes --download-map with the name of map to download (name is SpringName, unique identifier), and calls endpoint defined by PRD_HTTP_SEARCH_URL environment variable to find where it's located and how to download it. E.g.: https://files-cdn.beyondallreason.dev/find?category=map&springname=Angel%20Crossing%201.4 for map with spring name Angel Crossing 1.4.

Parsing in pr-downloader of response is in: https://github.com/beyond-all-reason/pr-downloader/blob/master/src/Downloader/Http/HttpDownloader.cpp#L117

The integration test HTTP server needs to be extended to support such endpoint and serve some small dummy file and test that:

  • Download works correctly
  • When hash in metadata doesn't match the hash of downloaded file it should error out
  • When something fails, it should not create a final .sd7 file but always temp file first

PS: this doesn't require pr-downloader compilation, you can get latest stable binaries from https://github.com/beyond-all-reason/spring-launcher/tree/master/bin and just execute intgration test against them.