treee111 / wahooMapsCreator

Create maps for Wahoo device based on latest OSM maps
247 stars 25 forks source link

Add unittests with a country file outside of the repo #237

Open treee111 opened 9 months ago

treee111 commented 9 months ago
          Your option 2 sounds like a good idea.

Maybe tests using such files could then be tagged or disabled by default, do that one has to invoke these tests with an option, when one has these goods locally present?

I have also been wondering if you should make a subset of the land polygon shapefile, just covering enough of Europe for the tests, so that it could be checked in with a small file size ?

And then add some test with your option 2 with the complete land polygon file.

I also consider to add tests for Faroe Islands, as a country with coastline, and a small country with at least a handful of tiles, but with osm file at 50 MB, so it could be checked in.

Regards Alf

  1. nov. 2023, 23:01 kl. 23:01 skrev "Benjamin K." @.***>:

    @treee111 I am tempted to write a unit test for this tile generation, and the tile in Norway where I observed similar issues, and then run the test with the old version of the code, using the incorrect way of spawning command, and the updated code, which should not have any isses.

    What do you think ?

    unittests are always good. The more, the better.

    For checking this particular issue I think running it manually should do the trick. One could run via the repo and checkout different tags or commits or via pypi installation older versions could also be installed.

    I guess the main issue is that it would require the Netherlands and Norway osm files to be part of the unit test resources, at least if the test should be "enabled". It couild also be disabled, and only something a developer would enable if he has a local version of the two country OSM files.

    There are also other unit testcases I consider writing, where it would be useful to have a larger country OSM file, like Norway. Any thoughts ?

    To have a small repo for fast response and cloning I decided to use small countries having the .osm files in the repo and only land-poligons outside of the repo (this particular version is also backuped etc.). Using norway and/or netherlands both having 1,25GB would not suit into this anymore.

    A compromise could be that we have two ways of accessing .osm files:

    1. the one implemented now where the .osm file is in the repo
    2. another way where we access the .osm file from the ~/wahooMapsCreatorData/_unittest similar to land-poligons.

    Norway and netherlands would suit into 2. then. What do you think? Should I implement the casing/infrastructure for 2. and you can take on the unittest coding?

    -- Reply to this email directly or view it on GitHub: https://github.com/treee111/wahooMapsCreator/issues/214#issuecomment-1793565119 You are receiving this because you commented.

    Message ID: @.***>

Originally posted by @alfh in https://github.com/treee111/wahooMapsCreator/issues/214#issuecomment-1793695603