diff --git a/config/initializers/yaml_autoloader.rb b/config/initializers/yaml_autoloader.rb index 01b824044dc..525cc114fa7 100644 --- a/config/initializers/yaml_autoloader.rb +++ b/config/initializers/yaml_autoloader.rb @@ -7,6 +7,9 @@ # # Note, this is used to autoload constants serialized as yaml from one process and loaded in another such as through # args in the MiqQueue. An alternative would be to eager load all of our autoload_paths in all processes. +# +# This is still needed in some areas for zeitwerk, such as YAML files for tests in the manageiq-providers-vmware +# that reference a constant: RbVmomi::VIM::TaskEvent Psych::Visitors::ToRuby.prepend Module.new { def resolve_class(klass_name) (class_loader.class != Psych::ClassLoader::Restricted && klass_name && klass_name.safe_constantize) || super diff --git a/spec/initializers/yaml_autoloader_spec.rb b/spec/initializers/yaml_autoloader_spec.rb index df17fc627d2..27c2c7e5994 100644 --- a/spec/initializers/yaml_autoloader_spec.rb +++ b/spec/initializers/yaml_autoloader_spec.rb @@ -6,6 +6,7 @@ let(:missing_model) { model_directory.join("zzz_model.rb") } before do + skip "This is currently not testable with zeitwerk!" if Rails.application.config.autoloader == :zeitwerk File.write(missing_model, "class ZzzModel\nend\n") ActiveSupport::Dependencies.autoload_paths << model_directory end