Description
I am setting up my config.yml file for Circle CI.
The cc-test-reporter command fails.
config.yml file
version: 2
jobs:
build:
working_directory: ~/mva
docker:
- image: circleci/android:api-28
environment:
JVM_OPTS: -Xmx2048m
CC_TEST_REPORTER_ID: XXXXXXXXXXX
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
# - run:
# name: Chmod permissions #if permission for Gradlew Dependencies fail, use this.
# command: sudo chmod +x ./gradlew
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
# - run:
# name: Run Lint Tests
# command: ./gradlew lint test
# - run:
# name: Run Instrument Tests
# command: ./gradlew connectedAndroidTest
#Run coverage report for Code Climate
- run:
name: Setup Code Climate test-reporter
command: |
# download test reporter as a static binary
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-0.6.3-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
when: always
- run:
name: Run Tests
command: ./gradlew test
- run:
name: code-coverage
command: |
./cc-test-reporter after-build -d -t cobertura --exit-code $?
when: always
- store_artifacts: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
path: app/build/reports
destination: app/reports
- store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
path: build/test-results
# See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples
Logs on Circle CI
#!/bin/bash -eo pipefail
./cc-test-reporter after-build -d -t cobertura --exit-code $?
DEBU[0000] about to run format-coverage
DEBU[0000] using formatter cobertura
DEBU[0000] checking search path for cobertura formatter
DEBU[0000] checking search path cobertura.xml for cobertura formatter
DEBU[0000] checking search path cobertura.ser for cobertura formatter
ERRO[0000] could not find coverage file
could not find any files in search paths for cobertura. search paths were: , cobertura.xml, cobertura.ser
Error: could not find any files in search paths for cobertura. search paths were: , cobertura.xml, cobertura.ser
Usage:
cc-test-reporter after-build [flags]
Flags:
-s, --batch-size int batch size for source files (default 500)
-e, --coverage-endpoint string endpoint to upload coverage information to (default "https://api.codeclimate.com/v1/test_reports")
-t, --coverage-input-type string type of input source to use [clover, cobertura, coverage.py, excoveralls, gcov, gocov, jacoco, lcov, simplecov]
--exit-code int exit code of the test run
-r, --id string reporter identifier (default "")
--insecure send coverage insecurely (without HTTPS)
-p, --prefix string the root directory where the coverage analysis was performed (default "/home/circleci/mva")
Global Flags:
-d, --debug run in debug mode
Exited with code 255
My CircleCI repo https://circleci.com/gh/mindvalley/Mobile_Android_MVA/2038