2016-10-24 11 views
0

circleci config file입니다 실패 :테스트 여기

@Test 
public void test_ListRepos_ClickOnOneRepo_DisplayDetailWithOnlyThisRepo() { 
    Given: 
    { 
     final String lsOneRepoJSONData = mLocalifyClient.localify().loadRawFile(fr.guddy.androidstarter.test.R.raw.repos_octocat); 
     final MockResponse loMockResponseWithOneRepo = new MockResponse().setResponseCode(200); 
     loMockResponseWithOneRepo.setBody(lsOneRepoJSONData); 
     mMockWebServer.enqueue(loMockResponseWithOneRepo); 
     try { 
      mMockWebServer.start(4000); 
     } catch (@NonNull final Exception loException) { 
      loException.printStackTrace(); 
     } 
     mActivity = mActivityTestRule.launchActivity(null); 
    } 

    When: 
    { 
     mSolo.clickOnText("git-consortium"); 
    } 

    Then: 
    { 
     mSolo.assertCurrentActivity("should be on ActivityRepoDetail", ActivityRepoDetail.class); 
     final boolean lbFoundTheRepo = mSolo.waitForText("This repo is for demonstration purposes only.", 1, 5000L, true); 
     assertThat(lbFoundTheRepo).isTrue(); 
    } 
} 

다음과 같은 빌드에 나는 테스트 실패를 얻을 : 여기

# Build configuration file for Circle CI 
# needs to be named `circle.yml` and should be in the top level dir of the repo 

general: 
    artifacts: 
    - "~/build_output.zip" # Save APK's, Lint Results, and Test Results 

machine: 
    environment: 
    ANDROID_HOME: /usr/local/android-sdk-linux 
    java: 
    version: oraclejdk8 

dependencies: 
    cache_directories: 
    - ~/.android 
    - ~/android 
    override: 
    - (echo "Downloading Android SDK v24...") 
    - (source environmentSetup.sh && getAndroidSDK) 

test: 
    override: 
    # start the emulator 
    - emulator -avd circleci-android22 -no-audio -no-window: 
     background: true 
     parallel: true 
    # wait for it to have booted 
    - circle-android wait-for-boot 
    # unlock the emulator screen 
    - sleep 30 
    - adb shell input keyevent 82 
    # run tests against the emulator. 
    - ./gradlew connectedAndroidTest 
    # run jUnit tests 
    - ./gradlew test 
    # copy the build outputs to artifacts 
    - cp -r app/build/outputs $CIRCLE_ARTIFACTS 
    # copy the test results to the test results directory. 
    - cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS 

test method입니다 https://circleci.com/gh/RoRoche/AndroidStarter/tree/master

동일한 명령을 로컬에서 실행하면 다음 결과가 표시됩니다.

junit.framework.AssertionFailedError: 
[ 
GIVEN A single GitHub repo from the API 
WHEN Click on its name and on the back button 
THEN It should display the list 
] 
[ 
Message: Text string: 'git-consortium' is not found! 
] 
at junit.framework.Assert.fail(Assert.java:50) 
at com.robotium.solo.Clicker.clickOnText(Clicker.java:451) 
at com.robotium.solo.Solo.clickOnText(Solo.java:1502) 
at fr.guddy.androidstarter.tests.ui.TestActivityRepoList.test_DetailRepos_ClickOnBack_DisplayListRepos(TestActivityRepoList.java:156) 

전달할 수 있도록 circleci 빌드를 어떻게 구성 할 수 있습니까? 미리 감사드립니다.

답변

0

실패한 빌드 중 맨 위를 보면 "빌드가 1 컨테이너의 메모리 제한 인 4G를 초과했습니다."라는 메시지가 표시됩니다.

빌드가 메모리가 부족합니다. 가능하다면 사용 된 메모리의 양을 줄이려고 노력했습니다 (https://circleci.com/docs/oom/). 이것이 블로거 (Android에서 발생하는 경우도 있음) 인 경우 CircleCI 지원 팀에 문의하여 도움을받을 수 있는지 확인합니다.

+0

다음 안내를 따르면 내 빌드가 통과됩니다. https://circleci.com/docs/oom/ –

+0

감사합니다. 답변을 업데이트했습니다. – FelicianoTech