Commit 1c2bde39 authored by Albert Salim's avatar Albert Salim

Simplify job variables for rspec minimal jobs

We only need one variable `MINIMAL_RSPEC_ENABLED`
to toggle rspec minimal job.

`RSPEC_TESTS_MAPPING_ENABLED` is no longer needed
as we always generate the test mapping and use it
to detect related rspec tests.
parent 6ead7b93
......@@ -21,7 +21,7 @@
.minimal-rspec-tests:
variables:
RSPEC_TESTS_MAPPING_ENABLED: "true"
MINIMAL_RSPEC_ENABLED: "true"
.decomposed-database-rspec:
variables:
......
......@@ -82,7 +82,6 @@ detect-tests:
- .detect-test-base
- .rails:rules:detect-tests
variables:
RSPEC_TESTS_MAPPING_ENABLED: "true"
MATCHED_TESTS_FILE: tmp/matching_tests.txt
detect-tests as-if-foss:
......
......@@ -159,7 +159,7 @@ function rspec_paralellized_job() {
local rspec_args="-Ispec -rspec_helper --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml ${rspec_opts}"
if [[ -n $RSPEC_TESTS_MAPPING_ENABLED ]]; then
if [[ -n $MINIMAL_RSPEC_ENABLED ]]; then
tooling/bin/parallel_rspec --rspec_args "${rspec_args}" --filter "tmp/matching_tests.txt"
else
tooling/bin/parallel_rspec --rspec_args "${rspec_args}"
......
......@@ -22,10 +22,7 @@ changed_files = mr_changes.changes.map { |change| change['new_path'] }
tff = TestFileFinder::FileFinder.new(paths: changed_files).tap do |file_finder|
file_finder.use TestFileFinder::MappingStrategies::PatternMatching.load('tests.yml')
if ENV['RSPEC_TESTS_MAPPING_ENABLED']
file_finder.use TestFileFinder::MappingStrategies::DirectMatching.load_json(ENV['RSPEC_TESTS_MAPPING_PATH'])
end
file_finder.use TestFileFinder::MappingStrategies::DirectMatching.load_json(ENV['RSPEC_TESTS_MAPPING_PATH'])
end
File.write(output_file, tff.test_files.uniq.join(' '))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment