From bd3886106799c1fc6c94724aecb7ee8d0b03b61c Mon Sep 17 00:00:00 2001 From: Eli Polonsky Date: Mon, 6 Jan 2025 11:16:22 +0200 Subject: [PATCH] chore: codecov includes files outside of configured packages (#32748) The [addition](https://github.com/aws/aws-cdk/pull/32641) of `aws-cdk-lib/core` caused other files from `aws-cdk-lib` to be included in the [report](https://app.codecov.io/github/aws/aws-cdk/tree/main/packages%2Faws-cdk-lib). ![image](https://github.com/user-attachments/assets/5584f55f-9dcd-4afe-829a-ce39cc140e43) The undesired included files are those that are imported by `aws-cdk-lib/core` unit tests. And since they are in the same package, they are included in the jest report. We could exclude them from jest, but that would mean changing the coverage settings for the entire `aws-cdk-lib` package. Instead, we can ask codecov to ignore them. Compare the previous report with this [one](https://app.codecov.io/github/iliapolo/aws-cdk/commit/8263d053b52ca94db42fa9d04c2481dfac5d54ee/tree/packages/aws-cdk-lib), from my fork, that tests the new configuration. ![image](https://github.com/user-attachments/assets/63f24fa5-9e8f-439a-8b19-f876a171e5a9) --- codecov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/codecov.yml b/codecov.yml index b73c1ed223090..f16ecc1f3df22 100644 --- a/codecov.yml +++ b/codecov.yml @@ -37,3 +37,4 @@ component_management: # https://docs.codecov.com/docs/ignoring-paths ignore: - packages/aws-cdk/lib/cli.ts # we integ test this file + - ^(?!.*packages\/(aws-cdk|aws-cdk-lib\/core)\/).+$ # ignore anything that isn't in the cli or core