Closed julianguyen closed 6 years ago
Hi Julia,
Thanks for providing the debug mode output. Hmm. I think you should only see that error if we can't find the repository based on the provided test report id. Do you mind sharing a bit about your CI setup, specifically how you're setting the CC_TEST_REPORTER_ID
environment variable?
Same issue for us.
CC_TEST_REPORTER_ID
is set correctly, taken from the setting of our codecov account. We followed the documentation of test-reporter but it fails.
@AlexGrs - Will you also share a bit about your CI setup, specifically how you're setting the environment variable? I'd love to see an excerpt from your .travis.yml
or circle.yml
(or similar)
I faced same issue and my config.yml is below.
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
environment:
CC_TEST_REPORTER_ID: $CODE_CLIMATE_TEST_REPORTER_ID
docker:
# specify the version you desire here
- image: circleci/node:7.10
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# install java 8
- run: echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 boolean true" > debconf.txt
- run: sudo debconf-set-selections debconf.txt
- run: sudo apt-get install software-properties-common
- run: sudo add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
- run: sudo apt-get update
- run: sudo apt-get install oracle-java8-installer
# Setup Code Climate test-reporter
- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- run: chmod +x ./cc-test-reporter
# load CircleCI environment variables
- run: export GOOGLE_API_KEY=$GOOGLE_API_KEY
# run tests!
- run: npm test
# Send test coverage to Code Climate
- run: ./cc-test-reporter after-build --coverage-input-type lcov --exit-code $?
Following up on these. @julianguyen :
@2YY :
@efueger Thanks efueger.
I merged into master and got same error from CircleCI.
HTTP 401: You are not authorized for this action
The CircleCI build is here. https://circleci.com/gh/2YY/qatool/31
I think, this problem has a concern in the CircleCI Environment.
If I config CC_TEST_REPORTER_ID by hard coding, build is pass. https://circleci.com/gh/2YY/qatool/19
But, if I config CC_TEST_REPORTER_ID by CircleCI Environment Variable, build is fail. https://circleci.com/gh/2YY/qatool/20
Thanks @2YY -
On master, can you:
CC_TEST_REPORTER_ID
Let me know how it goes!
@efueger Hi efueger!
I tried that and seems like same result.
The CircleCI build is here. https://circleci.com/gh/2YY/qatool/32
I tried below steps. Please correct me if I'm wrong.
Change the var name to CC_TEST_REPORTER_ID in my .circleci/config.yml The commit is here. https://github.com/2YY/qatool/commit/8bcfacc16a2e7e93a62494eb4a38d54edacd6eac
Add CircleCI environmental variable CC_TEST_REPORTER_ID in my CircleCI project configration (like below capture)
Almost! Can you delete the reference for the environment var in your .circleci/config.yml?
@efueger Great, works perfectly!!
My problem is solved.
Thank you for your support efueger!
@efueger thanks a lot for helping out @2YY. It solved my own problem as well .
Guess you killed many birds with one stone
@efueger thanks, this was helpful. I had the same issue.
@efueger thanks a lot for helping out @2YY. It solved my own problem as well .
Guess you killed many birds with one stone
HAHAHAHA!!!!
On master, can you: remove the hard coded CC_TEST_REPORTER_ID env var lines in your config.yml (lines 8 and 9) change the var name in your CircleCI Environmental Variable to CC_TEST_REPORTER_ID
@efueger is merging the changes into master necessary? How can I set up coverage from a feature branch?
Anyone know where this is coming from? I have the correct test report ID.
EDIT: In debug mode I get: