简体   繁体   English

Jenkins失败的robolectric测试案例......!

[英]Jenkins failing robolectric test cases…!

I am trying to build my android project on Jenkins 2.0 server on Ubuntu machine. 我想在Ubuntu机器上的Jenkins 2.0服务器上构建我的android项目。

I am running the following commands for that purpose:- 我正在为此目的运行以下命令: -

  1. ./gradlew clean (this is working fine) ./gradlew clean(这个工作正常)
  2. ./gradlew build (this is failing random number of test cases) ./gradlew build(这是随机数量的测试用例失败)

However I also install Jenkins 2.0 on my Windows 7 machine and run the same commands as above, and it was passing all test cases every time. 但是我也在我的Windows 7机器上安装Jenkins 2.0并运行与上面相同的命令,并且每次都传递所有测试用例。 I am not understanding what is wrong with that. 我不明白这有什么问题。

I did lot of debugging but could not find any solution, please help me to get rid out of this thing...! 我做了很多调试但找不到任何解决方案,请帮我摆脱这件事......!

This is my 34th build log on Jenkins 这是我在Jenkins上的第34个构建日志

testPreCondition FAILED
    java.lang.NullPointerException at ConfigurationFragmentTest.java:36

handleBackButtonPressing FAILED
    java.lang.NullPointerException at ConfigurationFragmentTest.java:36

48 tests completed, 2 failed
:app:testDebugUnitTest FAILED

This is my 35th build log on Jenkins without making any code changes 这是我在Jenkins上的第35个构建日志,没有进行任何代码更改

    > handleBackButtonPressing FAILED
            java.lang.NullPointerException at ConfigurationFragmentTest.java:36

    > testPreCondition FAILED
            java.lang.NullPointerException at ConfigurationFragmentTest.java:36

      > testPreconditions FAILED
            java.lang.NullPointerException at UpdateTabFragmentTest.java:30

      > testPreconditions FAILED
            java.lang.NullPointerException at ServiceTabFragmentTest.java:29

      > testPreConditionIsNotNull FAILED
            java.lang.NullPointerException at HomeActivityTest.java:63
 48 tests completed, 5 failed
 :app:testDebugUnitTest FAILED

这是我收到错误的测试类之一

You should check the Jenkins console output for something like "WARNING: No manifest file found " in the console output. 您应该在控制台输出中检查Jenkins控制台输出,例如“警告:找不到清单文件”。

Those NPEs are typical for missing resources. 那些NPE是缺少资源的典型。

The most common source for failing robolectric builds on different environmnets is probably robolectric not beeing able to load any resources. 在不同的环境中构建失败的robolectric的最常见来源可能是robolectric无法加载任何资源。

Since robolectric needs to know where your Android Manifest is, you may have to provide a extra robolectric.properties for the build 由于robolectric需要知道Android Manifest的位置,因此您可能需要为构建提供额外的robolectric.properties

http://robolectric.org/configuring/ http://robolectric.org/configuring/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM