Skip to content

Resolve "test-selection gap: run system specs when some views changed"

David Dieulivol requested to merge 395017-view_to_system_specs_mapping into master

Context

Closes #395017 (closed)

From Draft to Ready

What does this MR do and why?

When a view gets changed, we try to find feature specs that would test that area of the code.

How do we do this?

The algorithm described in #395017 (closed) was implemented in this MR.

How to set up and validate locally

{
  cat > input.in <<FILE
  app/views/groups/merge_requests.html.haml # Should find spec/features/groups/merge_requests_spec.rb
  app/views/dashboard/_sidebar.html.haml    # Should find spec/features/dashboard/*_spec.rb
  ee/app/views/trials/new.html.haml         # Should find the ee/spec/features/trials/*_spec.rb
  ee/app/views/groups/sso/_tabs.html.haml   # Shouldn't find anything, since the ee/spec/features/groups/sso folder doesn't exist
FILE

  rm -rf output.out
  touch output.out

  ./tooling/bin/view_to_system_specs_mappings input.in output.out; cat output.out
}

The output is as follows:

Click to expand
ee/spec/features/trials/creation_with_lead_spec.rb
ee/spec/features/trials/select_namespace_spec.rb
ee/spec/features/trials/show_trial_banner_spec.rb
ee/spec/features/trials/trial_widget_in_sidebar_spec.rb
spec/features/dashboard/activity_spec.rb
spec/features/dashboard/archived_projects_spec.rb
spec/features/dashboard/datetime_on_tooltips_spec.rb
spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb
spec/features/dashboard/group_spec.rb
spec/features/dashboard/groups_list_spec.rb
spec/features/dashboard/issuables_counter_spec.rb
spec/features/dashboard/issues_filter_spec.rb
spec/features/dashboard/issues_spec.rb
spec/features/dashboard/label_filter_spec.rb
spec/features/dashboard/merge_requests_spec.rb
spec/features/dashboard/milestones_spec.rb
spec/features/dashboard/navbar_spec.rb
spec/features/dashboard/project_member_activity_index_spec.rb
spec/features/dashboard/projects_spec.rb
spec/features/dashboard/root_explore_spec.rb
spec/features/dashboard/shortcuts_spec.rb
spec/features/dashboard/snippets_spec.rb
spec/features/dashboard/todos/target_state_spec.rb
spec/features/dashboard/todos/todos_filtering_spec.rb
spec/features/dashboard/todos/todos_sorting_spec.rb
spec/features/dashboard/todos/todos_spec.rb
spec/features/dashboard/user_filters_projects_spec.rb
spec/features/groups/merge_requests_spec.rb

Which contains the expected specs 🎉

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by David Dieulivol

Merge request reports

Loading