Running test cases

30 views
Skip to first unread message

Jiri Peinlich

unread,
Nov 5, 2018, 11:58:02 AM11/5/18
to jDip Developers
I have pushed another branch testing-gradle, in that branch I have used JUnit5 parametrized tests to run two of the testsuites from the test data directory. borders.txt and datc_v2.4_06.txt. I extracted parts of the code that is in the TestSuite class in the mist package and used it to create nice list of test cases from both test data directories.

you can run the test cases by running gradlew build.

Note that in the datc_v2.4_06.txt there is a testcase (number 75 - name 6.e.4) that causes some strange infinite loop in the engine. I had to limit the execution of testcases to let the build finish. You will see one failed test when you run the build command.

Please try it out and let me know if it does not work.


Overall I would say that the original testing code (and therefore also DATCTest#compareState method) will need some refactoring but at least now we can decide which test cases we want to run during build and which not. and we can be reasonably sure we did not break too much when we refactor the code.

Jiri Peinlich

unread,
Nov 5, 2018, 12:14:29 PM11/5/18
to jDip Developers
I just run the test case manually on the current distribution of jdip that i downloaded in the past and that one also crashes, feel free to try it out:
# non-dislodged loser still has effect
CASE 6.E.4
PRESTATE_SETPHASE Spring 1901, Movement
PRESTATE
    Germany: F hol
    Germany: F hel
    Germany: F ska
    France: F nth
    France: F bel
    England: F edi
    England: F yor
    England: F nrg
    Austria: A kie
    Austria: A ruh
ORDERS
    Germany: F hol-nth
    Germany: F hel S F hol-nth
    Germany: F ska S F hol-nth
    France: F nth-hol
    France: F bel S F nth-hol
    England: F edi S F nrg-nth
    England: F yor S F nrg-nth
    England: F nrg-nth
    Austria: A kie S A ruh-hol
    Austria: A ruh-hol
POSTSTATE
    Germany: F hol
    Germany: F hel
    Germany: F ska
    France: F nth
    France: F bel
    England: F edi
    England: F yor
    England: F nrg
    Austria: A kie
    Austria: A ruh
END

Uwe Plonus

unread,
Nov 5, 2018, 1:39:01 PM11/5/18
to jdip-de...@googlegroups.com
Hi Jiri,

I just tested you test branch and get another error. The setup already
fails for me:

Task ':jdip_168r1:test' is not up-to-date because:
  Task has failed previously.
Starting process 'Gradle Test Executor 4'. Working directory:
.../jdip/jdip/jdip_168r1 Command:
/usr/lib/jvm/java-8-openjdk-amd64/bin/java
-Djava.security.manager=worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager
-Dorg.gradle.native=false -Dfile.encoding=UTF-8 -Duser.country=DE
-Duser.language=de -Duser.variant -ea -cp
/.../.gradle/caches/4.10.1/workerMain/gradle-worker.jar
worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test
Executor 4'
Successfully started process 'Gradle Test Executor 4'

info.jdip.datc.BordersTest STANDARD_OUT
    Init error: dip.world.InvalidWorldException: Border phaseBorder:
phase "Movement" is not allowed or recognized.

info.jdip.datc.BordersTest STANDARD_ERROR
    dip.world.InvalidWorldException: Border phaseBorder: phase
"Movement" is not allowed or recognized.
        at dip.world.WorldFactory.createWorld(WorldFactory.java:212)
        at dip.misc.TestSuite.initVariant(TestSuite.java:373)
        at dip.misc.TestSuite.parseCases(TestSuite.java:1369)
        at
info.jdip.datc.BordersTest.setTestCaseLocation(BordersTest.java:14)
        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.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:515)
        at
org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
        at
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeBeforeAllMethods$6(ClassTestDescriptor.java:239)
        at
org.junit.jupiter.engine.execution.ThrowableCollector.execute(ThrowableCollector.java:40)
        at
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeBeforeAllMethods(ClassTestDescriptor.java:238)
        at
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.before(ClassTestDescriptor.java:164)
        at
org.junit.jupiter.engine.descriptor.ClassTestDescriptor.before(ClassTestDescriptor.java:65)
        at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:110)
        at
org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
        at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
        at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
        at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$2(HierarchicalTestExecutor.java:120)
        at
java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
        at
java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
        at java.util.Iterator.forEachRemaining(Iterator.java:116)
        at
java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
        at
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at
java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
        at
java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
        at
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at
java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
        at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.lambda$executeRecursively$3(HierarchicalTestExecutor.java:120)
        at
org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
        at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.executeRecursively(HierarchicalTestExecutor.java:108)
        at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor$NodeExecutor.execute(HierarchicalTestExecutor.java:79)
        at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:55)
        at
org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43)
        at
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
        at
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
        at
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
        at
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:92)
        at
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$100(JUnitPlatformTestClassProcessor.java:77)
        at
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:73)
        at
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
        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.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at
org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at
org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
        at
org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy2.stop(Unknown Source)
        at
org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:131)
        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.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at
org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at
org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
        at
org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
        at
org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        at
org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at
org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at
org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
:jdip_168r1:test (Thread[Task worker for ':' Thread 7,5,main])
completed. Took 1.2 secs.

FAILURE: Build failed with an exception.

Perhaps we have to set up the tests from ground up.

BTW: I'm more familiar with TestNG.

Greets

Uwe

On 05.11.18 17:58, Jiri Peinlich wrote:
> I have pushed another branch testing-gradle, in that branch I have
> used JUnit5 parametrized tests to run two of the testsuites from the
> test data directory. borders.txt and datc_v2.4_06.txt. I extracted
> parts of the code that is in the TestSuite class in the mist package
> and used it to create nice list of test cases from both test data
> directories.
>
> you can run the test cases by running /gradlew build/.
>
> Note that in the datc_v2.4_06.txt there is a testcase (number 75 -
> name 6.e.4) that causes some strange infinite loop in the engine. I
> had to limit the execution of testcases to let the build finish. You
> will see one failed test when you run the build command.
>
> Please try it out and let me know if it does not work.
>
>
> Overall I would say that the original testing code (and therefore also
> DATCTest#compareState method) will need some refactoring but at least
> now we can decide which test cases we want to run during build and
> which not. and we can be reasonably sure we did not break too much
> when we refactor the code.
> --
> You received this message because you are subscribed to the Google
> Groups "jDip Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jdip-develope...@googlegroups.com
> <mailto:jdip-develope...@googlegroups.com>.
> To post to this group, send email to jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jdip-developers/3ea0995f-5a5e-4154-899c-a49c507996a0%40googlegroups.com
> <https://groups.google.com/d/msgid/jdip-developers/3ea0995f-5a5e-4154-899c-a49c507996a0%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Jiri Peinlich

unread,
Nov 5, 2018, 3:06:04 PM11/5/18
to Uwe Plonus, jdip-de...@googlegroups.com
When run using the gitlab pipeline im now getting:
183 tests completed, 1 failed

To unsubscribe from this group and stop receiving emails from it, send an email to jdip-develope...@googlegroups.com.
To post to this group, send email to jdip-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jdip-developers/f8ea698d-36f2-1592-c2a8-abcb6d6cb719%40gmail.com.

Uwe Plonus

unread,
Nov 5, 2018, 3:09:00 PM11/5/18
to jdip-de...@googlegroups.com
That's a good result.

Perhaps we disable the one failing test for the moment and after we
fixed it we can enable it again.

I will try to fix the artifacts paths now and when I got it then I will
go back to the page again.

Uwe
> <mailto:jdip-developers%2Bunsu...@googlegroups.com>
> > <mailto:jdip-develope...@googlegroups.com
> <mailto:jdip-developers%2Bunsu...@googlegroups.com>>.
> > To post to this group, send email to
> jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>
> > <mailto:jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/jdip-developers/3ea0995f-5a5e-4154-899c-a49c507996a0%40googlegroups.com
>
> >
> <https://groups.google.com/d/msgid/jdip-developers/3ea0995f-5a5e-4154-899c-a49c507996a0%40googlegroups.com?utm_medium=email&utm_source=footer>.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "jDip Developers" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to jdip-develope...@googlegroups.com
> <mailto:jdip-developers%2Bunsu...@googlegroups.com>.
> To post to this group, send email to
> jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>.
> To view this discussion on the web visit
> --
> You received this message because you are subscribed to the Google
> Groups "jDip Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jdip-develope...@googlegroups.com
> <mailto:jdip-develope...@googlegroups.com>.
> To post to this group, send email to jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jdip-developers/CAL%3D2rQWZBYn6cE4fvZZvSMO8OKyT8txWqJmzdi-Jv92f%2B2t6Kw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jdip-developers/CAL%3D2rQWZBYn6cE4fvZZvSMO8OKyT8txWqJmzdi-Jv92f%2B2t6Kw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Uwe Plonus

unread,
Nov 5, 2018, 3:25:11 PM11/5/18
to jdip-de...@googlegroups.com
I merged the branch jdip_168r1-gradle but did not remove the branch
because we still have some subprojects to migrate.

Now I will go on with the page.

Uwe

On 05.11.18 21:05, Jiri Peinlich wrote:
> <mailto:jdip-developers%2Bunsu...@googlegroups.com>
> > <mailto:jdip-develope...@googlegroups.com
> <mailto:jdip-developers%2Bunsu...@googlegroups.com>>.
> > To post to this group, send email to
> jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>
> > <mailto:jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/jdip-developers/3ea0995f-5a5e-4154-899c-a49c507996a0%40googlegroups.com
>
> >
> <https://groups.google.com/d/msgid/jdip-developers/3ea0995f-5a5e-4154-899c-a49c507996a0%40googlegroups.com?utm_medium=email&utm_source=footer>.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "jDip Developers" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to jdip-develope...@googlegroups.com
> <mailto:jdip-developers%2Bunsu...@googlegroups.com>.
> To post to this group, send email to
> jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>.
> To view this discussion on the web visit
> --
> You received this message because you are subscribed to the Google
> Groups "jDip Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jdip-develope...@googlegroups.com
> <mailto:jdip-develope...@googlegroups.com>.
> To post to this group, send email to jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jdip-developers/CAL%3D2rQWZBYn6cE4fvZZvSMO8OKyT8txWqJmzdi-Jv92f%2B2t6Kw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jdip-developers/CAL%3D2rQWZBYn6cE4fvZZvSMO8OKyT8txWqJmzdi-Jv92f%2B2t6Kw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

kk gc

unread,
Nov 5, 2018, 9:30:49 PM11/5/18
to jDip Developers
Hi,

I confirmed that test case fiilure two years ago, and then I tried to
fix that error. However, it was too difficult. I couldn't fix.

(I wrote another adjucator in Scala. I know that the test case is
correct by my that.)
--
Takaki,


2018年11月6日火曜日 2時14分29秒 UTC+9 Jiri Peinlich:

Uwe Plonus

unread,
Nov 6, 2018, 10:04:22 AM11/6/18
to jDip Developers
I will look at the problem this evening.

Uwe

Uwe Plonus

unread,
Nov 6, 2018, 5:29:24 PM11/6/18
to jdip-de...@googlegroups.com
Hi,

I found the infinite loop and added a work around to break this rule.

Now all test cases are enabled (except orders.txt, which has a different
syntax) and run through.

Can please anybody review my changes (a merge request is opened).

Uwe
> you can run the test cases by running /gradlew build/.
>
> Note that in the datc_v2.4_06.txt there is a testcase
> (number 75 - name 6.e.4) that causes some strange infinite
> loop in the engine. I had to limit the execution of
> testcases to let the build finish. You will see one failed
> test when you run the build command.
>
> Please try it out and let me know if it does not work.
>
>
> Overall I would say that the original testing code (and
> therefore also DATCTest#compareState method) will need
> some refactoring but at least now we can decide which test
> cases we want to run during build and which not. and we
> can be reasonably sure we did not break too much when we
> refactor the code.
>
> --
> You received this message because you are subscribed to the Google
> Groups "jDip Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jdip-develope...@googlegroups.com
> <mailto:jdip-develope...@googlegroups.com>.
> To post to this group, send email to jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jdip-developers/44032bbb-4352-4726-8a0f-4de4fcc24f9e%40googlegroups.com
> <https://groups.google.com/d/msgid/jdip-developers/44032bbb-4352-4726-8a0f-4de4fcc24f9e%40googlegroups.com?utm_medium=email&utm_source=footer>.

Jiri Peinlich

unread,
Nov 6, 2018, 5:41:09 PM11/6/18
to Uwe Plonus, jdip-de...@googlegroups.com
Looks good to me

To unsubscribe from this group and stop receiving emails from it, send an email to jdip-develope...@googlegroups.com.
To post to this group, send email to jdip-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jdip-developers/f09d9372-9af3-0274-6024-601ec5ecbcb1%40gmail.com.

Uwe Plonus

unread,
Nov 6, 2018, 5:41:37 PM11/6/18
to Jiri Peinlich, jdip-de...@googlegroups.com
I will then merge and remove the testing branch also.
> <mailto:jdip-developers%2Bunsu...@googlegroups.com>
> > <mailto:jdip-develope...@googlegroups.com
> <mailto:jdip-developers%2Bunsu...@googlegroups.com>>.
> > To post to this group, send email to
> jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>
> > <mailto:jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/jdip-developers/44032bbb-4352-4726-8a0f-4de4fcc24f9e%40googlegroups.com
>
> >
> <https://groups.google.com/d/msgid/jdip-developers/44032bbb-4352-4726-8a0f-4de4fcc24f9e%40googlegroups.com?utm_medium=email&utm_source=footer>.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "jDip Developers" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to jdip-develope...@googlegroups.com
> <mailto:jdip-developers%2Bunsu...@googlegroups.com>.
> To post to this group, send email to
> jdip-de...@googlegroups.com
> <mailto:jdip-de...@googlegroups.com>.
> To view this discussion on the web visit
Reply all
Reply to author
Forward
0 new messages