Skip to content

Commit 34ff356

Browse files
committed
Trying to fix ci errors
1 parent b26e8dd commit 34ff356

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

spec/support/generator_test_helpers.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ def self.create_test_app(name, template:, template_path:)
2929
output, status = run_command(root_env, create_command, chdir: Dir.tmpdir)
3030
raise_command_error(name, create_command, status, output) unless status.success?
3131

32-
app_env = root_env.merge('BUNDLE_GEMFILE' => File.join(app_path, 'Gemfile'))
32+
app_env = clean_bundle_env(
33+
ruby_llm_path: ruby_llm_path,
34+
bundle_gemfile: File.join(app_path, 'Gemfile')
35+
)
3336

3437
install_command = ['bundle', 'install', '--quiet']
3538
output, status = run_command(app_env, install_command, chdir: app_path)
@@ -45,6 +48,22 @@ def self.run_command(env, command, chdir:)
4548
["#{stdout}#{stderr}", process_status]
4649
end
4750

51+
def self.clean_bundle_env(ruby_llm_path:, bundle_gemfile:)
52+
env = {
53+
'RUBYLLM_PATH' => ruby_llm_path,
54+
'BUNDLE_GEMFILE' => bundle_gemfile
55+
}
56+
57+
ENV.each_key do |key|
58+
next unless key.start_with?('BUNDLE_')
59+
next if key == 'BUNDLE_GEMFILE'
60+
61+
env[key] = nil
62+
end
63+
64+
env
65+
end
66+
4867
def self.raise_command_error(name, command, status, output)
4968
raise <<~ERROR
5069
Failed to create test app #{name}

0 commit comments

Comments
 (0)