Skip to content

Enhance test coverage for already covered commands #63

Description

@ejpcmac

Rationale

Currently, test coverage is not close to 100% even in already covered commands. While 100% coverage is not an absolute goal, it would be good to understand what are the misses to take informed decisions on them.

Concept

Let’s:

  • Analyse coverage misses
  • Decide what to do about them

Analysis

Sources of coverage misses:

  • Untested commands (some internal APIs are then not covered as a result)
  • Logs
  • Untested valid behaviour
  • Terminal size
  • Corner cases in helpers
  • Corner cases in external interactions (git in some cases, file permission erorrs, …)
  • Some very unlikely error cases are not tested (i.e. git commit not being callable, though git being callable has already been tested before in the execution)
  • False positives (this code is tested by this test) => actually these kind of false positives are due to not executing the command to the end with rexpect.

Actions

Let’s:

  • Enable tracing logs in tests
  • Always execute commands to the end so that the coverage report is taken into account
  • Add missing tests for observable valid behaviour
  • Check whether we can manipulate the terminal size to test size-dependent code (spend max. 15 minutes looking for that and discard otherwise) => Seems like it is not possible: Allow specifying terminal size rust-cli/rexpect#119
  • Write trivial unit tests for corner cases in helpers

Let’s not:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions