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

test_usage fails on Fedora Rawhide #111

Open
ignatenkobrain opened this issue Apr 16, 2020 · 8 comments
Open

test_usage fails on Fedora Rawhide #111

ignatenkobrain opened this issue Apr 16, 2020 · 8 comments
Assignees
Labels

Comments

@ignatenkobrain
Copy link

Optimist::ParserEduateTest#test_usage [/home/brain/rpmbuild/BUILDROOT/rubygem-optimist-3.0.0-1.fc33.x86_64/usr/share/gems/gems/optimist-3.0.0/test/optimist/parser_educate_test.rb:25]:
Expected /^Usage: \w* usage string\n\nOptions:/ to match "Usage: -e usage string\n\nOptions:\n".

Anything you'd like to know?

@Fryguy Fryguy added the bug label Apr 16, 2020
@Fryguy Fryguy self-assigned this Apr 16, 2020
@Fryguy
Copy link
Member

Fryguy commented Apr 20, 2020

@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.

@Fryguy
Copy link
Member

Fryguy commented Apr 20, 2020

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:

@ignatenkobrain
Copy link
Author

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?

@Fryguy
Copy link
Member

Fryguy commented Apr 20, 2020

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?

@kbrock
Copy link
Member

kbrock commented Apr 20, 2020

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

@Fryguy
Copy link
Member

Fryguy commented Apr 20, 2020

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?

@nanobowers
Copy link
Collaborator

IMO there's not enough information here to debug this, would recommend closing.

@Fryguy
Copy link
Member

Fryguy commented Jun 3, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants