Invalid threshold definitions let the scorecard plugin fail to start. For the ThresholdConfigs in the code base, unit tests should assert their correctness.
Add a unit tests that calls validateThresholdNumberIntervals for each of this ThresholdConfigs:
- PERCENTAGE_THRESHOLDS in @plugins/scorecard-backend-module-code-coverage/src/metricProviders/CodeCoverageMetricProvider.ts
- DEPENDABOT_THRESHOLDS in @plugins/scorecard-backend-module-dependabot/src/metricProviders/DependabotConfig.ts
- OPENSSF_THRESHOLDS in @plugins/scorecard-backend-module-openssf/src/metricProviders/OpenSSFConfig.ts
- SONARQUBE_NUMBER_THRESHOLDS in @plugins/scorecard-backend-module-sonarqube/src/metricProviders/SonarQubeConfig.ts
- DEFAULT_NUMBER_THRESHOLDS in @plugins/scorecard-common/src/types/threshold.ts
The test just need to pass without an exception.
Invalid threshold definitions let the scorecard plugin fail to start. For the ThresholdConfigs in the code base, unit tests should assert their correctness.
Add a unit tests that calls
validateThresholdNumberIntervalsfor each of this ThresholdConfigs:The test just need to pass without an exception.