# What is wrong with my CodeCov Uploader configuration?

**URL:** <https://community.codecov.com/t/what-is-wrong-with-my-codecov-uploader-configuration/3377>\
**Category:** Support\
**Tags:** github\
**Created:** [December 3, 2021, 1:19pm UTC](https://community.codecov.com/t/what-is-wrong-with-my-codecov-uploader-configuration/3377 "2021-12-03T13:19:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdabrowski1990](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/mdabrowski1990/32/2242_2.png) [@mdabrowski1990](https://community.codecov.com/u/mdabrowski1990)\
**Post date:** [December 3, 2021, 1:19pm UTC](https://community.codecov.com/t/what-is-wrong-with-my-codecov-uploader-configuration/3377/1 "2021-12-03T13:19:07Z")

</div>

### Description

I want to configure CodeCov to measure both Unit Tests and Integration Tests coverage. I have read [Flags](https://docs.codecov.com/docs/flags) and [Uploading Reports to Codecov using the Codecov CLI](https://docs.codecov.com/docs/codecov-uploader) documentation which was both very helpful.  
Thanks to them I configured my CI (GitHub Actions) with following job:

```auto
  code_coverage:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up Python 3.9
        uses: actions/setup-python@v1
        with:
          python-version: 3.9

      - name: Install project dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install --upgrade setuptools
          pip install -r requirements.txt

      - name: Install external packages used for dynamic tests
        run: |
          pip install -r tests/requirements_for_software_tests.txt

      - name: Prepare coverage uploader [CodeCov]
        run: |
          curl -Os https://app.codecov.io/gh/mdabrowski1990/uds/uploader/linux/codecov
          chmod +x codecov

      - name: Execute unit tests [pytest]
        run: |
          pytest --cov-report=xml --cov=uds tests/software_tests -m "not integration"

      - name: Upload unit tests results [codecov]
        run: |
          ./codecov -t ${{ secrets.CODECOV_TOKEN }} --url https://app.codecov.io/gh/mdabrowski1990/uds/ -F unit-tests -f coverage.xml

      - name: Execute integration tests [pytest]
        run: |
          pytest --cov-report=xml --cov=uds tests/software_tests -m "integration"

      - name: Upload unit tests results [codecov]
        run: |
          ./codecov -t ${{ secrets.CODECOV_TOKEN }} --url https://app.codecov.io/gh/mdabrowski1990/uds/ -F integration-tests -f coverage.xml

```

### CI/CD URL

[https://github.com/mdabrowski1990/uds/runs/4408227381?check\_suite\_focus=true](https://github.com/mdabrowski1990/uds/runs/4408227381?check_suite_focus=true)

### Codecov Output

This is the output I see when I try to upload the coverage results

 ![obraz](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/2X/f/fc92c63f493718c4b260793093cda5714686d564.png)

GitHub Actions Log:

```auto
2021-12-03T12:55:59.4466456Z ##[group]Run ./codecov -t ${CODECOV_TOKEN} --url https://app.codecov.io/gh/mdabrowski1990/uds/ -F unit-tests -f coverage.xml
2021-12-03T12:55:59.4467776Z e[36;1m./codecov -t ${CODECOV_TOKEN} --url https://app.codecov.io/gh/mdabrowski1990/uds/ -F unit-tests -f coverage.xmle[0m
2021-12-03T12:55:59.4509201Z shell: /usr/bin/bash -e {0}
2021-12-03T12:55:59.4509577Z env:
2021-12-03T12:55:59.4510101Z pythonLocation: /opt/hostedtoolcache/Python/3.9.9/x64
2021-12-03T12:55:59.4510651Z ##[endgroup]
2021-12-03T12:55:59.4593950Z ./codecov: line 1: syntax error near unexpected token `<'
2021-12-03T12:55:59.4597034Z ./codecov: line 1: `<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>Codecov</title><script>;(function(w, d, s, l, i) {'
2021-12-03T12:55:59.4607875Z ##[error]Process completed with exit code 2.

```

### Expected Results

I would like to have results uploaded to CodeCov during the job.

### Actual Results

GitHub actions job raises an error due to (what seems to be) “TOKEN” issue ☹

### Additional Information

Link to my project on CodeCov: [Codecov](https://app.codecov.io/gh/mdabrowski1990/uds/)  
I have my CodeCov token configured in GitHub and named `CODECOV_TOKEN`  
I send report in Cobertura XML (XML output from pytest-cov is Cobertura, isn’t it?) format (which seems to be supported [Supported Coverage Report Formats](https://docs.codecov.com/docs/supported-report-formats))

PS. I am new to CodeCov so please forgive me if I made some rookie mistake.

---

<div class="post-metadata">

**Author:** ![mdabrowski1990](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/mdabrowski1990/32/2242_2.png) [@mdabrowski1990](https://community.codecov.com/u/mdabrowski1990)\
**Post date:** [December 3, 2021, 1:19pm UTC](https://community.codecov.com/t/what-is-wrong-with-my-codecov-uploader-configuration/3377/2 "2021-12-03T13:19:58Z")

</div>

My CodeCov token on GitHub:

 ![obraz](https://canada1.discourse-cdn.com/flex029/uploads/codecov/original/2X/c/c74a6488d5c36f22bdb879b7b12ede66ad24b0e5.png)

---

<div class="post-metadata">

**Author:** ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)\
**Post date:** [December 6, 2021, 3:45pm UTC](https://community.codecov.com/t/what-is-wrong-with-my-codecov-uploader-configuration/3377/3 "2021-12-06T15:45:01Z")

</div>

@mdabrowski1990 I think it needs to be `secrets.CODECOV_TOKEN`

---

<div class="post-metadata">

**Author:** ![mdabrowski1990](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/mdabrowski1990/32/2242_2.png) [@mdabrowski1990](https://community.codecov.com/u/mdabrowski1990)\
**Post date:** [December 7, 2021, 7:57am UTC](https://community.codecov.com/t/what-is-wrong-with-my-codecov-uploader-configuration/3377/4 "2021-12-07T07:57:20Z")

</div>

I have managed to work it around:

```auto
      - name: Upload integration tests report [CodeCov]
        uses: codecov/codecov-action@v2
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage.xml
          flags: integration-tests

```

It is not longer a problem for me.
