Error while Building Sync2 module

Trying to build the Sync2 module , but am getting these test failures .

[ERROR] Failures:
]ERROR]   SyncAuditServiceImplTest.convert_shouldSerializeAuditMessage:237 expected:<...onflictUuid":"test"}[
> but was:<...onflictUuid":"test"}[]
>
]ERROR]   SyncAuditServiceImplTest.getJsonMessageById:109 expected:<...onflictUuid":"test"}[
> but was:<...onflictUuid":"test"}[]
>
]ERROR]   SyncAuditServiceImplTest.getJsonMessageByUuid:119 expected:<...onflictUuid":"test"}[
> but was:<...onflictUuid":"test"}[]
>
]ERROR]   SyncAuditServiceImplTest.getPaginatedMessages:135 expected:<...lictUuid":"test2"}]}[
> but was:<...lictUuid":"test2"}]}[]
>
]ERROR]   SimpleObjectSerializationUtilsTest.serialize_shouldCreateValidJson:22 expected:<...":"self","uri":"."}}[
> but was:<...":"self","uri":"."}}[]
>
[ERROR]   SyncConfigurationUtilsTest.shouldWriteSyncConfigurationToJsonFile:106 expected:<...nstanceId" ]
  }
][
> but was:<...nstanceId" ]
  }
}[]
>
[ERROR]   SyncConfigurationUtilsTest.shouldWriteSyncConfigurationToJsonString:93 expected:<...nstanceId" ]
  }
][
> but was:<...nstanceId" ]
  }
}[]
> 

Could it be caused by corupted dependencies /poor network while building the module??

cc @ssmusoke @dkayiwa

yes @mozzy am getting the same problem after running; but when j tried to read into the error log .j think the problem could be in syncConfigurationUtilTest.java class.

Actually
org.junit.ComparisonFailure: expected:<[expected]> but was:<[{ "general" : { "parentFeedLocation" : "", "localFeedLocation" : "defaultAddress", "localInstanceId" : "localInstanceId", "persistSuccessAudit" : false, "persistFailureAudit" : false, "clients" : { } }, "push" : { "enabled" : true, "schedule" : 12, "classes" : [ { "classTitle" : "Location", "category" : "location", "openMrsClass" : "org.openmrs.Location", "enabled" : true, "preferredClient" : "fhir" }, { "classTitle" : "Observation", "category" : "observation", "openMrsClass" : "org.openmrs.Obs", "enabled" : true, "preferredClient" : null } ] }, "pull" : { "enabled" : true, "schedule" : 12, "classes" : [ { "classTitle" : "Location", "category" : "location", "openMrsClass" : "org.openmrs.Location", "enabled" : true, "preferredClient" : "fhir" }, { "classTitle" : "Observation", "category" : "observation", "openMrsClass" : "org.openmrs.Obs", "enabled" : true, "preferredClient" : null } ] }, "whitelist" : { "enabled" : true, "instanceIds" : [ "childInstanceId" ] } } ]> at org.junit.Assert.assertEquals(Assert.java:115) at org.junit.Assert.assertEquals(Assert.java:144) at org.openmrs.module.sync2.api.utils.SyncConfigurationUtilsTest.shouldWriteSyncConfigurationToJsonString(SyncConfigurationUtilsTest.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

after running that class in test format , it returned the same json values but j guess we need to specify the path the url it need to return. @mozzy can you check into it especially line 93 from syncConfigurationTest. thanks

@sharif could it be possible to use pastebin.com paste the error logs?

1 Like

Theres some thing strange with travis config file for sync2 module. How is Travis able to run tests for Sync2 without any command for running tests included in the script? cc @dkayiwa @ssmusoke

in the Build log i can see
The command "mvn test -B" exited with 0.

but i cant see the actual command in travis file :roll_eyes:

Could the failure be caused because the tests are run in isolation on a local machine but pass in the travis build when they are run in a certain order.??

Trying to figure out why the failure :shushing_face:

I got errors yesterday. But when i built it today, it was successful. Can you try again?

2 Likes

On doing a mvn clean package these are the errors I also get.

By default, when run with language: java with a pom.xml file, Travis just simply runs mvn test -B. See here.

1 Like

@irenyak1 did you succeed with "mvn clean install " ?

@tendomart not yet I run the first instance using the SDK and it build successfully but the second instance failed while using the standalone. here is the error

:grinning: , so how should we know which lucky days will the build pass ??:slightly_smiling_face:

Thanks @ibacher for the clarification , i ddnt know

:shushing_face: @irenyak1 i havent understood exactly your issue,does that happen on installing the Sync2 module??

I took it to be a connection problem to the server that hosted the artifacts.

1 Like

oh ya , that seems to be a better expalnation

@mozzy I first run the first instance using the SDK, after which I tried install the sync2 module, it asked for the atom feed module which I also installed , though the atom feed failed to install throwing this error Error while trying to start module Unable to update data model using liquibase.xml. Module: Atomfeed module

The second instance I tried building with the standalone failed before I installed the Sync2 module. In other works it did not build to completion.

From the error log, i think the issue is about the database connection, I think both instances are trying to connect to one database which is causing the error.

@dkayiwa @ssmusoke please look through my error and guide me.

@irenyak1 you will need to send us more information to tell why your module is not starting.

ya as long as one instance is connected , the other one cant connect.

the default databse connection url is connection.url=jdbc:mysql:mxj://127.0.0.1:3316/openmrs

you need to change the database conection url in the runtime properties for the second instance to connection.url=jdbc:mysql:mxj://127.0.0.1:3317/openmrs

In other words for you to have two instances runing,they must have different tomcat port and different Mysql port numbers

1 Like

@dkayiwa i still get the same error when building the module