Ignore not working for files in a swift project

Description

my codecov only have ignores… that are not ignored.

Repository

private

CI/CD

Bitrise

Uploader

bitrise codecov step

Commit SHAs

66edad602172f241d6f225a5a881e5443311ef92

Codecov YAML

ignore:

  • “./DnDCharacterTests/.*”
  • “./**/*View.swift”

Codecov Output

==> Bitrise CI detected.
project root: .
→ token set from env
Yaml found at: codecov.yml
==> Processing Xcode reports via llvm-cov
DerivedData folder: /Users/vagrant/Library/Developer/Xcode/DerivedData
hint Speed up Swift processing by using use -J ‘AppName’ (regexp accepted)
hint This will remove Pods/ from your report. Also Ignoring Paths
+ Building reports for D&DCharacter app
+ Building reports for XCTAutomationSupport framework
error: /Users/vagrant/Library/Developer/Xcode/DerivedData/D&DCharacter-aqrfrrjsymakwxcpjudkpdeftcmx/Build/Products/Debug-iphonesimulator/D&DCharacter.app/Frameworks/XCTAutomationSupport.framework/XCTAutomationSupport: Failed to load coverage: Unknown architecture named:
x> llvm-cov failed to produce results for /Users/vagrant/Library/Developer/Xcode/DerivedData/D&DCharacter-aqrfrrjsymakwxcpjudkpdeftcmx/Build/Products/Debug-iphonesimulator/D&DCharacter.app/Frameworks/XCTAutomationSupport.framework/XCTAutomationSupport
+ Building reports for XCTest framework
error: /Users/vagrant/Library/Developer/Xcode/DerivedData/D&DCharacter-aqrfrrjsymakwxcpjudkpdeftcmx/Build/Products/Debug-iphonesimulator/D&DCharacter.app/Frameworks/XCTest.framework/XCTest: Failed to load coverage: Unknown architecture named:
x> llvm-cov failed to produce results for /Users/vagrant/Library/Developer/Xcode/DerivedData/D&DCharacter-aqrfrrjsymakwxcpjudkpdeftcmx/Build/Products/Debug-iphonesimulator/D&DCharacter.app/Frameworks/XCTest.framework/XCTest
+ Building reports for D&DCharacterTests xctest
→ Running gcov for Obj-C
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
→ Found 4 reports
==> Detecting git/mercurial file structure
==> Reading reports
- Skipping empty file ./XCTAutomationSupport.framework.coverage.txt
+ ./D&DCharacterTests.xctest.coverage.txt bytes=418254
+ ./D&DCharacter.app.coverage.txt bytes=5466
- Skipping empty file ./XCTest.framework.coverage.txt
==> Appending adjustments
Fixing Reports
+ Found adjustments
==> Gzipping contents
==> Uploading reports
url: https://codecov.io
query: branch=develop&commit=66edad602172f241d6f225a5a881e5443311ef92&build=12&build_url=https%3A%2F%2Fapp.bitrise.io%2Fbuild%2F68c129405033b388&name=&tag=&slug=gringoireDM%2FDnDCharacter&service=bitrise&flags=&pr=&job=
→ Pinging Codecov
https://codecov.io/upload/v4?package=bash-20200629-ffaf297&token=secret&branch=develop&commit=66edad602172f241d6f225a5a881e5443311ef92&build=12&build_url=https%3A%2F%2Fapp.bitrise.io%2Fbuild%2F68c129405033b388&name=&tag=&slug=gringoireDM%2FDnDCharacter&service=bitrise&flags=&pr=&job=
→ Uploading to
https://storage.googleapis.com/codecov/v4/raw/2020-07-04/EEFE3F80731D961903571385FF4338F9/66edad602172f241d6f225a5a881e5443311ef92/a9593806-dbb9-40dc-9378-cf28102c291e.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQX6OZVJGHKK3633AAFGLBUCOOATRACRQRQF6HMSMLYUP6EAD6XSWAAY%2F20200704%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20200704T172215Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=55e091e5d139aeb528d1ef414e9109b4568c0772d02244e3d36be6149151c091
% 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 79846 0 0 100 79846 0 896k --:–:-- --:–:-- --:–:-- 886k
100 79846 0 0 100 79846 0 186k --:–:-- --:–:-- --:–:-- 186k
→ View reports at Codecov

Steps to Reproduce

N/A

Expected behavior: I expect all the files ending with View.swift and and files in the DnDCharacterTests to be ignored.

Actual behavior: *View.swift files are not ignored and show 0% of code coverage lowering the overall code coverage. Also files in the test folder are not ignored, even if the yml file is recognised and viewable in the repository settings section.

Flakiness? NO. Reproducible 100% of times

Hi @gringoireDM, thanks for this. The ignores should work, but there seems to be another issue. I’ll work on figuring out the root cause and get back to you.

1 Like

Hi @gringoireDM, looks like there is an issue with your codecov.yml. In your ignore you use DnD... as opposed to D&D...

The problem was actually with View files. I mean it existed also with tests in the D&D… folder, but also with the *View.swift files.

I had to move files around to get it working properly. There is something wrong with the ignore.

Hi @gringoireDM, apologies here this got lost. I notice you are still using ignore, but I’m not sure if you are still having issues. Would you be able to point me to a recent commit where we are not properly ignoring a file?