Flaky test on dhis-web-api module (AnalyticsControllerTest)

Hello community,

I’m trying to set up dhis2-core on my local machine (windows) and encountered a failure in the AnalyticsControllerTest (dhis-2/dhis-web-api/src/test/java/org/hisp/dhis/webapi/controller/AnalyticsControllerTest.java - verifyCsvRequest()).

Apparently, this test would fail on a Windows OS given that in one of the assertions, the actual result prints \r\n (Windows style) as the line separator, whilst the expected result uses \n (UNIX style).

We can fix this flakiness by using a platform-independent line separator (System.lineSeparator()). Will be happy to resolve this myself as a first issue :slightly_smiling_face:.

1 Like

Hi @chijioke-ibekwe

For development purposes (and in windows) why not try DHIS2 in Docker, here’s the guide from the Developers Portal: How to spin up a DHIS2 local instance | DHIS2 Developer Portal

I hope this will help. :slight_smile:

Actually, if you want to contribute to the code, and thanks for pointing the issue and the cause. Very happy you’re sharing this here. Would you like to have a look at the contributing guide: Contribute to the DHIS2 source code | DHIS2 Developer Portal

Thanks @Gassim for linking these resources. Will look at them

1 Like