Build failure error?

Confluence User - 24 Mar, 2021

How can I solve this build error ?
[INFO] Reactor Summary for wflow-app 7.0-SNAPSHOT:
[INFO]
[INFO] wflow-jdbc ......................................... SUCCESS [ 5.245 s]
[INFO] wflow-commons ...................................... SUCCESS [ 31.421 s]
[INFO] wflow-plugin-base .................................. SUCCESS [ 9.618 s]
[INFO] wflow-plugin-archetype ............................. SUCCESS [ 1.951 s]
[INFO] wflow-directory .................................... FAILURE [ 23.295 s]
[INFO] wflow-wfengine ..................................... SKIPPED
[INFO] wflow-core ......................................... SKIPPED
[INFO] wflow-consoleweb ................................... SKIPPED
[INFO] wflow-app .......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:13 min
[INFO] Finished at: 2021-03-24T12:06:13+10:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test (default-test) on project wflow-directory: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\ManjeetKaur\joget_src\jw-community\wflow-directory\target\surefire-reports for the individual test results. AND THIS REPORTS IS MENTIONING FOLLOWING ERROR-------------------------------------------------------------------------------
Test set: org.joget.directory.model.service.TestDirectoryManager
-------------------------------------------------------------------------------
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 17.132 sec <<< FAILURE!
testOrganizationChart(org.joget.directory.model.service.TestDirectoryManager) Time elapsed: 4.112 sec <<< ERROR!
java.lang.IllegalArgumentException: [Assertion failed] - this expression must be true
at org.springframework.util.Assert.isTrue(Assert.java:92)
at org.springframework.util.Assert.isTrue(Assert.java:101)
at org.joget.directory.model.service.TestDirectoryManager.testOrganizationChart(TestDirectoryManager.java:155)
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:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)



build-source-code

4


24 Mar, 2021
confluenceUser
confluenceUser

Quick thought. If you did not modify any of the source code before, maybe you can just skip the tests so that you can move on with your next task.

mvn install -DskipTests=true
24 Mar, 2021
confluenceUser
confluenceUser

Hi Walter,

What could be the solution other than skipping test?

24 Mar, 2021
confluenceUser
confluenceUser

Check out the source code https://github.com/jogetworkflow/jw-community/blob/7.0-SNAPSHOT/wflow-directory/src/test/java/org/joget/directory/model/service/TestDirectoryManager.java#L155

// assign user to dept
LogUtil.info(getClass().getName(), "testOrganizationChart: assign user to dept");
addEmployment(TEST_USER, TEST_DEPARTMENT_CHILD, TEST_ORGANIZATION);
Collection<User> userHodList = directoryManager.getUserHod(TEST_USER);
String usernameHod = null;
if (userHodList != null && !userHodList.isEmpty()) {
User userHod = userHodList.iterator().next();
usernameHod = userHod.getUsername();
}
Assert.isTrue(TEST_DEPARTMENT_CHILD_HOD.equals(usernameHod));

Looks like the test failed in assigning user to a department?

Maybe try pointing to a brand new database for tests to run?

Check step 4 - Build Source Code on Windows#4.ConfigureDatasourceforTestCase

25 Mar, 2021
confluenceUser
1
confluenceUser

Skipping Tests is not a good idea. Alternatively, I pointed it to a brand new database as suggested by Walter, and the build is successful.


Installing C:\Users\ManjeetKaur\joget_src\jw-community\wflow-app\pom.xml to C:\Users\ManjeetKaur\.m2\repository\org\joget\wflow-app\7.0-SNAPSHOT\wflow-app-7.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for wflow-app 7.0-SNAPSHOT:
[INFO]
[INFO] wflow-jdbc ......................................... SUCCESS [ 58.844 s]
[INFO] wflow-commons ...................................... SUCCESS [01:20 min]
[INFO] wflow-plugin-base .................................. SUCCESS [ 27.738 s]
[INFO] wflow-plugin-archetype ............................. SUCCESS [ 31.277 s]
[INFO] wflow-directory .................................... SUCCESS [ 24.368 s]
[INFO] wflow-wfengine ..................................... SUCCESS [ 50.864 s]
[INFO] wflow-core ......................................... SUCCESS [02:39 min]
[INFO] wflow-consoleweb ................................... SUCCESS [05:20 min]
[INFO] wflow-app .......................................... SUCCESS [ 0.200 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:51 min
[INFO] Finished at: 2021-03-25T12:51:25+10:00
[INFO] ------------------------------------------------------------------------


RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print