From 14b6666e746d7a3815de539d1fa674d7bffb98e0 Mon Sep 17 00:00:00 2001 From: andrewyuq <89420755+andrewyuq@users.noreply.github.com> Date: Wed, 1 Mar 2023 12:49:00 -0800 Subject: [PATCH] Setup CodeWhisperer path in code coverage tool (#3488) Co-authored-by: Richard Li Co-authored-by: Richard Li <742829+rli@users.noreply.github.com> --- buildspec/linuxTests.yml | 1 + codecov.yml | 12 ++++++++++++ .../codewhisperer/service/CodeWhispererService.kt | 1 - 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/buildspec/linuxTests.yml b/buildspec/linuxTests.yml index 76c9b33d23..e0c4fe3e0c 100644 --- a/buildspec/linuxTests.yml +++ b/buildspec/linuxTests.yml @@ -33,6 +33,7 @@ phases: - CI_BUILD_ID="${CODEBUILD_BUILD_ID}" - test -n "$CODE_COV_TOKEN" && curl -Os https://uploader.codecov.io/latest/linux/codecov && chmod +x codecov || true # this sometimes times out but we don't want to fail the build - test -n "$CODE_COV_TOKEN" && test -n "$CODEBUILD_BUILD_SUCCEEDING" && ./codecov -t $CODE_COV_TOKEN -F unittest || true + - test -n "$CODE_COV_TOKEN" && test -n "$CODEBUILD_BUILD_SUCCEEDING" && ./codecov -t $CODE_COV_TOKEN -F codewhisperer || true post_build: commands: diff --git a/codecov.yml b/codecov.yml index b56cec11dd..cd234eeca1 100644 --- a/codecov.yml +++ b/codecov.yml @@ -4,6 +4,7 @@ codecov: notify: require_ci_to_pass: no + max_report_age: off coverage: precision: 2 @@ -20,6 +21,12 @@ coverage: only_pulls: true flags: - "unittest" + codewhisperer: + target: 75% + paths: + - "**/src/software/aws/toolkits/jetbrains/services/codewhisperer/*" + flags: + - "codewhisperer" patch: default: threshold: 1 @@ -41,3 +48,8 @@ ignore: - "sdk-codegen/**/*" - "jetbrains-rider/**/*.Generated.kt" - "**/TelemetryDefinitions.kt" + +flags: + codewhisperer: + paths: + - "**/src/software/aws/toolkits/jetbrains/services/codewhisperer/" diff --git a/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt b/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt index 82b6c3313a..01948a3db9 100644 --- a/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt +++ b/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt @@ -448,7 +448,6 @@ class CodeWhispererService { } private fun checkRecommendationsValidity(states: InvocationContext, showHint: Boolean): Boolean { - val userInput = states.recommendationContext.userInputSinceInvocation val details = states.recommendationContext.details // set to true when at least one is not discarded or empty