maven package error in building openmrs-module-radiology

Results :

Failed tests:   shouldThrowIllegalArgumentExceptionIfGivenReasonIsNullOrContainsOnlyWhitespaces(org.openmrs.module.radiology.modality.RadiologyModalityServiceComponentTest): (..)

Tests run: 372, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Radiology 0.1.2-SNAPSHOT:
[INFO]
[INFO] Radiology .......................................... SUCCESS [  0.566 s]
[INFO] Radiology API ...................................... FAILURE [ 35.177 s]
[INFO] Radiology OMOD ..................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  36.120 s
[INFO] Finished at: 2020-10-26T14:27:25+11:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project radiology-api: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\033102\Documents\Project\Slicer\ABUS_Server_Build\openmrs-module-radiology-master\api\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :radiology-api

033102@FEIT033102 MINGW64 ~/Documents/Project/Slicer/ABUS_Server_Build/openmrs-module-radiology-master

Is your module up to date with master branch ? can you also share full log using pastebin.com

Hello, sharif,

Yes, this is the latest master branch.

please check the full log in https://pastebin.com/0rk3jisV

Try mvn clean install -U

That’s an interesting error. It looks like the module is written to properly localise error messages, but the tests aren’t written to take that into account. Could you try changing your local copy of api/src/test/java/org/openmrs/module/radiology/modality/RadiologyModalityServiceComponentTest.java so that this line instead reads:

expectedException.expectMessage(Context.getMessageSourceService()
                    .getMessage("general.voidReason.empty"));

If that fixes the issue, feel free to open a PR to fix it :slight_smile:.

1 Like

Hello, sharif,

This command raised the same problem.

Hello ibacher,

You are right. Thank you very much!

Tests run: 184, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ radiology-omod ---
[INFO] Building jar: C:\Users\033102\Documents\Project\Slicer\ABUS_Server_Build\openmrs-module-radiology-master\omod\target\radiology-0.1.2-SNAPSHOT.jar
[INFO]
[INFO] --- maven-openmrs-plugin:1.0.1:package-module (pack) @ radiology-omod ---
[INFO] Packaging OpenMRS module
[INFO] Building jar: C:\Users\033102\Documents\Project\Slicer\ABUS_Server_Build\openmrs-module-radiology-master\omod\target\radiology-0.1.2-SNAPSHOT.omod
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Radiology 0.1.2-SNAPSHOT:
[INFO]
[INFO] Radiology .......................................... SUCCESS [  0.696 s]
[INFO] Radiology API ...................................... SUCCESS [ 35.824 s]
[INFO] Radiology OMOD ..................................... SUCCESS [02:35 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:12 min
[INFO] Finished at: 2020-10-27T09:27:20+11:00
[INFO] ------------------------------------------------------------------------

033102@FEIT033102 MINGW64 ~/Documents/Project/Slicer/ABUS_Server_Build/openmrs-module-radiology-master

Thanks @ibacher , to my case i could successfully run the radiology module without those errors. @tesla2678 ,did you fix with a new PR as suggested by @ibacher? feel free to share thanks