Skip to content

[Chore]: improve unit test coverage #859

@ascopes

Description

@ascopes

Brief description

I want to ensure our unit test coverage is as high as possible. Until now, some more complicated logic has relied on integration tests for coverage, but this can make testing bugfixes such as that in GHSA-j2pc-v64r-mv4f into a big chore.

Aims and goals

  • Can we separate coverage by unit and integration on Codecov?
  • Set up tests for the following components:
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/dependencies/aether/AetherResolverTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/generation/LanguageTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/generation/OutputDescriptorAttachmentRegistrarTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/generation/ProtobufBuildOrchestratorTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/generation/SourceRootRegistrarTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/plugins/BinaryPluginResolverTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/plugins/JvmPluginResolverTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/protoc/ProtocExecutorTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/protoc/ProtocResolverTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/protoc/targets/SanctionedExecutableTransformerTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/sources/ProjectInputListingTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/sources/ProjectInputResolverTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/sources/ProtoSourceResolverTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/sources/incremental/IncrementalCacheManagerTest.java
  • protobuf-maven-plugin/src/test/java/io/github/ascopes/protobufmavenplugin/sources/incremental/IncrementalCacheTest.java

List compiled by the following script snippet before being manually filtered to remove classes with no actual logic to test:

find protobuf-maven-plugin/src/main/java -name "*.java" -print \
    | grep -vE '.*/package-info.java' \
    | sed -E 's#src/main#src/test#g;s/(.*)\.java/\1Test.java/g' \
    | while read -r file; do [[ -f ${file} ]] || echo "${file}"; done \
    | sort

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreGeneral tech debt work.good first issueGood issues for new contributors to pick up.help neededAny expertise or time or resources will always be appreciated!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions