Skip to content

Set RSPEC_TESTS_MAPPING_ENABLED in the `detect-tests as-if-foss` job

What does this MR do and why?

I discovered in #371710 (comment 1075889990) that the variable wasn't set for this job, resulting in missing test files to be run by the rspec foss-impact job, leading to potential FOSS broken master.

Related to #371760 (closed).

How to set up and validate locally

  1. Download artifacts of https://gitlab.com/gitlab-org/gitlab/-/jobs/2923393291 and extract crystalball/mapping.json to ~/Downloads/crystalball/mapping.json.
  2. Download tmp/changed_files.txt from https://gitlab.com/gitlab-org/gitlab/-/jobs/2924374936 to ~/Downloads/changed_files.txt.
  3. Download tmp/changed_foss_files.txt from https://gitlab.com/gitlab-org/gitlab/-/jobs/2924374937 to ~/Downloads/changed_foss_files.txt.
  4. Run the following locally in your gitlab folder: FOSS_ONLY=1 RSPEC_TESTS_MAPPING_PATH=~/Downloads/crystalball/mapping.json tooling/bin/find_tests ~/Downloads/changed_foss_files.txt foss-test-files.txt.
  5. Then check the content of foss-test-files.txt and expect spec/graphql/resolvers/group_issues_resolver_spec.rb not to be there (because the mapping isn't actually used since RSPEC_TESTS_MAPPING_PATH isn't set).
  6. Run the following locally in your gitlab folder: FOSS_ONLY=1 RSPEC_TESTS_MAPPING_ENABLED=1 RSPEC_TESTS_MAPPING_PATH=~/Downloads/crystalball/mapping.json tooling/bin/find_tests ~/Downloads/changed_foss_files.txt foss-test-files.txt (same command but with RSPEC_TESTS_MAPPING_ENABLED=1 set).
  7. Then check the content of foss-test-files.txt and expect spec/graphql/resolvers/group_issues_resolver_spec.rb to be there (because the mapping is used since RSPEC_TESTS_MAPPING_PATH is now set).

Testing when app/graphql/resolvers/concerns/issue_resolver_arguments.rb is modified

I'm testing this in !96178 (closed) => https://gitlab.com/gitlab-org/gitlab/-/jobs/2940987460

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 Rémy Coutable

Merge request reports

Loading