geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
420 stars 489 forks source link

Fix code paths that cause errors on Windows #8355

Open tobias-hotz opened 3 weeks ago

tobias-hotz commented 3 weeks ago

Currently, when setting up the project as described on windows, you cannot run unit tests locally, as they assume LF line endings at various places. Using the WSL on Windows means that these unit tests can be run. Due to IntelliJ's good integration into the WSL, this works very seamless with IntelliJ as well.

Also include some minor fixes like incorrect links and outdated documentation

Checklist


Funded by LGL BW

josegar74 commented 3 weeks ago

@tobias-hotz the pull request looks good to me, but would be good to have a list of tests failing in Windows due to the line endings to update the code to use the current system line ending.

jodygarnett commented 3 weeks ago

Can we just fix the tests please rather than require Linux line feeds? windows is a supported environment is it not? We may as well test for it …

If it helps we can setup a windows GitHub workflow to keep the tests passing correctly …

tobias-hotz commented 1 week ago

Thanks for your feedback. I've taken a look at the errors more closely, and it turns out there are more errors than just line endings. I've fixed all test failures in the lastest commit, so all unit tests now pass on windows. Please note that this also required some adjustment to non-test classes, as there were some errors/assumptions in wro4j regarding windows handling. Please read the commit message for more details. With these changes, all tests now pass on windows and linux.

tobias-hotz commented 1 week ago

I've also notices that MessageProducerTest sometimes fails. It seems like the test is not written thread-safe. I've fixed this test in the lastest commit to make it thread-safe