Skip to content

SimpleCov Code Coverage Maintenance #2121

Description

@nicholaspneu

SimpleCov facilities in minitest_helper.rb are broken, particularly when running test:parallel_run_all_tests_locally in Rake. This is mostly due to the ParallelTests class clobbering the class with the same name in the parallel_tests gem which stops it from running. Refer to the full traceback below for the error:

/workspaces/openstudio-standards/vendor/bundle/ruby/3.2.0/gems/simplecov-0.22.0/lib/simplecov.rb:279:in `wait_for_other_processes': undefined method `wait_for_other_processes_to_finish' for ParallelTests:Class (NoMethodError)

      ParallelTests.wait_for_other_processes_to_finish
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        from /workspaces/openstudio-standards/vendor/bundle/ruby/3.2.0/gems/simplecov-0.22.0/lib/simplecov.rb:110:in `result'
        from /workspaces/openstudio-standards/vendor/bundle/ruby/3.2.0/gems/simplecov-0.22.0/lib/simplecov/configuration.rb:197:in `block in at_exit'
        from /workspaces/openstudio-standards/vendor/bundle/ruby/3.2.0/gems/simplecov-0.22.0/lib/simplecov.rb:189:in `run_exit_tasks!'
        from /workspaces/openstudio-standards/vendor/bundle/ruby/3.2.0/gems/simplecov-0.22.0/lib/simplecov.rb:179:in `at_exit_behavior'
        from /workspaces/openstudio-standards/vendor/bundle/ruby/3.2.0/gems/simplecov-0.22.0/lib/minitest/simplecov_plugin.rb:11:in `block in plugin_simplecov_init'
        from /workspaces/openstudio-standards/vendor/bundle/ruby/3.2.0/gems/minitest-5.26.2/lib/minitest.rb:82:in `reverse_each'
        from /workspaces/openstudio-standards/vendor/bundle/ruby/3.2.0/gems/minitest-5.26.2/lib/minitest.rb:82:in `block (2 levels) in autorun'

Fixed this in the fix-simplecov branch by simply renaming occurences of the ParallelTests class to ParallelTestHelper. Will be merged into nrcan, but also noted here for future reference since it concerns the whole repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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