snap/squashfs: use LANG=C.UTF-8 #3799

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

zyga commented Aug 24, 2017

This fixes the test suite if invoked on a locale that happens to have
translations for some of the strings we are checking.

Signed-off-by: Zygmunt Krynicki me@zygoon.pl

snap/squashfs: use LANG=C.UTF-8
This fixes the test suite if invoked on a locale that happens to have
translations for some of the strings we are checking.

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>

mvo5 requested changes Aug 24, 2017 edited

Thanks for fixing the test! However I think we want a slightly different way, i.e. only change env in test code, see my inline comment.

@@ -90,6 +90,14 @@ func (s *Snap) Install(targetPath, mountDir string) error {
var runCommandWithOutput = func(args ...string) ([]byte, error) {
@mvo5

mvo5 Aug 24, 2017

Collaborator

I think this is the wrong place for switching LANG, this is a generic "runCommandWithOutput" helper. This side-effect is surprising for most people. I think instead we should set/change the environment inside the tests only

@zyga

zyga Aug 24, 2017

Contributor

I slightly disagree, perhaps this could be just called runCommandWithEnglishOutput, there are no side-effects (the change affects the child and not the caller), unlike in the global test proposal.

Contributor

zyga commented Aug 24, 2017

Closing because mvo chose to remove the offending test and some associated code.

@zyga zyga closed this Aug 24, 2017

@zyga zyga deleted the zyga:tweak/use-lang-c branch Aug 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment