-
Notifications
You must be signed in to change notification settings - Fork 282
test(locale): improve test using locale en_US.UTF-8
#269
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
Conversation
@myii : good work 👍 but I have one question : can the locales be set in the docker image instead? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In modern Debian distros and derivatives, the locale-gen
just reads /etc/locale.gen
file, and simply ignores locale as and argument. Despite what the manpage tells you :) So it is superfluous.
When I want to test l11n and i18n within my images I usually rely on explicitly setting the locales
package configuration via debconf. That mitigates any weird hacks were done in the underlying image by someone else. Using these commands:
echo 'locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, en_GB.UTF-8 UTF-8' | sudo debconf-set-selections -
echo 'locales locales/default_environment_locale select en_US.UTF-8' | sudo debconf-set-selections -
sudo dpkg-reconfigure -f noninteractive locales
This is rather a suggestion, not a mandatory thing.
@vutny Thanks for the feedback. I've tried it out on a separate branch but I'm hitting the same error on all of the Debian-based instances:
Full logs available here: https://travis-ci.com/myii/postgres-formula/builds/111870004. In any case, we've discussed this on Slack and @javierbertoli may be able to ensure that we don't need this process at all. |
Ah, of course! Forgot the very first command 😄 sudo rm -f /etc/default/locale /etc/locale.gen
Yeah, sure. This is the best option. Better to put those commands into Dockerfile. |
@vutny Yes, that worked: https://travis-ci.com/myii/postgres-formula/builds/111883527. Let's see what the final outcome is for |
* `train` gem has been fixed upstream - inspec/train#451 - https://rubygems.org/gems/train/versions/2.1.7
en_GB.UTF-8
en_US.UTF-8
Thanks to @javierbertoli, all of the pre-salted images are configured with the I've also added a couple of further changes based on the @vutny If you are good with the changes, would you mind merging this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @myii , great work!
I guess you need to throw away changes in .travis.yml
, as I see all defined instances have been passed in your other branch covered by Travis.
@vutny It's a bit ugly but we've been leaving them there (commented out) to make it easier when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@myii Okay, got you.
And I hope this would be really temporary thing, since we have the full test suit working here, so be able to catch any regressions.
@vutny Sorry, I didn't get your angle about the "temporary thing". Do you mean in terms of having all of the instances running again? Or do you mean removing the commented lines? In any case, if anyone wants to help stabilise the CI setup, that would be greatly appreciated. Here's a bit more background for interested parties, even if only to offer comment: saltstack-formulas/template-formula#118. I'll go ahead and merge this in the meanwhile, thanks for the review. |
🎉 This PR is included in version 0.37.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Configure locale on Debian-based instances and CentOS-7Continues work done in #262, where the locales were commented out at the time.