|
37 | 37 | <okio.version>2.4.2</okio.version> |
38 | 38 | <formatter-maven-plugin.goal>format</formatter-maven-plugin.goal> |
39 | 39 | <impsort-maven-plugin.goal>sort</impsort-maven-plugin.goal> |
40 | | - <jacoco.coverage.target.class>.80</jacoco.coverage.target.class> |
41 | | - <jacoco.coverage.target.method>0.20</jacoco.coverage.target.method> |
42 | | - <jacoco.coverage.target.line>0.50</jacoco.coverage.target.line> |
43 | | - <jacoco.coverage.target.other>0.50</jacoco.coverage.target.other> |
| 40 | + <!-- Using this as the minimum bar for code coverage. Adding methods without covering them will fail this. --> |
| 41 | + <jacoco.coverage.target.bundle.bundle.method>0.556</jacoco.coverage.target.bundle.bundle.method> |
| 42 | + <jacoco.coverage.target.class.class.method>0.25</jacoco.coverage.target.class.class.method> |
44 | 43 | <!-- For non-ci builds we'd like the build to still complete if jacoco metrics aren't met. --> |
45 | 44 | <jacoco.haltOnFailure>false</jacoco.haltOnFailure> |
46 | 45 | </properties> |
|
373 | 372 | <properties> |
374 | 373 | <formatter-maven-plugin.goal>validate</formatter-maven-plugin.goal> |
375 | 374 | <impsort-maven-plugin.goal>check</impsort-maven-plugin.goal> |
| 375 | + <enable-jacoco>true</enable-jacoco> |
| 376 | + <jacoco.haltOnFailure>true</jacoco.haltOnFailure> |
376 | 377 | </properties> |
377 | 378 | <build> |
378 | 379 | </build> |
|
412 | 413 | </goals> |
413 | 414 | <configuration> |
414 | 415 | <rules> |
| 416 | + <rule> |
| 417 | + <element>BUNDLE</element> |
| 418 | + <limits> |
| 419 | + <limit> |
| 420 | + <counter>METHOD</counter> |
| 421 | + <value>COVEREDRATIO</value> |
| 422 | + <minimum>${jacoco.coverage.target.bundle.method}</minimum> |
| 423 | + </limit> |
| 424 | + </limits> |
| 425 | + </rule> |
415 | 426 | <rule> |
416 | 427 | <!--We end up with chatty logs, but it shows us which particular classes --> |
417 | 428 | <!--are lacking in coverage. If this is too much, just remove the --> |
418 | 429 | <!--<element>CLASS</element> tag below. --> |
419 | 430 | <element>CLASS</element> |
420 | 431 | <limits> |
421 | | - <!-- These limits can be overridden, in the form of `0.50` for --> |
422 | | - <!-- 50%, as necessary. Using a property just puts it in one spot. --> |
423 | | - <!-- |
424 | | - <limit> |
425 | | - <counter>LINE</counter> |
426 | | - <value>COVEREDRATIO</value> |
427 | | - <minimum>${jacoco.coverage.target.lines}</minimum> |
428 | | - </limit> |
429 | | - --> |
430 | | - <!-- |
431 | | - <limit> |
432 | | - <counter>BRANCH</counter> |
433 | | - <value>COVEREDRATIO</value> |
434 | | - <minimum>${jacoco.coverage.target.other}</minimum> |
435 | | - </limit> |
436 | | - --> |
437 | | - <!-- |
438 | | - <limit> |
439 | | - <counter>INSTRUCTION</counter> |
440 | | - <value>COVEREDRATIO</value> |
441 | | - <minimum>${jacoco.coverage.target.other}</minimum> |
442 | | - </limit> |
443 | | - --> |
444 | | - <!-- |
445 | | - <limit> |
446 | | - <counter>COMPLEXITY</counter> |
447 | | - <value>COVEREDRATIO</value> |
448 | | - <minimum>${jacoco.coverage.target.other}</minimum> |
449 | | - </limit> |
450 | | - --> |
451 | 432 | <limit> |
452 | 433 | <counter>METHOD</counter> |
453 | 434 | <value>COVEREDRATIO</value> |
454 | | - <minimum>${jacoco.coverage.target.method}</minimum> |
| 435 | + <minimum>${jacoco.coverage.target.class.method}</minimum> |
455 | 436 | </limit> |
456 | | - <!-- <limit>--> |
457 | | - <!-- <counter>CLASS</counter>--> |
458 | | - <!-- <value>COVEREDRATIO</value>--> |
459 | | - <!-- <minimum>${jacoco.coverage.target.class}</minimum>--> |
460 | | - <!-- </limit>--> |
461 | 437 | </limits> |
462 | 438 | <excludes> |
| 439 | + <!-- Code implemented externally --> |
463 | 440 | <exclude>org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory.**</exclude> |
464 | 441 | <exclude>org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory</exclude> |
465 | | - <exclude>org.kohsuke.github.extras.OkHttp3Connector</exclude> |
| 442 | + |
| 443 | + <!-- Sample only --> |
466 | 444 | <exclude>org.kohsuke.github.example.*</exclude> |
467 | | - <!-- Deprecated iterateRepositories --> |
| 445 | + |
| 446 | + <!-- No methods --> |
| 447 | + <exclude>org.kohsuke.github.DeleteToken</exclude> |
| 448 | + <exclude>org.kohsuke.github.Previews</exclude> |
| 449 | + |
| 450 | + <!-- Deprecated --> |
| 451 | + <exclude>org.kohsuke.github.extras.OkHttp3Connector</exclude> |
| 452 | + <exclude>org.kohsuke.github.EnforcementLevel</exclude> |
468 | 453 | <exclude>org.kohsuke.github.GHPerson.1</exclude> |
469 | 454 | <exclude>org.kohsuke.github.GHPerson.1.1</exclude> |
| 455 | + |
| 456 | + <!-- TODO: These still need test coverage --> |
| 457 | + <exclude>org.kohsuke.github.GHBranchProtection.RequiredSignatures</exclude> |
| 458 | + <exclude>org.kohsuke.github.GHBranchProtectionBuilder.Restrictions</exclude> |
| 459 | + <exclude>org.kohsuke.github.GHBranchProtection.Restrictions</exclude> |
| 460 | + <exclude>org.kohsuke.github.GHCommentAuthorAssociation</exclude> |
| 461 | + <exclude>org.kohsuke.github.GHCommitBuilder.UserInfo</exclude> |
| 462 | + <exclude>org.kohsuke.github.GHCommitSearchBuilder.CommitSearchResult</exclude> |
| 463 | + <exclude>org.kohsuke.github.GHCommitSearchBuilder.Sort</exclude> |
| 464 | + <exclude>org.kohsuke.github.GHCommitSearchBuilder</exclude> |
| 465 | + <exclude>org.kohsuke.github.GHCommitState</exclude> |
| 466 | + <exclude>org.kohsuke.github.GHCompare.Commit</exclude> |
| 467 | + <exclude>org.kohsuke.github.GHCompare.InnerCommit</exclude> |
| 468 | + <exclude>org.kohsuke.github.GHCompare.Status</exclude> |
| 469 | + <exclude>org.kohsuke.github.GHCompare.Tree</exclude> |
| 470 | + <exclude>org.kohsuke.github.GHCompare.User</exclude> |
| 471 | + <exclude>org.kohsuke.github.GHCompare</exclude> |
| 472 | + <exclude>org.kohsuke.github.GHDeployKey</exclude> |
| 473 | + <exclude>org.kohsuke.github.GHDeploymentStatusBuilder</exclude> |
| 474 | + <exclude>org.kohsuke.github.GHDirection</exclude> |
| 475 | + <exclude>org.kohsuke.github.GHEmail</exclude> |
| 476 | + <exclude>org.kohsuke.github.GHEventPayload.Ping</exclude> |
| 477 | + <exclude>org.kohsuke.github.GHEventPayload.Release</exclude> |
| 478 | + <exclude>org.kohsuke.github.GHException</exclude> |
| 479 | + <exclude>org.kohsuke.github.GHHook</exclude> |
| 480 | + <exclude>org.kohsuke.github.GHHooks.OrgContext</exclude> |
| 481 | + <exclude>org.kohsuke.github.GHInvitation</exclude> |
| 482 | + <exclude>org.kohsuke.github.GHIssueSearchBuilder.IssueSearchResult</exclude> |
| 483 | + <exclude>org.kohsuke.github.GHIssueSearchBuilder.Sort</exclude> |
| 484 | + <exclude>org.kohsuke.github.GHIssueSearchBuilder</exclude> |
| 485 | + <exclude>org.kohsuke.github.GHMilestoneState</exclude> |
| 486 | + <exclude>org.kohsuke.github.GHOrgHook</exclude> |
| 487 | + <exclude>org.kohsuke.github.GHProject.ProjectStateFilter</exclude> |
| 488 | + <exclude>org.kohsuke.github.GHPullRequestCommitDetail.Authorship</exclude> |
| 489 | + <exclude>org.kohsuke.github.GHPullRequestCommitDetail.Commit</exclude> |
| 490 | + <exclude>org.kohsuke.github.GHPullRequestCommitDetail.CommitPointer</exclude> |
| 491 | + <exclude>org.kohsuke.github.GHPullRequestCommitDetail.Tree</exclude> |
| 492 | + <exclude>org.kohsuke.github.GHPullRequestCommitDetail</exclude> |
| 493 | + <exclude>org.kohsuke.github.GHPullRequestFileDetail</exclude> |
| 494 | + <exclude>org.kohsuke.github.GHPullRequestQueryBuilder.Sort</exclude> |
| 495 | + <exclude>org.kohsuke.github.GHReleaseUpdater</exclude> |
| 496 | + <exclude>org.kohsuke.github.GHRepository.ForkSort</exclude> |
| 497 | + <exclude>org.kohsuke.github.GHStargazer</exclude> |
| 498 | + <exclude>org.kohsuke.github.GHTagObject</exclude> |
| 499 | + <exclude>org.kohsuke.github.GHTeam.Role</exclude> |
| 500 | + <exclude>org.kohsuke.github.GHUserSearchBuilder.Sort</exclude> |
| 501 | + <exclude>org.kohsuke.github.GHVerifiedKey</exclude> |
| 502 | + <exclude>org.kohsuke.github.GitHubBuilder.1</exclude> |
470 | 503 | </excludes> |
471 | 504 | </rule> |
472 | 505 | </rules> |
|
0 commit comments