Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Ignore paths" not working with custom Codecov config file location #1465

Open
Splines opened this issue Jun 1, 2024 · 1 comment
Open
Assignees
Labels
Area: Report Upload Issues with pre-ingest report uploading bug Something isn't working Medium Medium Priority Issues (to be fixed or re-evaluated in 3 months

Comments

@Splines
Copy link

Splines commented Jun 1, 2024

With these lines in our GitHub actions workflow, we report our test coverage to codecov.

      - name: Report test coverage to codecov
        uses: codecov/codecov-action@v4
        with:
          fail_ci_if_error: true
          files: ./coverage/coverage.xml
          token: ${{ secrets.CODECOV_TOKEN }}
          verbose: true
          codecov_yml_path: ./.config/codecov.yml

Note that we're using codecov_yml_path to refer to a custom location of the codecov.yml file inside a .config/ folder. The file is recognized as can be seen in the last GitHub Actions run here:

debug - 2024-06-01 14:01:52,870 -- Loading config from .config/codecov.yml

Inside the .config/codecov.yml file, we specify that the spec/ folder should be ignored entirely by codecov as we don't want our test files themselves to contribute to the coverage statistics.

# Ignore test files themselves in the Codecov report
# see: https://about.codecov.io/blog/should-i-include-test-files-in-code-coverage-calculations/
ignore:
  - "../spec/**/*"
  - "**/*_spec.rb"

However, in the codecov dashboard, we still see the spec/ folder and all of its contents in the code tree.

Some questions

  • From the "Ignoring paths" documentation page, it's not clear whether we should use ../spec/**/* or ./spec/**/* when a custom location for the codecov.yml file is set up. Both variants don't seem to work for us. Maybe it's something obvious that I can't see?
  • Should the file coverage.xml only contain results that are not ignored by Codecov? Or is Codecov smart enough to filter this according to the ignore key in the codecov.yml file?
@Splines Splines changed the title Ignore paths does not ignore path with custom Codecov config file location Ignore paths not working with custom Codecov config file location Jun 1, 2024
@Splines Splines changed the title Ignore paths not working with custom Codecov config file location "Ignore paths" not working with custom Codecov config file location Jun 2, 2024
@thomasrockhu-codecov thomasrockhu-codecov added the bug Something isn't working label Jun 11, 2024
@thomasrockhu-codecov thomasrockhu-codecov self-assigned this Jun 26, 2024
@Splines
Copy link
Author

Splines commented Jul 8, 2024

Hey, just let me know if there's any information missing that you need to track down the bug.

@thomasrockhu-codecov thomasrockhu-codecov added Medium Medium Priority Issues (to be fixed or re-evaluated in 3 months Area: Report Upload Issues with pre-ingest report uploading labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Report Upload Issues with pre-ingest report uploading bug Something isn't working Medium Medium Priority Issues (to be fixed or re-evaluated in 3 months
Projects
None yet
Development

No branches or pull requests

2 participants