Application Name: Platform
Version Number: 2.1.0 Snapshot
Question:
Whenever I try to install using ‘mvn clean install’ I get the following error:
[INFO] Reactor Summary:
[INFO]
[INFO] OpenMRS … SUCCESS [ 5.019 s]
[INFO] openmrs-tools … SUCCESS [ 0.697 s]
[INFO] openmrs-test … SUCCESS [ 0.237 s]
[INFO] openmrs-api … FAILURE [24:57 min]
[INFO] openmrs-web … SKIPPED
[INFO] openmrs-webapp … SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25:04 min
[INFO] Finished at: 2017-02-15T21:08:06+01:00
[INFO] Final Memory: 25M/358M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project openmrs-api: There are test failures.
[ERROR]
[ERROR] Please refer to /Desktop/projects/openmrs/openmrs-core/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 -rf :openmrs-api
I have tried to install the previous Platform version 2.0.4.1, but I get the same error.
A bit further up in the output there should be a specific failing test. Can you share the details of that? You should also share your java and maven versions.
If all the tests here are green (like they are now) then things are building correctly on the server.
By the way, you only need to build openmrs-core if you’re planning to make changes to it. Otherwise I recommend getting a pre-built version, or using the OpenMRS SDK.
Yes, there’re some tests failing, here are the results:
Results :
Failed tests:
AdministrationServiceTest.getAllGlobalProperties_shouldReturnAllGlobalPropertiesInTheDatabase:477 expected:<20> but was:<24>
AdministrationServiceTest.purgeGlobalProperty_shouldDeleteGlobalPropertyFromDatabase:549 expected:<20> but was:<24>
Running org.openmrs.api.AdministrationServiceTest
Tests run: 55, Failures: 2, Errors: 0, Skipped: 4, Time elapsed: 0.632 sec <<< FAILURE! - in org.openmrs.api.AdministrationServiceTest
getAllGlobalProperties_shouldReturnAllGlobalPropertiesInTheDatabase(org.openmrs.api.AdministrationServiceTest) Time elapsed: 0.013 sec <<< FAILURE!
java.lang.AssertionError: expected:<20> but was:<24>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.junit.Assert.assertEquals(Assert.java:542)
at org.openmrs.api.AdministrationServiceTest.getAllGlobalProperties_shouldReturnAllGlobalPropertiesInTheDatabase(AdministrationServiceTest.java:477)
purgeGlobalProperty_shouldDeleteGlobalPropertyFromDatabase(org.openmrs.api.AdministrationServiceTest) Time elapsed: 0.014 sec <<< FAILURE!
java.lang.AssertionError: expected:<20> but was:<24>
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.failNotEquals(Assert.java:743)
at org.junit.Assert.assertEquals(Assert.java:118)
at org.junit.Assert.assertEquals(Assert.java:555)
at org.junit.Assert.assertEquals(Assert.java:542)
at org.openmrs.api.AdministrationServiceTest.purgeGlobalProperty_shouldDeleteGlobalPropertyFromDatabase(AdministrationServiceTest.java:549)
I am using java version “1.8.0_121” and Apache Maven 3.3.9