Skip to content

Fix WorkhorseHelpers module is missing

Shinya Maeda requested to merge fix-workhorse-helpers-module-missing into master

What does this MR do?

Recently, include WorkhorseHelpers was added to https://gitlab.com/gitlab-org/gitlab-ee/blob/master/spec/support/helpers/git_http_helpers.rb#L2, however, this interferes spec execution on local environment. This is probably because of ordering issue of class/module loaders.

https://gitlab.slack.com/archives/C02PF508L/p1562322470412300

shinya@shinya-MS-7A34:~/workspace/thin-gdk/service/rails/src$ tre bin/rspec /home/shinya/workspace/thin-gdk/service/rails/src/ee/spec/services/merge_trains/refresh_merge_requests_service_spec.rb:78
W, [2019-07-08T14:52:47.541565 #12727]  WARN -- : Please set prometheus_multiproc_dir to persistent directory path. Temporarily writing mmap files to /tmp/prometheus-mmap20190708-12727-14t05xx
Running via Spring preloader in process 12747

An error occurred while loading ./ee/spec/services/merge_trains/refresh_merge_requests_service_spec.rb.
Failure/Error: include WorkhorseHelpers

NameError:
  uninitialized constant GitHttpHelpers::WorkhorseHelpers
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:76:in `block in load_missing_constant'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:8:in `without_bootsnap_cache'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:76:in `rescue in load_missing_constant'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:58:in `load_missing_constant'
# ./spec/support/helpers/git_http_helpers.rb:2:in `<module:GitHttpHelpers>'
# ./spec/support/helpers/git_http_helpers.rb:1:in `<main>'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
# ./spec/spec_helper.rb:44:in `block in <main>'
# ./spec/spec_helper.rb:44:in `each'
# ./spec/spec_helper.rb:44:in `<main>'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:83:in `register'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
# ./ee/spec/services/merge_trains/refresh_merge_requests_service_spec.rb:3:in `<main>'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/nakayoshi_fork-0.0.4/lib/nakayoshi_fork.rb:23:in `fork'
# /home/shinya/workspace/thin-gdk/service/rails/cache/gems/nakayoshi_fork-0.0.4/lib/nakayoshi_fork.rb:23:in `fork'
# -e:1:in `<main>'
# ------------------
# --- Caused by: ---
# NameError:
#   uninitialized constant GitHttpHelpers::WorkhorseHelpers
#   /home/shinya/workspace/thin-gdk/service/rails/cache/gems/bootsnap-1.4.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:60:in `block in load_missing_constant'
Run options: include {:locations=>{"./ee/spec/services/merge_trains/refresh_merge_requests_service_spec.rb"=>[78]}}

All examples were filtered out


Finished in 0.11479 seconds (files took 0.67852 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Shinya Maeda

Merge request reports