Skip to content

Minitest exit value #32

@everton

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions