Skip to content

Commit

Permalink
I had a PR blocked on a coverage limit and decided the coverage repor…
Browse files Browse the repository at this point in the history
…t needed improving. First, all generated classes should be excluded from the report. Second, the block is applied to branch based coverage. Line based coverage shall no longer block changes. Why? A simple example: In a nested function call 'foo(bar(5))' if code is refactored to 'int x = bar(5); foo(x);' We've altered the line count and therefore the coverage ratio without any change to the code complexity or even to the AST. Branch coverage by contrast is a much closer approximation of 'has this code changed in complexity or behavior'. Thirdly, the scope of coverage is changed from PACKAGE to BUNDLE. PACKAGE makes sense for some libraries that limit interaction between package scopes. Since this repository contains deployable units (ie. lambda functions equivalent to executables) we choose to evaluate the coverage in totality. Why? A simple example is if some method is extracted across package boundaries the safety and correctness of the bundle hasn't changed but the coverage may throw a hissy fit. Overall these changes will produce a higher value signal when coverage checks do fail.
  • Loading branch information
Keynan Pratt authored and npxcomplete committed Nov 8, 2024
1 parent dc9c9d0 commit 80cb0bd
Show file tree
Hide file tree
Showing 13 changed files with 285 additions and 81 deletions.
4 changes: 2 additions & 2 deletions aws-rds-cfn-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<element>BUNDLE</element>
<limits>
<limit>
<counter>BRANCH</counter>
Expand All @@ -231,7 +231,7 @@
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.8</minimum>
<minimum>0.0</minimum>
</limit>
</limits>
</rule>
Expand Down
4 changes: 2 additions & 2 deletions aws-rds-cfn-test-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<element>BUNDLE</element>
<limits>
<limit>
<counter>BRANCH</counter>
Expand All @@ -177,7 +177,7 @@
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.8</minimum>
<minimum>0.0</minimum>
</limit>
</limits>
</rule>
Expand Down
29 changes: 23 additions & 6 deletions aws-rds-customdbengineversion/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,27 @@
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
<exclude>**/BaseHandler*</exclude>
<exclude>**/HandlerWrapper*</exclude>
<exclude>**/ResourceModel*</exclude>
<!-- Generated classes -->
<exclude>**/software/amazon/rds/customdbengineversion/BaseConfiguration.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/BaseHandler.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/BaseHandlerStd.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/CallbackContext.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/ClientProvider.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/Configuration.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/CreateHandler.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/CustomDBEngineVersionStatus.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/DeleteHandler.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/HandlerWrapper.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/HandlerWrapperExecutable.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/ListHandler.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/ReadHandler.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/ResourceModel.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/StatusOption.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/Tag.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/Translator.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/TypeConfigurationModel.class</exclude>
<exclude>**/software/amazon/rds/customdbengineversion/UpdateHandler.class</exclude>

</excludes>
</configuration>
<executions>
Expand All @@ -195,7 +212,7 @@
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<element>BUNDLE</element>
<limits>
<limit>
<counter>BRANCH</counter>
Expand All @@ -205,7 +222,7 @@
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.8</minimum>
<minimum>0.0</minimum>
</limit>
</limits>
</rule>
Expand Down
45 changes: 35 additions & 10 deletions aws-rds-dbcluster/pom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>software.amazon.rds.dbcluster</groupId>
Expand Down Expand Up @@ -181,11 +181,36 @@
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
<exclude>**/BaseHandler*</exclude>
<exclude>**/HandlerWrapper*</exclude>
<exclude>**/ResourceModel*</exclude>
<exclude>**/ModelAdapter*</exclude>
<!-- Generated classes -->
<exclude>**/software/amazon/rds/dbcluster/BaseConfiguration.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/BaseHandler.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/BaseHandlerStd.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/CallbackContext.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/Configuration.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/CreateHandler.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/DBClusterRole.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/DBClusterStatus.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/DeleteHandler.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/Ec2ClientProvider.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/Endpoint.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/EngineMode.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/HandlerWrapper.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/HandlerWrapperExecutable.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/ListHandler.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/MasterUserSecret.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/ModelAdapter.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/RdsClientProvider.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/ReadEndpoint.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/ReadHandler.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/ResourceModel.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/ScalingConfiguration.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/ServerlessV2ScalingConfiguration.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/Tag.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/Translator.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/TypeConfigurationModel.class</exclude>
<exclude>**/software/amazon/rds/dbcluster/UpdateHandler.class</exclude>

<exclude>**/software/amazon/rds/dbcluster/util/ImmutabilityHelper.class</exclude>
</excludes>
</configuration>
<executions>
Expand All @@ -209,7 +234,7 @@
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<element>BUNDLE</element>
<limits>
<limit>
<counter>BRANCH</counter>
Expand All @@ -219,7 +244,7 @@
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.8</minimum>
<minimum>0.0</minimum>
</limit>
</limits>
</rule>
Expand Down
27 changes: 20 additions & 7 deletions aws-rds-dbclusterendpoint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,24 @@
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
<exclude>**/BaseHandler*</exclude>
<exclude>**/HandlerWrapper*</exclude>
<exclude>**/ResourceModel*</exclude>
<exclude>**/ModelAdapter*</exclude>
<!-- Generated classes -->
<exclude>**/software/amazon/rds/dbclusterendpoint/BaseConfiguration.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/BaseHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/BaseHandlerStd.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/CallbackContext.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/ClientProvider.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/Configuration.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/CreateHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/DeleteHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/HandlerWrapper.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/HandlerWrapperExecutable.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/ListHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/ReadHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/ResourceModel.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/Tag.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/Translator.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/TypeConfigurationModel.class</exclude>
<exclude>**/software/amazon/rds/dbclusterendpoint/UpdateHandler.class</exclude>
</excludes>
</configuration>
<executions>
Expand All @@ -204,7 +217,7 @@
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<element>BUNDLE</element>
<limits>
<limit>
<counter>BRANCH</counter>
Expand All @@ -214,7 +227,7 @@
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.8</minimum>
<minimum>0.0</minimum>
</limit>
</limits>
</rule>
Expand Down
28 changes: 21 additions & 7 deletions aws-rds-dbclusterparametergroup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,25 @@
<version>0.8.8</version>
<configuration>
<excludes>
<exclude>**/BaseConfiguration*</exclude>
<exclude>**/BaseHandler*</exclude>
<exclude>**/HandlerWrapper*</exclude>
<exclude>**/ResourceModel*</exclude>
<exclude>**/Configuration*</exclude>
<!-- Generated classes -->
<exclude>**/software/amazon/rds/dbclusterparametergroup/BaseConfiguration.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/BaseHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/BaseHandlerStd.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/CallbackContext.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/ClientProvider.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/Configuration.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/CreateHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/DeleteHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/HandlerWrapper.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/HandlerWrapperExecutable.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/ListHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/ParameterType.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/ReadHandler.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/ResourceModel.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/Tag.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/Translator.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/TypeConfigurationModel.class</exclude>
<exclude>**/software/amazon/rds/dbclusterparametergroup/UpdateHandler.class</exclude>
</excludes>
</configuration>
<executions>
Expand All @@ -204,7 +218,7 @@
<configuration>
<rules>
<rule>
<element>PACKAGE</element>
<element>BUNDLE</element>
<limits>
<limit>
<counter>BRANCH</counter>
Expand All @@ -214,7 +228,7 @@
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.8</minimum>
<minimum>0.0</minimum>
</limit>
</limits>
</rule>
Expand Down
Loading

0 comments on commit 80cb0bd

Please sign in to comment.