Skip to content

SimpleCov only reports the last controller test and sets to 0.0% all previous results #1067

Open
@OfficeYAportatil

Description

@OfficeYAportatil

Hi there!!!

I have de following issues.

My Settings:

Gemfile

ruby (3.2.2)
rails (7.0.7)
simplecov (0.22.0) # in test group

test_helper.rb

require 'simplecov
SimpleCov.start 'rails' do
    merge_timeout 2_678_400 # one month for merging 
end

ENV['RAILS_ENV'] ||= 'test'

require_relative '../config/environment'
require 'minitest/sound'
require 'rails/test_help'

Dir[Rails.root.join('test/shared_tests/**/*')].each { |f| require f }
Minitest::Sound.success = "__MINE/fx/ok_#{rand(6)}.mp3"
Minitest::Sound.failure = "__MINE/fx/er_#{rand(6)}.mp3"

module ActiveSupport
  class TestCase
    parallelize(workers: :number_of_processors)
    fixtures :all
    Faker::Config.locale = :es
    Faker::Config.random = Random.new
  end
end

Issues:

Issue #1: All controllers got a 0% when running all tests

  • When I run rails test test/controllers/ all the controllers got an 0%
  • If I run rails test test/models/, the models are correctly scored
  • If I run rails test test/system/, everything got correctly scored

Issue #2: Everything goes back to 0% with the next tests

If after rails test test/system/, I run rails test test/controllers/banks_controller_test.rb, the previous results are forgotten and I everything got scored with 0%. In the Controllers TAB only the tests for banks_controller, concerns/common_controller and application_controller got a score.

Then, if I run a new test, like rails test test/controllers/customers_controller_test.rb, everything keeps its 0% and in the Controllers TAB only the tests for customers_controller, concerns/common_controller and application_controller got a score forgetting the previos score for banks_controller

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