ksoichiro/gradle-web-resource-plugin

Running tests problems.

sratatata opened this issue · 7 comments

I'm trying to run Spock tests.

Also tests are running only with gradlew (not my local gradle, which throws java.lang.NoClassDefFoundError: Could not initialize class org.gradle.testfixtures.internal.TestGlobalScopeServices - especially from inside of intellij)

ABut sitll something is not working.
I''ve problems with root privilages, are they necessary?
Cause some files during npmSetup are created with root privilages. I need to change file ownership before running npmSetup.

How are you runing setups? Do you know what could making things complicated? Could you make sure that tests runs on other machines also? It would be easier for people to join your project.

Thx:)

From intellij 33/34 are failing.

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/lb_lb/.gradle/wrapper/dists/gradle-2.8-all/ah86jmo43de9lfa8xg9ux3c4h/gradle-2.8/lib/plugins/sonar/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/lb_lb/.gradle/wrapper/dists/gradle-2.8-all/ah86jmo43de9lfa8xg9ux3c4h/gradle-2.8/lib/gradle-core-2.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/lb_lb/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.7.2/760055906d7353ba4f7ce1b8908bc6b2e91f39fa/slf4j-simple-1.7.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

java.lang.ExceptionInInitializerError
    at org.gradle.testfixtures.internal.ProjectBuilderImpl.getGlobalServices(ProjectBuilderImpl.java:92)
    at org.gradle.testfixtures.internal.ProjectBuilderImpl.createProject(ProjectBuilderImpl.java:75)
    at org.gradle.testfixtures.ProjectBuilder.build(ProjectBuilder.java:99)
    at com.github.ksoichiro.web.resource.ExtensionSpec.propertyMissing(ExtensionSpec.groovy:12)
Caused by: java.lang.ClassCastException: ch.qos.logback.classic.Logger cannot be cast to org.gradle.api.logging.Logger
    at org.gradle.api.logging.Logging.getLogger(Logging.java:42)
    at org.gradle.internal.service.scopes.GlobalScopeServices.<clinit>(GlobalScopeServices.java:75)
    ... 4 more


java.lang.NoClassDefFoundError: Could not initialize class org.gradle.testfixtures.internal.TestGlobalScopeServices

    at org.gradle.testfixtures.internal.ProjectBuilderImpl.getGlobalServices(ProjectBuilderImpl.java:92)
    at org.gradle.testfixtures.internal.ProjectBuilderImpl.createProject(ProjectBuilderImpl.java:75)
    at org.gradle.testfixtures.ProjectBuilder.build(ProjectBuilder.java:99)
    at com.github.ksoichiro.web.resource.ExtensionSpec.methodMissing(ExtensionSpec.groovy:30)


java.lang.NoClassDefFoundError: Could not initialize class org.gradle.testfixtures.internal.TestGlobalScopeServices

    at org.gradle.testfixtures.internal.ProjectBuilderImpl.getGlobalServices(ProjectBuilderImpl.java:92)
    at org.gradle.testfixtures.internal.ProjectBuilderImpl.createProject(ProjectBuilderImpl.java:75)
    at org.gradle.testfixtures.ProjectBuilder.build(ProjectBuilder.java:99)
    at com.github.ksoichiro.web.resource.ExtensionSpec.methodMissing with undefined property(ExtensionSpec.groovy:45)

Nope couple of hours and still tests are not working.

Test runs works only on gradlew. Local gradle(2.10) fails still.

Sorry, I should write contributing.md to develop on this project.

I always execute tests on terminal (Mac) with following command:

./gradlew clean check

I haven't tried builds on other machines, but at least on Travis CI, linux container build projects without errors for most of the times...

Oh, I finally understood what you meant. Sorry I misread it.
The problem is, Gradle wrapper in this project can run tests successfully
but other Gradle (such as locally installed Gradle v2.10) causes tests failure, is this right?

As I wrote above, I always use Gradle wrapper (gradlew) in the project
and I don't want to support other ways such as using locally installed Gradle
because it sometimes causes this kind of problem.
(I must write this to the contribution guide.)

Is gradlew not enough for you?
On IntelliJ IDEA, I think you can configure IntelliJ project to use gradle wrapper
from preference screen (open Build, Execution, Deployment > Build Tools > Gradle, then select Use default gradle wrapper (recommended)),
so if you can successfully run tests with gradle wrapper,
I think this problem could be solved.

I would check this..
I did oposite always have been using local gradle. But I'm just a guest:)

I've been using default gradle wrapper in intellij, but there was some issues. But it was a lot of thoughs. I would check it after work again.

I found in travis config that you are not doing anything special with this test runs. And it works there. Maybe I've some other issue there.

Thank you for your quick reply.

I did oposite always have been using local gradle.

Oh really?! I've been thought that it's natural to use gradle wrapper...
Anyway I really have to write about this kind of things to the project documentation.

I've been using default gradle wrapper in intellij, but there was some issues. But it was a lot of thoughs. I would check it after work again.

Thank you. I'll wait for your check before merging your PR(#10).

I found in travis config that you are not doing anything special with this test runs. And it works there. Maybe I've some other issue there.

Thanks, I've just merged your second PR about this.