Capítulo 6.7 Erro ao gerar build utilizando Jenkins

42 views
Skip to first unread message

Fabio Schiozer

unread,
Sep 23, 2016, 4:22:48 AM9/23/16
to Livro "Devops na Prática"
Pessoal,

Estou com problemas para gerar o build através do Jenkins, já procurei na internet, menciona um problema com Maven. Por fim, tentei rodar o maven fora do Jenkins e também o mesmo erro. Aí fiz a alteração da memória para 1G e funcionou. Porém, no Jenkins ainda não estou conseguindo.


[JENKINS] Recording test results
[INFO] [war:war {execution: default-war}]
[INFO] Packaging webapp
[INFO] Assembling webapp [site] in [/var/lib/jenkins/workspace/loja-virtual-devops2/site/target/devopsnapratica]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/lib/jenkins/workspace/loja-virtual-devops2/site/src/main/webapp]
[INFO] Webapp assembled in [1926 msecs]
[INFO] Building war: /var/lib/jenkins/workspace/loja-virtual-devops2/site/target/devopsnapratica.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] [hsqldb:start {execution: start-hsqldb}]
[INFO] HSQLDB server started on jdbc:hsqldb:hsql://localhost/broadleaf
[INFO] [cargo:start {execution: start-container}]
[INFO] [2.ContainerStartMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-jetty:jar:1.4.7 for container jetty8x
[INFO] You did not specify a container home nor any installer. CARGO will automatically download your container's binaries from [http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/8.1.14.v20131031/jetty-distribution-8.1.14.v20131031.tar.gz].
[INFO] [talledLocalContainer] Jetty 8.1.14.v20131031 starting...
[INFO] [stalledLocalDeployer] Deploying WAR by creating Jetty context XML file in [/var/lib/jenkins/workspace/loja-virtual-devops2/site/target/cargo/configurations/jetty8x/contexts/site.xml]...
[INFO] [talledLocalContainer] 2016-09-23 02:00:32.691:INFO::Redirecting stderr/stdout to /var/lib/jenkins/workspace/loja-virtual-devops2/site/target/cargo/configurations/jetty8x/logs/2016_09_23.stderrout.log
[INFO] [talledLocalContainer] Jetty 8.1.14.v20131031 started on port [7070]
[INFO] [surefire:test {execution: integration-test}]
[INFO] Surefire report directory: /var/lib/jenkins/workspace/loja-virtual-devops2/site/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running br.com.devopsnapratica.acceptance.SearchTest
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 8.688 sec <<< FAILURE!

Results :

Failed tests:   searchScenario(br.com.devopsnapratica.acceptance.SearchTest): 

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0

[JENKINS] Recording test results
[ERROR] There are test failures.

Please refer to /var/lib/jenkins/workspace/loja-virtual-devops2/site/target/surefire-reports for the individual test results.
[INFO] [cargo:stop {execution: stop-container}]
[INFO] [talledLocalContainer] Jetty 8.1.14.v20131031 is stopping...
[INFO] [talledLocalContainer] Jetty 8.1.14.v20131031 is stopped
[INFO] [install:install {execution: default-install}]
[INFO] Installing /var/lib/jenkins/workspace/loja-virtual-devops2/site/target/devopsnapratica.war to /var/lib/jenkins/.m2/repository/br/com/devopsnapratica/site/1.0/site-1.0.war
[INFO] ------------------------------------------------------------------------
[INFO] Building combined
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [keytool:clean {execution: clean}]
[WARNING] Keystore file '/var/lib/jenkins/workspace/loja-virtual-devops2/combined/target/devopsnapratica/WEB-INF/blc-example.keystore' doesn't exist.
[INFO] [keytool:genkey {execution: genkey}]
[INFO] [resources:resources {execution: default-resources}]



Seguem os logs, o erro aconteceu no testcase.


vagrant@ci:/var/lib/jenkins/workspace/loja-virtual-devops2/site/target/surefire-reports$ cat TEST-br.com.devopsnapratica.acceptance.SearchTest.xml
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite failures="1" time="8.689" errors="0" skipped="0" tests="1" name="br.com.devopsnapratica.acceptance.SearchTest">
  <properties>
    <property name="java.vendor" value="Oracle Corporation"/>
    <property name="JOB_NAME" value="loja-virtual-devops2"/>
    <property name="PWD" value="/var/lib/jenkins"/>
    <property name="sun.java.launcher" value="SUN_STANDARD"/>
    <property name="sun.management.compiler" value="HotSpot Client Compiler"/>
    <property name="JENKINS_HOME" value="/var/lib/jenkins"/>
    <property name="PATH" value="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/opt/vagrant_ruby/bin"/>
    <property name="HUDSON_SERVER_COOKIE" value="808a217dea31321a"/>
    <property name="os.name" value="Linux"/>
    <property name="sun.boot.class.path" value="/usr/lib/jvm/java-7-openjdk-i386/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/jfr.jar:/usr/lib/jvm/java-7-openjdk-i386/jre/classes"/>
    <property name="EXECUTOR_NUMBER" value="1"/>
    <property name="java.vm.specification.vendor" value="Oracle Corporation"/>
    <property name="NODE_LABELS" value="master"/>
    <property name="java.runtime.version" value="1.7.0_111-b01"/>
    <property name="user.name" value="jenkins"/>
    <property name="XDG_SESSION_COOKIE" value="1df5a2672a815ecc100c3b3c0000015d-1474592632.871541-755751048"/>
    <property name="user.language" value="en"/>
    <property name="maven.interceptor.override" value="/var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.7.jar"/>
    <property name="JOB_BASE_NAME" value="loja-virtual-devops2"/>
    <property name="BUILD_DISPLAY_NAME" value="#1"/>
    <property name="sun.boot.library.path" value="/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386"/>
    <property name="java.version" value="1.7.0_111"/>
    <property name="user.timezone" value="Etc/UTC"/>
    <property name="sun.arch.data.model" value="32"/>
    <property name="NODE_NAME" value="master"/>
    <property name="TERM" value="linux"/>
    <property name="java.endorsed.dirs" value="/usr/lib/jvm/java-7-openjdk-i386/jre/lib/endorsed"/>
    <property name="BUILD_ID" value="1"/>
    <property name="sun.cpu.isalist" value=""/>
    <property name="sun.jnu.encoding" value="ISO-8859-1"/>
    <property name="file.encoding.pkg" value="sun.io"/>
    <property name="SHELL" value="/bin/bash"/>
    <property name="file.separator" value="/"/>
    <property name="java.specification.name" value="Java Platform API Specification"/>
    <property name="java.class.version" value="51.0"/>
    <property name="user.country" value="US"/>
    <property name="securerandom.source" value="file:/dev/./urandom"/>
    <property name="java.home" value="/usr/lib/jvm/java-7-openjdk-i386/jre"/>
    <property name="java.vm.info" value="mixed mode, sharing"/>
    <property name="os.version" value="3.2.0-23-generic-pae"/>
    <property name="sun.font.fontmanager" value="sun.awt.X11FontManager"/>
    <property name="path.separator" value=":"/>
    <property name="java.vm.version" value="24.111-b01"/>
    <property name="SHLVL" value="1"/>
    <property name="_" value="/usr/bin/daemon"/>
    <property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
    <property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
    <property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
    <property name="LOGNAME" value="jenkins"/>
    <property name="HOME" value="/var/lib/jenkins"/>
    <property name="maven.interceptor" value="/var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.7.jar"/>
    <property name="user.home" value="/var/lib/jenkins"/>
    <property name="BUILD_TAG" value="jenkins-loja-virtual-devops2-1"/>
    <property name="JENKINS_SERVER_COOKIE" value="808a217dea31321a"/>
    <property name="HUDSON_URL" value="http://192.168.33.16:8080/"/>
    <property name="java.specification.vendor" value="Oracle Corporation"/>
    <property name="CLASSPATH" value=""/>
    <property name="java.library.path" value="/usr/java/packages/lib/i386:/usr/lib/i386-linux-gnu/jni:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/>
    <property name="java.vendor.url" value="http://java.oracle.com/"/>
    <property name="java.vm.vendor" value="Oracle Corporation"/>
    <property name="maven.home" value="/usr/share/maven2"/>
    <property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
    <property name="sun.java.command" value="hudson.maven.agent.Main /usr/share/maven2 /var/cache/jenkins/war/WEB-INF/lib/remoting-2.62.jar /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-1.7.jar 36078"/>
    <property name="java.class.path" value="/var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven-agent-1.7.jar:/usr/share/maven2/boot/classworlds.jar"/>
    <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
    <property name="java.vm.specification.version" value="1.7"/>
    <property name="sun.cpu.endian" value="little"/>
    <property name="M2_HOME" value="/usr/share/maven2"/>
    <property name="MAIL" value="/var/mail/jenkins"/>
    <property name="sun.os.patch.level" value="unknown"/>
    <property name="java.io.tmpdir" value="/tmp"/>
    <property name="HUDSON_HOME" value="/var/lib/jenkins"/>
    <property name="PATH+MAVEN" value="/usr/share/maven2/bin"/>
    <property name="BUILD_URL" value="http://192.168.33.16:8080/job/loja-virtual-devops2/1/"/>
    <property name="." value="export MAVEN_OPTS=&quot;-Xmx1024m&quot;"/>
    <property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
    <property name="MAVEN_OPTS" value="-Xmx1024m"/>
    <property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
    <property name="os.arch" value="i386"/>
    <property name="java.ext.dirs" value="/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext:/usr/java/packages/lib/ext"/>
    <property name="user.dir" value="/var/lib/jenkins/workspace/loja-virtual-devops2"/>
    <property name="JOB_URL" value="http://192.168.33.16:8080/job/loja-virtual-devops2/"/>
    <property name="line.separator" value="
"/>
    <property name="MAVEN_HOME" value="/usr/share/maven2"/>
    <property name="java.vm.name" value="OpenJDK Client VM"/>
    <property name="BUILD_NUMBER" value="1"/>
    <property name="JENKINS_URL" value="http://192.168.33.16:8080/"/>
    <property name="GIT_BRANCH" value="origin/master"/>
    <property name="GIT_COMMIT" value="337865fa21a30fb8b36337cac98021647e03ddc2"/>
    <property name="LC_ALL" value="en_US"/>
    <property name="file.encoding" value="ISO-8859-1"/>
    <property name="LANG" value="en_US"/>
    <property name="WORKSPACE" value="/var/lib/jenkins/workspace/loja-virtual-devops2"/>
    <property name="java.specification.version" value="1.7"/>
    <property name="USER" value="jenkins"/>
    <property name="GIT_URL" value="https://github.com/schiozer/loja-virtual-devops"/>
  </properties>
  <testcase time="8.619" classname="br.com.devopsnapratica.acceptance.SearchTest" name="searchScenario">
    <failure message="
Expected: is &quot;Broadleaf Demo - Heat Clinic&quot;
     but: was &quot;Error 503 Service Unavailable&quot;" type="java.lang.AssertionError">java.lang.AssertionError:
Expected: is &quot;Broadleaf Demo - Heat Clinic&quot;
     but: was &quot;Error 503 Service Unavailable&quot;
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
        at org.junit.Assert.assertThat(Assert.java:865)
        at org.junit.Assert.assertThat(Assert.java:832)
        at br.com.devopsnapratica.acceptance.SearchTest.searchScenario(SearchTest.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
</failure>
  </testcase>
</testsuite>vagrant@ci:/var/lib/jenkins/workspace/loja-virtual-devops2/site/target/surefire-reports$ ^C

Reply all
Reply to author
Forward
0 new messages