Open ignatenkobrain opened 4 years ago
@ignatenkobrain How is this test being executed? I am running the tests with bundle exec rake
, which is the expected way to run the tests, and the value of the output is
Usage: rake_test_loader usage string
Options:
(Note the rake_test_loader
in my output vs -e
in yours.
Even bundle exec ruby -Ilib:test test/optimist/parser_educate_test.rb
passes on my machine with the following output
Usage: parser_educate_test usage string
Options:
basically it is executed in a ruby -Ilib:test test/optimist/parser_educate_test.rb
way... But the main difference between build environment and your machine is that build environment does not have TTY, can that be related?
I'm not sure...it's more about what $0
is... the relevant portion of the code is:
https://github.com/ManageIQ/optimist/blob/master/lib/optimist.rb#L369-L370
which in your case is yielding -e
. Do you know what $0
is in your case?
The only code that I feel could affect this is:
https://github.com/ManageIQ/optimist/blob/master/lib/optimist.rb#L391-L403
it should default to 80 wide for non tty
Right, but the error is because the program name is -e
instead of something else. I mean the simple fix on our side it to just change the test on our side from \w*
to [\w-]*
, but I'd like to understand the deeper reason as to why a -e
is there at all, and if there's a change that can be made on the packaging side, perhaps that's preferable than changing the this test?
IMO there's not enough information here to debug this, would recommend closing.
Reviewing this I recall that Red Hat does some interesting stuff when building rpms around gems, where they can run tests from within the rpm BUILDROOT, and it's like a special chroot'ed environment. I wonder if that's what's going on here? @ignatenkobrain I realize this issue is 4 years old, but do you have any more details?
Anything you'd like to know?