Failing ModuleUtilTest in fresh openmrs-core clone

hi all,

i’m having trouble getting a freshly cloned development copy of openmrs-core to build correctly.

When i run a maven clean install, my build fails this test:

Tests in error:
ModuleUtilTest.checkMandatoryModulesStarted_shouldThrowModuleExceptionIfAMandatoryModuleIsNotStarted

Examining the test logs gives me the following error: ------------------------------------------------------------------------------- Test set: org.openmrs.module.ModuleUtilTest ------------------------------------------------------------------------------- Tests run: 43, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.214 sec <<< FAILURE! - in org.openmrs.module.ModuleUtilTest checkMandatoryModulesStarted_shouldThrowModuleExceptionIfAMandatoryModuleIsNotStarted(org.openmrs.module.ModuleUtilTest) Time elapsed: 0.013 sec <<< ERROR! java.lang.Exception: Unexpected exception, expected<org.openmrs.module.MandatoryModuleException> but was<java.lang.AssertionError> at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) at org.junit.Assert.assertThat(Assert.java:865) at org.junit.Assert.assertThat(Assert.java:832) at org.openmrs.module.ModuleUtilTest.checkMandatoryModulesStarted_shouldThrowModuleExceptionIfAMandatoryModuleIsNotStarted(ModuleUtilTest.java:47)

I’m using eclipse on arch linux with openjdk8 as the JVM.

Being a newcomer, i’m not familiar with maven or what i could do to fix this. Any help would be greatly appreciated because i am eager to dive into the code and look around.

thanks in advance :slight_smile:

Can you try this again from command line instead of within the IDE?

unfortunately performing mvn clean install from the command line produces the same result.

i’m using maven 3.3.9, if that’s any help

Can i look at the full command line log? Am also assuming you do not have any local changes and you have the latest upstream changes for the master branch.

here’s a text file with the details of mvn clean install

you are correct in assuming that i have no local changes and also the latest upstream from master

help.txt (314.9 KB)

Can i look at the contents of? /home/benjamin/workspace/openmrs-core/api/target/surefire-reports/org.openmrs.module.ModuleUtilTest.txt

This is the contents of that particular file

-------------------------------------------------------------------------------
Test set: org.openmrs.module.ModuleUtilTest
-------------------------------------------------------------------------------
Tests run: 43, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.206 sec <<< FAILURE! - in org.openmrs.module.ModuleUtilTest
checkMandatoryModulesStarted_shouldThrowModuleExceptionIfAMandatoryModuleIsNotStarted(org.openmrs.module.ModuleUtilTest)  Time elapsed: 0.012 sec  <<< ERROR!
java.lang.Exception: Unexpected exception, expected<org.openmrs.module.MandatoryModuleException> but was<java.lang.AssertionError>
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    at org.junit.Assert.assertThat(Assert.java:865)
    at org.junit.Assert.assertThat(Assert.java:832)
    at org.openmrs.module.ModuleUtilTest.checkMandatoryModulesStarted_shouldThrowModuleExceptionIfAMandatoryModuleIsNotStarted(ModuleUtilTest.java:47)

Do this in the order below on command line:

  1. git reset --hard
  2. git clean -df
  3. mvn clean install

Then tell me what happens.

i get the same result in this case, the same test failure with the same details

You might be having an outdated repo, where did you clone from? From your fork or openmrs space in github? You can run git remote -v and see what the origin is