Generate test coverage with Jacoco and Circle CI fails











up vote
3
down vote

favorite












Am trying to generate a test coverage in the Circle CI with this file config.yml, but the build fails and it says No connected devices.
Below is the error generated on Circle CI :



enter image description here



And according to what I read Circle CI doesn't support Emulators currently.



Below is my config.yml file :



version: 2
jobs:
build:
working_directory: ~/ConvergeLevelApp
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
CC_TEST_REPORTER_ID: 403xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ADB_INSTALL_TIMEOUT: 60
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies

- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}

- run:
name: Setup Code Climate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter

- run:
name: Run Tests
command: ./gradlew lint test

- store_artifacts:
path: app/build/reports
destination: reports

- store_test_results:
path: app/build/test-results

- run:
name: Generate JaCoCo report
command: ./gradlew jacocoTestReport
- run:
name: Upload coverage to code climate
command: |
export JACOCO_SOURCE_PATH=app/src/main/java
./cc-test-reporter format-coverage app/build/reports/coverage/debug/report.xml -t jacoco
./cc-test-reporter upload-coverage









share|improve this question















This question had a bounty worth +50
reputation from Lutaaya Huzaifah Idris that ended 16 hours ago. Grace period ends in 7 hours


Looking for an answer drawing from credible and/or official sources.












  • 1




    Can you run "adb devices" command and see it is showing device or not?
    – jitesh mohite
    Nov 19 at 4:11










  • How can I do that please @jiteshmohite?
    – Lutaaya Huzaifah Idris
    Nov 19 at 5:51










  • Please open terminal and type above-mentioned adb command.
    – jitesh mohite
    Nov 19 at 7:51










  • First make sure your device is connected with PC then all thing should work.
    – Chetan Joshi
    Nov 22 at 7:05










  • Actually locally jacoco works better and provides the test coverage well when my emulator is running, but it seems version of CIrcle CI no longer supports emulators to run.
    – Lutaaya Huzaifah Idris
    Nov 22 at 7:19

















up vote
3
down vote

favorite












Am trying to generate a test coverage in the Circle CI with this file config.yml, but the build fails and it says No connected devices.
Below is the error generated on Circle CI :



enter image description here



And according to what I read Circle CI doesn't support Emulators currently.



Below is my config.yml file :



version: 2
jobs:
build:
working_directory: ~/ConvergeLevelApp
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
CC_TEST_REPORTER_ID: 403xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ADB_INSTALL_TIMEOUT: 60
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies

- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}

- run:
name: Setup Code Climate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter

- run:
name: Run Tests
command: ./gradlew lint test

- store_artifacts:
path: app/build/reports
destination: reports

- store_test_results:
path: app/build/test-results

- run:
name: Generate JaCoCo report
command: ./gradlew jacocoTestReport
- run:
name: Upload coverage to code climate
command: |
export JACOCO_SOURCE_PATH=app/src/main/java
./cc-test-reporter format-coverage app/build/reports/coverage/debug/report.xml -t jacoco
./cc-test-reporter upload-coverage









share|improve this question















This question had a bounty worth +50
reputation from Lutaaya Huzaifah Idris that ended 16 hours ago. Grace period ends in 7 hours


Looking for an answer drawing from credible and/or official sources.












  • 1




    Can you run "adb devices" command and see it is showing device or not?
    – jitesh mohite
    Nov 19 at 4:11










  • How can I do that please @jiteshmohite?
    – Lutaaya Huzaifah Idris
    Nov 19 at 5:51










  • Please open terminal and type above-mentioned adb command.
    – jitesh mohite
    Nov 19 at 7:51










  • First make sure your device is connected with PC then all thing should work.
    – Chetan Joshi
    Nov 22 at 7:05










  • Actually locally jacoco works better and provides the test coverage well when my emulator is running, but it seems version of CIrcle CI no longer supports emulators to run.
    – Lutaaya Huzaifah Idris
    Nov 22 at 7:19















up vote
3
down vote

favorite









up vote
3
down vote

favorite











Am trying to generate a test coverage in the Circle CI with this file config.yml, but the build fails and it says No connected devices.
Below is the error generated on Circle CI :



enter image description here



And according to what I read Circle CI doesn't support Emulators currently.



Below is my config.yml file :



version: 2
jobs:
build:
working_directory: ~/ConvergeLevelApp
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
CC_TEST_REPORTER_ID: 403xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ADB_INSTALL_TIMEOUT: 60
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies

- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}

- run:
name: Setup Code Climate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter

- run:
name: Run Tests
command: ./gradlew lint test

- store_artifacts:
path: app/build/reports
destination: reports

- store_test_results:
path: app/build/test-results

- run:
name: Generate JaCoCo report
command: ./gradlew jacocoTestReport
- run:
name: Upload coverage to code climate
command: |
export JACOCO_SOURCE_PATH=app/src/main/java
./cc-test-reporter format-coverage app/build/reports/coverage/debug/report.xml -t jacoco
./cc-test-reporter upload-coverage









share|improve this question













Am trying to generate a test coverage in the Circle CI with this file config.yml, but the build fails and it says No connected devices.
Below is the error generated on Circle CI :



enter image description here



And according to what I read Circle CI doesn't support Emulators currently.



Below is my config.yml file :



version: 2
jobs:
build:
working_directory: ~/ConvergeLevelApp
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
CC_TEST_REPORTER_ID: 403xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ADB_INSTALL_TIMEOUT: 60
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies

- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}

- run:
name: Setup Code Climate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter

- run:
name: Run Tests
command: ./gradlew lint test

- store_artifacts:
path: app/build/reports
destination: reports

- store_test_results:
path: app/build/test-results

- run:
name: Generate JaCoCo report
command: ./gradlew jacocoTestReport
- run:
name: Upload coverage to code climate
command: |
export JACOCO_SOURCE_PATH=app/src/main/java
./cc-test-reporter format-coverage app/build/reports/coverage/debug/report.xml -t jacoco
./cc-test-reporter upload-coverage






java android jacoco circleci






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 at 15:34









Lutaaya Huzaifah Idris

1,0242829




1,0242829






This question had a bounty worth +50
reputation from Lutaaya Huzaifah Idris that ended 16 hours ago. Grace period ends in 7 hours


Looking for an answer drawing from credible and/or official sources.








This question had a bounty worth +50
reputation from Lutaaya Huzaifah Idris that ended 16 hours ago. Grace period ends in 7 hours


Looking for an answer drawing from credible and/or official sources.










  • 1




    Can you run "adb devices" command and see it is showing device or not?
    – jitesh mohite
    Nov 19 at 4:11










  • How can I do that please @jiteshmohite?
    – Lutaaya Huzaifah Idris
    Nov 19 at 5:51










  • Please open terminal and type above-mentioned adb command.
    – jitesh mohite
    Nov 19 at 7:51










  • First make sure your device is connected with PC then all thing should work.
    – Chetan Joshi
    Nov 22 at 7:05










  • Actually locally jacoco works better and provides the test coverage well when my emulator is running, but it seems version of CIrcle CI no longer supports emulators to run.
    – Lutaaya Huzaifah Idris
    Nov 22 at 7:19
















  • 1




    Can you run "adb devices" command and see it is showing device or not?
    – jitesh mohite
    Nov 19 at 4:11










  • How can I do that please @jiteshmohite?
    – Lutaaya Huzaifah Idris
    Nov 19 at 5:51










  • Please open terminal and type above-mentioned adb command.
    – jitesh mohite
    Nov 19 at 7:51










  • First make sure your device is connected with PC then all thing should work.
    – Chetan Joshi
    Nov 22 at 7:05










  • Actually locally jacoco works better and provides the test coverage well when my emulator is running, but it seems version of CIrcle CI no longer supports emulators to run.
    – Lutaaya Huzaifah Idris
    Nov 22 at 7:19










1




1




Can you run "adb devices" command and see it is showing device or not?
– jitesh mohite
Nov 19 at 4:11




Can you run "adb devices" command and see it is showing device or not?
– jitesh mohite
Nov 19 at 4:11












How can I do that please @jiteshmohite?
– Lutaaya Huzaifah Idris
Nov 19 at 5:51




How can I do that please @jiteshmohite?
– Lutaaya Huzaifah Idris
Nov 19 at 5:51












Please open terminal and type above-mentioned adb command.
– jitesh mohite
Nov 19 at 7:51




Please open terminal and type above-mentioned adb command.
– jitesh mohite
Nov 19 at 7:51












First make sure your device is connected with PC then all thing should work.
– Chetan Joshi
Nov 22 at 7:05




First make sure your device is connected with PC then all thing should work.
– Chetan Joshi
Nov 22 at 7:05












Actually locally jacoco works better and provides the test coverage well when my emulator is running, but it seems version of CIrcle CI no longer supports emulators to run.
– Lutaaya Huzaifah Idris
Nov 22 at 7:19






Actually locally jacoco works better and provides the test coverage well when my emulator is running, but it seems version of CIrcle CI no longer supports emulators to run.
– Lutaaya Huzaifah Idris
Nov 22 at 7:19














1 Answer
1






active

oldest

votes

















up vote
0
down vote













It's suggested to use Buddybuild for emulators over Circle CI




Buddybuild has been able to boot an emulator just fine, but the nature of my project doesn't work well with them. I'd suggest that if you aren't building a library, try buddybuild







share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53303703%2fgenerate-test-coverage-with-jacoco-and-circle-ci-fails%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    It's suggested to use Buddybuild for emulators over Circle CI




    Buddybuild has been able to boot an emulator just fine, but the nature of my project doesn't work well with them. I'd suggest that if you aren't building a library, try buddybuild







    share|improve this answer

























      up vote
      0
      down vote













      It's suggested to use Buddybuild for emulators over Circle CI




      Buddybuild has been able to boot an emulator just fine, but the nature of my project doesn't work well with them. I'd suggest that if you aren't building a library, try buddybuild







      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        It's suggested to use Buddybuild for emulators over Circle CI




        Buddybuild has been able to boot an emulator just fine, but the nature of my project doesn't work well with them. I'd suggest that if you aren't building a library, try buddybuild







        share|improve this answer












        It's suggested to use Buddybuild for emulators over Circle CI




        Buddybuild has been able to boot an emulator just fine, but the nature of my project doesn't work well with them. I'd suggest that if you aren't building a library, try buddybuild








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        user7294900

        18.5k93056




        18.5k93056






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53303703%2fgenerate-test-coverage-with-jacoco-and-circle-ci-fails%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            If I really need a card on my start hand, how many mulligans make sense? [duplicate]

            Alcedinidae

            Can an atomic nucleus contain both particles and antiparticles? [duplicate]