Get badges for a specific directories

Hello,

Description

I have a project with frontend and backend directories and I would like to show the coverage separatly.

So I have 4 reports :
I run unit and functional tests in backend code.
I run unit and e2e tests in frontend code.

I then created 6 tags :

  • one for each report (front-unit, front-e2e, back-unit, back-functional)
  • frontend and backend

When I upload the reports I associate the following tags
Backend functional tests report => backend,back-functional
Backend unit tests report => backend,back-unit
Frontend e2e tests report => frontend,back-e2e
Frontend unit tests report => frontend,back-unit

I’ve created this yml file : template-symfony-vuejs/codecov.yml at master · mp3000mp/template-symfony-vuejs · GitHub

Commit SHAs

d5375ee49feca5dd5708fededca1e68c39ee77f8

Repository

CI/CD or Build URL

Github action :
back: codecov badge test · mp3000mp/template-symfony-vuejs@d5375ee · GitHub
front: codecov badge test · mp3000mp/template-symfony-vuejs@d5375ee · GitHub

Uploader

Bash

Codecov Output

bash <(curl -s https://codecov.io/bash) -F backend,back-functional -f "./ci/coverage/functional/clover.xml"
  shell: /usr/bin/bash -e {0}

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-1.0.2


==> git version 2.31.1 found
==> curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
==> GitHub Actions detected.
    Env vars used:
      -> GITHUB_ACTIONS:    true
      -> GITHUB_HEAD_REF:   
      -> GITHUB_REF:        refs/heads/master
      -> GITHUB_REPOSITORY: mp3000mp/template-symfony-vuejs
      -> GITHUB_RUN_ID:     835515086
      -> GITHUB_SHA:        d5375ee49feca5dd5708fededca1e68c39ee77f8
      -> GITHUB_WORKFLOW:   Backend CI
    project root: /home/runner/work/template-symfony-vuejs/template-symfony-vuejs
    Yaml found at: codecov.yml
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./ci/coverage/functional/clover.xml bytes=28015
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
find: ‘./deployment/docker/mariadb_test/db/mysql’: Permission denied
find: ‘./deployment/docker/mariadb_test/db/db_test’: Permission denied
find: ‘./deployment/docker/mariadb_test/db/performance_schema’: Permission denied
find: ‘./deployment/docker/mariadb_test/db/mysql’: Permission denied
find: ‘./deployment/docker/mariadb_test/db/db_test’: Permission denied
find: ‘./deployment/docker/mariadb_test/db/performance_schema’: Permission denied
find: ‘./deployment/docker/mariadb_test/db/mysql’: Permission denied
find: ‘./deployment/docker/mariadb_test/db/db_test’: Permission denied
find: ‘./deployment/docker/mariadb_test/db/performance_schema’: Permission denied

    + Found adjustments
==> Gzipping contents
        24K	/tmp/codecov.eufLHk.gz
==> Uploading reports
    url: https://codecov.io
    query: branch=master&commit=d5375ee49feca5dd5708fededca1e68c39ee77f8&build=835515086&build_url=http%3A%2F%2Fgithub.com%2Fmp3000mp%2Ftemplate-symfony-vuejs%2Factions%2Fruns%2F835515086&name=&tag=&slug=mp3000mp%2Ftemplate-symfony-vuejs&service=github-actions&flags=backend,back-functional&pr=&job=Backend%20CI&cmd_args=F,f
->  Pinging Codecov
https://codecov.io/upload/v4?package=bash-1.0.2&token=secret&branch=master&commit=d5375ee49feca5dd5708fededca1e68c39ee77f8&build=835515086&build_url=http%3A%2F%2Fgithub.com%2Fmp3000mp%2Ftemplate-symfony-vuejs%2Factions%2Fruns%2F835515086&name=&tag=&slug=mp3000mp%2Ftemplate-symfony-vuejs&service=github-actions&flags=backend,back-functional&pr=&job=Backend%20CI&cmd_args=F,f
->  Uploading to
https://storage.googleapis.com/codecov/v4/raw/2021-05-12/44B7AB162A85CFBC0A698311CA5E5D6A/d5375ee49feca5dd5708fededca1e68c39ee77f8/f37ce4d2-d669-46be-8f8f-675704592385.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQM3VGPYSAFECJRMNAFIPCV2R3P2BOORCJC7NM537NPJQSFLHUDNIDWA%2F20210512%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20210512T125751Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=848c2ac207c2e16ea9ab6f41b552cd63e5acbdcf7a29116915f1ff4c4efb6735
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 22639    0     0  100 22639      0   149k --:--:-- --:--:-- --:--:--  149k
    -> Reports have been successfully queued for processing at https://codecov.io/github/mp3000mp/template-symfony-vuejs/commit/d5375ee49feca5dd5708fededca1e68c39ee77f8

Expected Results

I would expect the backend coverage to be the union of back-unit and back-functional coverage and the frontend to be the union of front-unit and front-e2e. But it’s not.

Actual Results

It seems backend and frontend keep the coverage of the first report uploaded with these tags :

Backend badge (4%) => https://codecov.io/gh/mp3000mp/template-symfony-vuejs/branch/master/graph/badge.svg?token=O10BZ8VXSB&flag=backend
Back-functional badge (87%) => https://codecov.io/gh/mp3000mp/template-symfony-vuejs/branch/master/graph/badge.svg?token=O10BZ8VXSB&flag=back-functional
Back-unit badge (4%) => https://codecov.io/gh/mp3000mp/template-symfony-vuejs/branch/master/graph/badge.svg?token=O10BZ8VXSB&flag=back-unit
Frontend badge (40%) => https://codecov.io/gh/mp3000mp/template-symfony-vuejs/branch/master/graph/badge.svg?token=O10BZ8VXSB&flag=frontend
Front-e2e badge (52%) => https://codecov.io/gh/mp3000mp/template-symfony-vuejs/branch/master/graph/badge.svg?token=O10BZ8VXSB&flag=front-e2e
Front-unit badge (40%) => https://codecov.io/gh/mp3000mp/template-symfony-vuejs/branch/master/graph/badge.svg?token=O10BZ8VXSB&flag=front-unit

Additional Information

A turnover would be to be able to specify the path in the query string of the badge because the coverage seems good here : Code coverage done right.

Frontend: 51%
Backend: 87%

But I didn’t notice anything like this in the documentation.

Do you have an idea about this behavior and how I could turn around ?

Hi @mp3000mp, sorry for taking so long. I think what you are running into is this issue. Would you be able to see if running the action multiple times (one per flag) fixes this issue? I’d like to try to update the action to upload multiple times as opposed to having to do it yourself.