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 case failed. #481

Closed
willson-chen opened this issue Jul 13, 2020 · 3 comments · Fixed by #502
Closed

Test case failed. #481

willson-chen opened this issue Jul 13, 2020 · 3 comments · Fixed by #502
Labels
tests zip Related to ZIP file format

Comments

@willson-chen
Copy link

Steps to reproduce

  1. CI in windows, three test cases failed:
    https://ci.appveyor.com/project/icsharpcode/sharpziplib/branch/master/job/6kbl3jgxelrn1ndv
Errors, Failures and Warnings
1) Failed : ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(0)
  No entry matching source file "Users/appveyor/AppData/Local/Temp/1/tmpDF1A.tmp" found in archive, found "C:\Users\appveyor\AppData\Local\Temp\1\tmpDF1A.tmp"
  Expected: not null
  But was:  null
   at ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(Int32 contentLength) in C:\projects\sharpziplib\test\ICSharpCode.SharpZipLib.Tests\Zip\StreamHandling.cs:line 265
2) Failed : ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(1)
  No entry matching source file "Users/appveyor/AppData/Local/Temp/1/tmpDF7A.tmp" found in archive, found "C:\Users\appveyor\AppData\Local\Temp\1\tmpDF7A.tmp"
  Expected: not null
  But was:  null
   at ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(Int32 contentLength) in C:\projects\sharpziplib\test\ICSharpCode.SharpZipLib.Tests\Zip\StreamHandling.cs:line 265
3) Failed : ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(256)
  No entry matching source file "Users/appveyor/AppData/Local/Temp/1/tmpDF7C.tmp" found in archive, found "C:\Users\appveyor\AppData\Local\Temp\1\tmpDF7C.tmp"
  Expected: not null
  But was:  null
   at ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(Int32 contentLength) in C:\projects\sharpziplib\test\ICSharpCode.SharpZipLib.Tests\Zip\StreamHandling.cs:line 265
Run Settings
    Number of Test Workers: 2
    Work Directory: C:\projects\sharpziplib
    Internal Trace: Off
Test Run Summary
  Overall result: Failed
  Test Count: 235, Passed: 217, Failed: 3, Warnings: 0, Inconclusive: 0, Skipped: 15
    Failed Tests - Failures: 3, Errors: 0, Invalid: 0
    Skipped Tests - Ignored: 3, Explicit: 12, Other: 0
  Start time: 2020-07-04 16:30:00Z
    End time: 2020-07-04 16:30:13Z
    Duration: 12.339 seconds
  1. Test in linux, ten test cases failed:
    The command was: dotnet run -c Release -f netcoreapp2 -p test/ICSharpCode.SharpZipLib.TestBootstrapper/ICSharpCode.SharpZipLib.TestBootstrapper.csproj
    test_linux_fail.log
Errors, Failures and Warnings

1) Failed : ICSharpCode.SharpZipLib.Tests.Zip.FastZipHandling.SetDirectoryModifiedDate
  Expected: 2001-01-02 00:00:00
  But was:  2001-01-02 08:00:00
   at ICSharpCode.SharpZipLib.Tests.Zip.FastZipHandling.SetDirectoryModifiedDate() in /root/workspace/hanqiang/sharpZipLib/SharpZipLib-master/test/ICSharpCode.SharpZipLib.Tests/Zip/FastZipHandling.cs:line 612

2) Failed : ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(0)
  No entry matching source file "tmp/tmpJD38Z1.tmp" found in archive, found "/tmp/tmpJD38Z1.tmp"
  Expected: not null
  But was:  null
   at ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(Int32 contentLength) in /root/workspace/hanqiang/sharpZipLib/SharpZipLib-master/test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs:line 267

3) Failed : ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(1)
  No entry matching source file "tmp/tmplGyoGA.tmp" found in archive, found "/tmp/tmplGyoGA.tmp"
  Expected: not null
  But was:  null
   at ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(Int32 contentLength) in /root/workspace/hanqiang/sharpZipLib/SharpZipLib-master/test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs:line 267

4) Failed : ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(256)
  No entry matching source file "tmp/tmpL4aRm9.tmp" found in archive, found "/tmp/tmpL4aRm9.tmp"
  Expected: not null
  But was:  null
   at ICSharpCode.SharpZipLib.Tests.Zip.StreamHandling.WriteZipStreamWithNoCompression(Int32 contentLength) in /root/workspace/hanqiang/sharpZipLib/SharpZipLib-master/test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs:line 267

5) Failed : ICSharpCode.SharpZipLib.Tests.Zip.WindowsNameTransformHandling.BasicDirectories
  Should be equal
  String lengths are both 14. Strings differ at index 8.
  Expected: "absolute\\file2"
  But was:  "absolute/file2"
  -------------------^
   at ICSharpCode.SharpZipLib.Tests.Zip.WindowsNameTransformHandling.BasicDirectories() in /root/workspace/hanqiang/sharpZipLib/SharpZipLib-master/test/ICSharpCode.SharpZipLib.Tests/Zip/WindowsNameTransformHandling.cs:line 123

6) Failed : ICSharpCode.SharpZipLib.Tests.Zip.WindowsNameTransformHandling.BasicFiles
  Should be equal
  Expected string length 16 but was 18. Strings differ at index 6.
  Expected: "zebidi/and/dylan"
  But was:  "zebidi\\/and\\/dylan"
  -----------------^

7) Failed : ICSharpCode.SharpZipLib.Tests.Zip.WindowsNameTransformHandling.Replacement
  Should be equal
  Expected string length 3 but was 4. Strings differ at index 1.
  Expected: "c/_"
  But was:  "c\\/_"
  ------------^

8) Failed : ICSharpCode.SharpZipLib.Tests.Zip.WindowsNameTransformHandling.ReplacementChecking
Expected an exception
   at ICSharpCode.SharpZipLib.Tests.Zip.WindowsNameTransformHandling.ReplacementChecking() in /root/workspace/hanqiang/sharpZipLib/SharpZipLib-master/test/ICSharpCode.SharpZipLib.Tests/Zip/WindowsNameTransformHandling.cs:line 107
...
...
...
17) Failed : ICSharpCode.SharpZipLib.Tests.Zip.ZipEntryFactoryHandling.CreatedValues
  Create time failure
  Expected: 2100-02-27 11:07:56
  But was:  2020-07-13 10:38:22.2627132
   at ICSharpCode.SharpZipLib.Tests.Zip.ZipEntryFactoryHandling.CreatedValues() in /root/workspace/hanqiang/sharpZipLib/SharpZipLib-master/test/ICSharpCode.SharpZipLib.Tests/Zip/ZipEntryFactoryHandling.cs:line 135

18) Failed : ICSharpCode.SharpZipLib.Tests.Zip.ZipNameTransformHandling.FilenameCleaning
  Expected: 0
  But was:  21
   at ICSharpCode.SharpZipLib.Tests.Zip.ZipNameTransformHandling.FilenameCleaning() in /root/workspace/hanqiang/sharpZipLib/SharpZipLib-master/test/ICSharpCode.SharpZipLib.Tests/Zip/ZipNameTransformHandling.cs:line 85

Run Settings
    Number of Test Workers: 4
    Work Directory: /root/workspace/hanqiang/sharpZipLib/SharpZipLib-master
    Internal Trace: Off

Test Run Summary
  Overall result: Failed
  Test Count: 235, Passed: 202, Failed: 10, Warnings: 8, Inconclusive: 0, Skipped: 15
    Failed Tests - Failures: 10, Errors: 0, Invalid: 0
    Skipped Tests - Ignored: 3, Explicit: 12, Other: 0
  Start time: 2020-07-13 02:38:13Z
    End time: 2020-07-13 02:38:23Z
    Duration: 9.158 seconds

Expected behavior

Test cases all passed.

Actual behavior

Windows three test cases failed.
linux ten test cases failed.

Version of SharpZipLib

master branch.

Obtained from (only keep the relevant lines)

@Numpsy
Copy link
Contributor

Numpsy commented Jul 13, 2020

The first one is a known issue (see #341 / #423).

I saw some of those failures in the second set when I tried running the tests on macOS one time, but didn't look in to it in any detail, and think I wasn't sure at the time if the tests for WindowsNameTransform weren't Windows specific.

@Numpsy Numpsy added tests zip Related to ZIP file format labels Jul 13, 2020
@piksel
Copy link
Member

piksel commented Jul 15, 2020

Yeah, the first 3 is due to how the file name handling is presumed to work, which has been changed but we have not really decided on what the new behaviour should be.

The rest of the tests that fail on non-windows is due to the path-separator, and hence they are skipped on non-windows OSes. They could be modified to either work correctly on other OSes / or emit a "Skipped" result on those (when the tests are not applicable).

@piksel
Copy link
Member

piksel commented Aug 6, 2020

Sorry, the first of the linux tests failed is due to a bug introduced in #463. Unfortunately, it seems like the CI image uses UTC time, which would explain why it doesn't fail there.
The DosTime setter sets the Kind property to UTC, but the getter simply uses the Year/Month/Day etc. properties without checking the Kind. I will make a new PR with a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests zip Related to ZIP file format
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants