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 ZipValid test on non-English Windows systems #2781

Merged
merged 1 commit into from Jun 12, 2019

Conversation

HebaruSan
Copy link
Member

Problem

If your Windows computer's locale is non-English, this test will fail:

1) Failed : Tests.Core.Cache.ZipValid_ContainsFilenameWithBadChars_NoException
  Expected string length 26 but was 27. Strings differ at index 7.
  Expected: "Illegales Zeichen im Pfad."
  But was:  "Illegal characters in path."
  ------------------^
   bei Tests.Core.Cache.ZipValid_ContainsFilenameWithBadChars_NoException() in C:\path\to\ckan-git\Tests\Core\Cache.cs:Zeile 195.

(I was able to reproduce this on an English computer by installing the German language pack for .NET and setting Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE"); within the test.)

Cause

That error message is localized. It will appear in whatever language is selected in Thread.CurrentThread.CurrentUICulture.

Changes

Now we set Thread.CurrentThread.CurrentUICulture to CultureInfo.InvariantCulture for that test. This forces the error message to appear in English.

Fixes #2780.

@HebaruSan HebaruSan added Bug Pull request Tests Issues affecting the internal tests labels Jun 11, 2019
@HebaruSan HebaruSan added the Windows Issues specific for Windows label Jun 11, 2019
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

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

All tests passing again, great feeling :D

Test Run Summary
  Overall result: Passed
  Test Count: 685, Passed: 680, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 5
    Skipped Tests - Ignored: 0, Explicit: 5, Other: 0
  Start time: 2019-06-12 20:59:16Z
    End time: 2019-06-12 21:00:03Z
    Duration: 46.986 seconds

@HebaruSan HebaruSan merged commit 562ed8d into KSP-CKAN:master Jun 12, 2019
@HebaruSan HebaruSan deleted the fix/zip-test-locale branch June 12, 2019 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Pull request Tests Issues affecting the internal tests Windows Issues specific for Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'ZipValid_ContainsFilenameWithBadChars_NoException' test fails on non-english Windows systems
2 participants