Skip to content

Minitest exit value #32

Description

@everton

To incorporate this gem as part of a CI process, the tests suite should return a non-success exit code when coverage failed.

For minitest, ignoring thresholds (considering anything bellow 100% a failure), this block inside the minitest.rb could be enough:

  if $covered.policy.each.flat_map(&:counts).detect { _1&.zero? }
    Kernel.exit(1)
  end

A similar behavior is found in simplecov: https://github.com/simplecov-ruby/simplecov/blob/b6c2d4208a5fa395ce09d7e1d3b074f680ee29b0/lib/simplecov.rb#L239

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions