Skip to content

Module collision betweeen 1.2.0 and 1.2.1 ceylon.test when running tests JVM tests from 1.2.0 #2425

@lukedegruchy

Description

@lukedegruchy

Running 1.2.0 unit tests with either the production 1.2.0 ceylon command or the IDE won't work if any 1.2.1 modules exist in ~/.ceylon/repo. The only way to fix this is to remove all 1.2.1 modules from ~/.ceylon/repo. The only way to fix is to remove all 1.2.1 modules from ~/.ceylon/repo.

This affects both the IDE and the command-line.

I've run ceylon test --verbose=cmr under both cases but unfortunately this offers very little additional insight. For some reason, ceylon attempts to do this, with very little context:

Debug:  Trying repository ~/.ceylon/repo 
Debug:   -> Found at /com/redhat/ceylon/testjvm/1.2.1/com.redhat.ceylon.testjvm-1.2.1.car 

This is the unit test:

import ceylon.test {
    test,
    assertTrue
}

test
void testMe() { assertTrue(true); }

This is the error I see when running the unit test from the IDE:

ceylon.language.Exception "function luke.testMe::testMe should be annotated with test or testSuite"
    at ceylon.test.core.findCandidatesInFunction_.findCandidatesInFunction(DefaultTestRunner.ceylon:215)
    at ceylon.test.core.findCandidatesInFunction_.findCandidatesInFunction(DefaultTestRunner.ceylon:213)
    at ceylon.test.core.findCandidatesInFunctionLiteral_.findCandidatesInFunctionLiteral(DefaultTestRunner.ceylon:313)
    at ceylon.test.core.findCandidatesInTypeLiteral_.findCandidatesInTypeLiteral(DefaultTestRunner.ceylon:246)
    at ceylon.test.core.findCandidates_.findCandidates(DefaultTestRunner.ceylon:184)
    at ceylon.test.core.createExecutors_.createExecutors(DefaultTestRunner.ceylon:85)
    at ceylon.test.core.DefaultTestRunner.initExecutors$priv$(DefaultTestRunner.ceylon:43)
    at ceylon.test.core.DefaultTestRunner.<init>(DefaultTestRunner.ceylon:46)
    at ceylon.test.createTestRunner_.createTestRunner(TestRunner.ceylon:49)
    at ceylon.test.createTestRunner_.createTestRunner(TestRunner.ceylon:48)
    at com.redhat.ceylon.testjvm.Runner.run(tool.ceylon:84)
    at com.redhat.ceylon.testjvm.run_.run(tool.ceylon:36)
    at com.redhat.ceylon.testjvm.run_.main(tool.ceylon)
    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:483)
    at ceylon.modules.api.runtime.SecurityActions.invokeRunInternal(SecurityActions.java:57)
    at ceylon.modules.api.runtime.SecurityActions.invokeRun(SecurityActions.java:48)
    at ceylon.modules.api.runtime.AbstractRuntime.invokeRun(AbstractRuntime.java:75)
    at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:122)
    at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:106)
    at ceylon.modules.Main.execute(Main.java:69)
    at ceylon.modules.Main.main(Main.java:42)
    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:483)
    at org.jboss.modules.Module.run(Module.java:312)
    at org.jboss.modules.Main.main(Main.java:460)
    at ceylon.modules.bootstrap.CeylonRunTool.run(CeylonRunTool.java:244)
    at ceylon.modules.bootstrap.CeylonTestTool.run(CeylonTestTool.java:174)
    at com.redhat.ceylon.common.tools.CeylonTool.run(CeylonTool.java:491)
    at com.redhat.ceylon.common.tools.CeylonTool.execute(CeylonTool.java:380)
    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:483)
    at com.redhat.ceylon.launcher.Launcher.runInJava7Checked(Launcher.java:114)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:41)
    at com.redhat.ceylon.launcher.Launcher.run(Launcher.java:34)
    at com.redhat.ceylon.launcher.Launcher.main(Launcher.java:27)

This doesn't seem to be the case for other modules, as I was able to run a ceylon function having imported both ceylon.collection and ceylon.html and both were correctly resolved to 1.2.0 and the function ran both in the command line and IDE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions