Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] cargoStartLocal executing tests before fully deployed #86

Closed
vicros0716 opened this issue Apr 20, 2014 · 1 comment
Closed

[Bug] cargoStartLocal executing tests before fully deployed #86

vicros0716 opened this issue Apr 20, 2014 · 1 comment

Comments

@vicros0716
Copy link

I believe there may be a bug with the plugin where the cargoStartLocal task is considered complete after the container starts, but before the war is deployed.

I have the following build.gradle

cargo {
    containerId = 'wildfly8x'
    port = 9090

    deployable {
        file = file(project(':presentation').buildDir.toString() + '/libs/ROOT.war')
    }

    local {
        installer {
            installUrl = 'http://download.jboss.org/wildfly/8.0.0.Final/wildfly-8.0.0.Final.zip'
            downloadDir = file("$buildDir/download")
            extractDir = file("$buildDir/extract")
        }
    }
}

cargoStartLocal.dependsOn project(':presentation').tasks.assemble
test.dependsOn cargoStartLocal
test.finalizedBy cargoStopLocal

and I'm seeing the following when I run ./gradlew build --stacktrace -i

....
22:05:27,768 INFO  [org.jboss.ws.common.management] (MSC service thread 1-7) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.3.Final
22:05:28,319 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017534: Registered web context: /cargocpc
WildFly 8.x started on port [9090]
:integration:cargoStartLocal (Thread[Daemon Thread 4,5,main]) completed. Took 7.491 secs.
:integration:compileTestJava (Thread[Daemon Thread 4,5,main]) started.
:integration:compileTestJava
Executing task ':integration:compileTestJava' (up-to-date check took 0.043 secs) due to:
  Input file /home/vicros/IdeaProjects/sirenia/integration/src/test/java/org/sireniaballroomcm/CompetitionLifecycleTest.java has changed.
Compiling with JDK Java compiler API.
22:05:28,624 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011401: Read persistence.xml for sirenia
:integration:compileTestJava (Thread[Daemon Thread 4,5,main]) completed. Took 0.47 secs.
:integration:processTestResources (Thread[Daemon Thread 4,5,main]) started.
:integration:processTestResources
Skipping task ':integration:processTestResources' as it has no source files.
:integration:processTestResources UP-TO-DATE
:integration:processTestResources (Thread[Daemon Thread 4,5,main]) completed. Took 0.017 secs.
:integration:testClasses (Thread[Daemon Thread 4,5,main]) started.
:integration:testClasses
Skipping task ':integration:testClasses' as it has no actions.
:integration:testClasses (Thread[Daemon Thread 4,5,main]) completed. Took 0.005 secs.
:integration:test (Thread[Daemon Thread 4,5,main]) started.
:integration:test
22:05:28,902 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 55) JBAS011409: Starting Persistence Unit (phase 1 of 2) Service 'ROOT.war#sirenia'
22:05:28,937 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 55) HHH000204: Processing PersistenceUnitInfo [
    name: sirenia
    ...]
22:05:29,156 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 55) HHH000412: Hibernate Core {4.3.1.Final}
22:05:29,160 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 55) HHH000206: hibernate.properties not found
22:05:29,162 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 55) HHH000021: Bytecode provider name : javassist
Executing task ':integration:test' (up-to-date check took 0.402 secs) due to:
  Output file /home/vicros/IdeaProjects/sirenia/integration/build/reports/tests/packages/org.sireniaballroomcm.html has changed.
  Output file /home/vicros/IdeaProjects/sirenia/integration/build/test-results/TEST-org.sireniaballroomcm.CompetitionLifecycleTest.xml has changed.
  Output file /home/vicros/IdeaProjects/sirenia/integration/build/reports/tests/classes/org.sireniaballroomcm.CompetitionLifecycleTest.html has changed.
Starting process 'Gradle Worker 1'. Working directory: /home/vicros/IdeaProjects/sirenia/integration Command: /usr/lib/jvm/jdk1.8.0/bin/java -Djava.security.manager=jarjar.org.gradle.process.internal.child.BootstrapSecurityManager -Dfile.encoding=UTF-8 -ea -cp /home/vicros/.gradle/caches/1.11/workerMain/gradle-worker.jar jarjar.org.gradle.process.internal.launcher.GradleWorkerMain
22:05:29,427 INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016002: Processing weld deployment ROOT.war
Successfully started process 'Gradle Worker 1'
22:05:29,553 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-8) HV000001: Hibernate Validator 5.0.3.Final
...
:integration:test FAILED
:integration:test (Thread[Daemon Thread 4,5,main]) completed. Took 3.562 secs.
:integration:cargoStopLocal (Thread[Daemon Thread 4,5,main]) started.
:integration:cargoStopLocal
...
22:05:36,946 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017534: Registered web context: /
22:05:36,989 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "ROOT.war" (runtime-name : "ROOT.war")
22:05:36,990 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 29) JBAS018559: Deployed "cargocpc.war" (runtime-name : "cargocpc.war")
22:05:37,061 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017535: Unregistered web context: /
22:05:37,060 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017535: Unregistered web context: /cargocpc
...

From what I can tell, my tests run shortly after the container starts up, but before my war file is deployed.

Please let me know if there's something I should adjust in my configuration or if you need more details.

Thanks!

@vicros0716
Copy link
Author

Bah! I should have looked just a little longer. I see that this is expected behavior from Cargo that the pingUrl is supposed to prevent.

+1 to this feature request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant