Commit 8e2bcb53 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '249992-always-load-spec-helper' into 'master'

Always require spec_helper first in CI

See merge request gitlab-org/gitlab!46349
parents bbae5375 c9307db9
...@@ -90,7 +90,7 @@ function rspec_simple_job() { ...@@ -90,7 +90,7 @@ function rspec_simple_job() {
export NO_KNAPSACK="1" export NO_KNAPSACK="1"
bin/rspec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml ${rspec_opts} bin/rspec -Ispec -rspec_helper --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml ${rspec_opts}
} }
function rspec_paralellized_job() { function rspec_paralellized_job() {
...@@ -143,7 +143,7 @@ function rspec_paralellized_job() { ...@@ -143,7 +143,7 @@ function rspec_paralellized_job() {
export MEMORY_TEST_PATH="tmp/memory_test/${report_name}_memory.csv" export MEMORY_TEST_PATH="tmp/memory_test/${report_name}_memory.csv"
knapsack rspec "-Ispec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml ${rspec_opts}" knapsack rspec "-Ispec -rspec_helper --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml ${rspec_opts}"
date date
} }
......
# frozen_string_literal: true # frozen_string_literal: true
# When running in CI environment, we need to load a full `spec_helper` # $" is $LOADED_FEATURES, but RuboCop didn't like it
if ENV['CI'] if $".include?(File.expand_path('spec_helper.rb', __dir__))
require_relative 'spec_helper' # There's no need to load anything here if spec_helper is already loaded
# because spec_helper is more extensive than fast_spec_helper
return return
end end
......
# frozen_string_literal: true # frozen_string_literal: true
# $" is $LOADED_FEATURES, but RuboCop didn't like it
if $".include?(File.expand_path('fast_spec_helper.rb', __dir__))
warn 'Detected fast_spec_helper is loaded first than spec_helper.'
warn 'If running test files using both spec_helper and fast_spec_helper,'
warn 'make sure test file with spec_helper is loaded first.'
abort 'Aborting...'
end
require './spec/simplecov_env' require './spec/simplecov_env'
SimpleCovEnv.start! SimpleCovEnv.start!
......
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