Skip to content

Commit 034257e

Browse files
authored
ci: tweak codecoverage settings (aws#5478)
## Problem The codecoverage reports are so inconsistent, see if we can tweak their settings ## Solution - remove anything related to target, what's reported on the actions is very inconsistent - patch, changes, and comment were getting flagged by the codecoverage schema. Just set them to false instead - disable codecov for PR's and just have it reported on master
1 parent 8561028 commit 034257e

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

.github/workflows/node.js.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
env:
8585
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
8686
NODE_OPTIONS: ''
87-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
87+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
8888
uses: codecov/codecov-action@v4
8989
with:
9090
flags: macos-core-unittests
@@ -95,7 +95,7 @@ jobs:
9595
env:
9696
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
9797
NODE_OPTIONS: ''
98-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
98+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
9999
uses: codecov/codecov-action@v4
100100
with:
101101
flags: macos-toolkit-unittests
@@ -106,7 +106,7 @@ jobs:
106106
env:
107107
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
108108
NODE_OPTIONS: ''
109-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
109+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
110110
uses: codecov/codecov-action@v4
111111
with:
112112
flags: macos-amazonq-unittests
@@ -117,7 +117,7 @@ jobs:
117117
env:
118118
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
119119
NODE_OPTIONS: ''
120-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
120+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
121121
uses: codecov/codecov-action@v4
122122
with:
123123
flags: codewhisperer
@@ -176,7 +176,7 @@ jobs:
176176
env:
177177
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
178178
NODE_OPTIONS: ''
179-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
179+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
180180
uses: codecov/codecov-action@v4
181181
with:
182182
flags: windows-unittests

buildspec/linuxE2ETests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ phases:
4141
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
4242
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g')
4343
- CI_BUILD_ID="${CODEBUILD_BUILD_ID}"
44-
- test -n "${CODECOV_TOKEN}" && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/core/lcov.info --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
44+
- test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/core/lcov.info --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
4545
finally:
4646
- rm -rf ~/.aws/sso/cache || true
4747
reports:

buildspec/linuxIntegrationTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ phases:
7575
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
7676
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g')
7777
- CI_BUILD_ID="${CODEBUILD_BUILD_ID}"
78-
- test -n "${CODECOV_TOKEN}" && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/core/lcov.info --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
78+
- test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/core/lcov.info --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
7979
post_build:
8080
commands:
8181
# Destroy .netrc to avoid leaking $GITHUB_READONLY_TOKEN.

buildspec/linuxTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ phases:
4848
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
4949
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') # Encode `#` in the URL because otherwise the url is clipped in the Codecov.io site
5050
- CI_BUILD_ID="${CODEBUILD_BUILD_ID}"
51-
- test -n "${CODECOV_TOKEN}" && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/core/lcov.info --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
51+
- test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/core/lcov.info --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
5252

5353
reports:
5454
unit-test:

codecov.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ coverage:
1313
status:
1414
project:
1515
default:
16-
threshold: 1
16+
target: 70%
17+
threshold: 5%
1718
informational: true
1819
codewhisperer:
19-
target: 70%
2020
paths:
2121
- packages/core/src/codewhisperer/*
2222
flags:
2323
- 'codewhisperer'
2424
amazonqFeatureDev:
25-
target: 70%
2625
paths:
2726
- packages/core/src/amazonqFeatureDev/*
2827
flags:
@@ -37,15 +36,17 @@ coverage:
3736
paths:
3837
- packages/core/src/applicationcomposer/*
3938
stepFunctions:
39+
target: 50%
40+
threshold: 10%
4041
paths:
4142
- packages/core/src/stepFunctions/*
4243
threatComposer:
4344
paths:
4445
- packages/core/src/threatComposer/*
45-
patch: no
46-
changes: no
46+
patch: false
47+
changes: false
4748

48-
comment: off
49+
comment: false
4950

5051
github_checks:
5152
annotations: false

0 commit comments

Comments
 (0)