|
From: Florent R. <f.r...@fr...> - 2020-06-20 14:06:47
|
James Turner <ja...@fl...> wrote: > Lovely, thank you! Thanks. >> Note that direct running of the test scripts only works for >> test_sgprops.py. For test_catalog.py, this fails due to files not being >> found. I haven't investigated why (the code uses os.chdir(), so >> maybe...), but if this solution is adopted, maybe it would be best to >> add a little README and remove the executable bits from test_sgprops.py >> and test_catalog.py to ensure people use 'python3 -m unittest ...' to >> run the tests. > > That will be my fault, for ‘trying to make it work’, sorry :( > > And yes fully agreed to remove the +x bits and run via the correct Python > mechanism. Hey, I didn't mean to imply there was something bad in the code; I'm merely documenting what I found out after shuffling these things around, that could break people's expectations. Unless there's an “urgent” need to have the stuff committed, I think I'll wait a little bit. Edward seems to have a decent experience with unit testing, maybe he'll want to comment. :) Note for people knowing the catalog scripts & config: In the latest branch[1] I pushed to my fork (the same as mentioned in my previous message), directory tree python3-flightgear/flightgear/meta/tests/fgaddon-catalog is a copy of catalog/fgaddon-catalog. I had to add it there because test_catalog.py needs it. I think that's acceptable, as it is part of the test data/config. OTOH, I believe you (probably James) want the “real FGAddon catalog config” in catalog/fgaddon-catalog, so I left it there too. One might use a unique copy and relative paths in update-catalog.py or test_catalog.py to refer to this unique copy from both places, but I'm not sure it's the best way: I really know nothing about this catalog code, but I believe it's okay to have “test data” python3-flightgear/flightgear/meta/tests/fgaddon-catalog/* independent from “real FGAddon catalog config” catalog/fgaddon-catalog/*. Feel free to correct me if I'm mistaken! Regards [1] https://sourceforge.net/u/frougon/flightgear-fgmeta/ci/move-all-tests-to-flightgear.meta-v1/tree/ -- Florent |