Skip to content

Create test mapping dynamically

Generate test mapping for test_file_finder dynamically, part of #222369 (closed).

After spiking a few approaches listed below, the chosen approach is to use crystalball with coverage. This is implemented in !44968 (merged)

There are a few options to do this:

  1. rotoscope - spike !44886 (closed)
  2. TracePoint - rotoscope uses tracepoint C API internally.
  3. Coverage - crystalball has a Coverage strategy
  4. crystalball - spike: !44968 (merged)

The mapping should list all the test files for each source file in the codebase, to be used with test_file_finder gem:

{
  "app/models/project.rb": ["spec/models/project_spec.rb", ...],
  "app/models/project_feature.rb": ["spec/models/project_spec.rb", ...]
}
Edited by Albert Salim