Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix environment initialization #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

colinsurprenant
Copy link
Contributor

two fixes:

1- an env hash is passed to popen3 to make sure to reset any bundler settings to not interfere with the launched app. this allow launching an external logstash from the performance testing dir, for example:

bundle exec bin/lsperfm examples/suite/basic_performance_quick.rb  /Users/colin/dev/src/elasticsearch/logstash

2- correctly sets path for suites configs.

@@ -27,7 +27,7 @@ def run(required_events_count, required_run_time, input_lines)
puts("launching #{command.join(" ")} #{required_events_count} #{required_run_time}") if @debug
stats = LogStash::PerformanceMeter::Stats.new
real_events_count = 0
Open3.popen3(*@command) do |i, o, e|
Open3.popen3({:BUNDLE_BIN_PATH => "", :BUNDLE_GEMFILE => "", :RUBYOPT => ""}, *@command) do |i, o, e|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change, good idea. Can we make this options passed throught a var? something like

ENV_OPTS = {:BUNDLE_BIN_PATH => "", :BUNDLE_GEMFILE => "", :RUBYOPT => ""}

and then have

Open3.popen3(ENV_OPTS, *@command)....

what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@purbon purbon removed their assignment Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants