Skip to content

Commit

Permalink
Exclude test, samples, and 3rd party code from code coverage (#3120)
Browse files Browse the repository at this point in the history
* Exclude test, samples, and 3rd party code from code coverage

* Update min coverage requirement to a true one

Co-authored-by: Anton Kolesnyk <[email protected]>
  • Loading branch information
antkmsft and antkmsft authored Nov 18, 2021
1 parent ea9c1ef commit a831b4b
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion sdk/core/azure-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ target_include_directories(
add_library(Azure::azure-core ALIAS azure-core)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(core azure-core azure-core-test)
create_code_coverage(core azure-core azure-core-test "tests?/*;samples?/*;inc/azure/core/internal/json/json.hpp")

target_link_libraries(azure-core INTERFACE Threads::Threads)

Expand Down
3 changes: 1 addition & 2 deletions sdk/identity/azure-identity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ add_library(azure-identity ${AZURE_IDENTITY_HEADER} ${AZURE_IDENTITY_SOURCE})
# make sure that users can consume the project as a library.
add_library(Azure::azure-identity ALIAS azure-identity)

create_code_coverage(identity azure-identity azure-identity-test)
create_code_coverage(identity azure-identity-livetest azure-identity-livetest)
create_code_coverage(identity azure-identity azure-identity-test "tests?/*;samples?/*")

target_include_directories(
azure-identity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ target_include_directories(
target_link_libraries(azure-security-keyvault-certificates PUBLIC Azure::azure-core)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(keyvault azure-security-keyvault-certificates azure-security-keyvault-certificates-test)
create_code_coverage(keyvault azure-security-keyvault-certificates azure-security-keyvault-certificates-test "tests?/*;samples?/*")

get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private/package_version.hpp")
generate_documentation(azure-security-keyvault-certificates ${AZ_LIBRARY_VERSION})
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/azure-security-keyvault-keys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ target_include_directories(
target_link_libraries(azure-security-keyvault-keys PUBLIC Azure::azure-core)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(keyvault azure-security-keyvault-keys azure-security-keyvault-keys-test)
create_code_coverage(keyvault azure-security-keyvault-keys azure-security-keyvault-keys-test "tests?/*;samples?/*")

get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private/package_version.hpp")
generate_documentation(azure-security-keyvault-keys ${AZ_LIBRARY_VERSION})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ target_include_directories(
target_link_libraries(azure-security-keyvault-secrets PUBLIC Azure::azure-core)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(keyvault azure-security-keyvault-secrets azure-security-keyvault-secrets-test)
create_code_coverage(keyvault azure-security-keyvault-secrets azure-security-keyvault-secrets-test "tests?/*;samples?/*")

get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private/package_version.hpp")
generate_documentation(azure-security-keyvault-secrets ${AZ_LIBRARY_VERSION})
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ stages:
LiveTestCtestRegex: "azure-security-keyvault.*"
LiveTestTimeoutInMinutes: 120
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
LineCoverageTarget: 37
LineCoverageTarget: 35
BranchCoverageTarget: 15
Artifacts:
- Name: azure-security-keyvault-keys
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blobs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ az_rtti_setup(
)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(storage azure-storage-blobs azure-storage-test)
create_code_coverage(storage azure-storage-blobs azure-storage-test "tests?/*;samples?/*")

if(BUILD_TESTING)
target_sources(
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ az_rtti_setup(

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
# excluding json from coverage report
create_code_coverage(storage azure-storage-common azure-storage-test "inc/azure/storage/common/json*")
create_code_coverage(storage azure-storage-common azure-storage-test "tests?/*;samples?/*")

if(BUILD_TESTING)
target_sources(
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-files-datalake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ az_rtti_setup(
)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(storage azure-storage-files-datalake azure-storage-test)
create_code_coverage(storage azure-storage-files-datalake azure-storage-test "tests?/*;samples?/*")

if(BUILD_TESTING)
target_sources(
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-files-shares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ az_rtti_setup(
)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(storage azure-storage-files-shares azure-storage-test)
create_code_coverage(storage azure-storage-files-shares azure-storage-test "tests?/*;samples?/*")

if(BUILD_TESTING)
target_sources(
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-queues/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ az_rtti_setup(
)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(storage azure-storage-queues azure-storage-test)
create_code_coverage(storage azure-storage-queues azure-storage-test "tests?/*;samples?/*")

if(BUILD_TESTING)
target_sources(
Expand Down
4 changes: 2 additions & 2 deletions sdk/template/azure-template/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ target_include_directories(
add_library(Azure::azure-template ALIAS azure-template)

# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
create_code_coverage(template azure-template azure-template-test)
create_code_coverage(template azure-template azure-template-test "tests?/*;samples?/*")

get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private//package_version.hpp")
get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private/package_version.hpp")
generate_documentation(azure-template ${AZ_LIBRARY_VERSION})

az_vcpkg_export(
Expand Down

0 comments on commit a831b4b

Please sign in to comment.