mojolicious / mojo

:sparkles: Mojolicious - Perl real-time web framework
https://mojolicious.org
Artistic License 2.0
2.67k stars 579 forks source link

One t-test fails, Perl 5.38 on Windows 10 #2105

Open PhilterPaper opened 1 year ago

PhilterPaper commented 1 year ago

Steps to reproduce the behavior

Installation via 'cpan' to update from CPAN

Expected behavior

Expect clean install

Actual behavior

Failed one t-test: t/mojo/file.t 'right file' (several occurrences listed at 285, 288, 293, 299, 308)

t/mojo/file.t .............................. 1/?
    #   Failed test 'right files'
    #   at t/mojo/file.t line 285.
    #     Structures begin differing at:
    #          $got->[0] = 'C:\Strawberry\cpan\build\Mojolicious-9.34-0\t\mojo\lib\Mojo'
    #     $expected->[0] = 'C:\Strawberry\cpan\build\Mojolicious-9.34-0\t\mojo\lib\Mojo\.hidden.txt'

    #   Failed test 'right files'
    #   at t/mojo/file.t line 288.
    #     Structures begin differing at:
    #          $got->[0] = Does not exist
    #     $expected->[0] = C:\Strawberry\cpan\build\Mojolicious-9.34-0\t\mojo\lib\Mojo\DeprecationTest.pm

    #   Failed test 'right files'
    #   at t/mojo/file.t line 293.
    #     Structures begin differing at:
    #          $got->[0] = 'C:\Strawberry\cpan\build\Mojolicious-9.34-0\t\mojo\lib\Mojo'
    #     $expected->[0] = 'C:\Strawberry\cpan\build\Mojolicious-9.34-0\t\mojo\lib\Mojo\BaseTest'

    #   Failed test 'right files'
    #   at t/mojo/file.t line 299.
    #     Structures begin differing at:
    #          $got->[0] = Does not exist
    #     $expected->[0] = C:\Strawberry\cpan\build\Mojolicious-9.34-0\t\mojo\lib\Mojo\BaseTest\Base1.pm

    #   Failed test 'right files'
    #   at t/mojo/file.t line 308.
    #     Structures begin differing at:
    #          $got->[0] = 'C:\Strawberry\cpan\build\Mojolicious-9.34-0\t\mojo\lib\Mojo'
    #     $expected->[0] = 'C:\Strawberry\cpan\build\Mojolicious-9.34-0\t\mojo\lib\Mojo\.hidden.txt'
    # Looks like you failed 5 tests of 15.

#   Failed test 'list/list_tree'
#   at t/mojo/file.t line 310.
# Looks like you failed 1 test of 31.
t/mojo/file.t .............................. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/31 subtests
        (less 2 skipped subtests: 28 okay)
PhilterPaper commented 1 year ago

If it matters, this is the new Strawberry Perl build ("portable" version). I took a quick look in file.t (list/list_tree), and there were many places mentioning "right files", so I'm not sure which was failing.

kraih commented 1 year ago

I took a quick look in file.t (list/list_tree), and there were many places mentioning "right files", so I'm not sure which was failing.

It tells you the lines right in the fail messages. 😄

And we test with Strawberry Perl in our GitHub Actions. Everything looks fine there.

PhilterPaper commented 1 year ago

And we test with Strawberry Perl in our GitHub Actions. Everything looks fine there.

Well, I see that CPAN Testers failed exactly the same way on the same Perl and Windows level, so perhaps it would be a good idea to look at it again. If you don't have a Strawberry Perl to install on (not the GitHub Actions version), I would be happy to try installing an instrumented version of Mojolicious, or force an install and try running file.t and other debug on it, and report back the results to you. Let me know.

Update: I have found GitHub Actions to be buggy and unreliable. My advice is not to rely on it as the Gospel Truth of whether your package runs OK on a given platform. If you don't have access to that platform to test on, it's better than nothing, but be sure to periodically check the Testers Matrix on CPAN to see what has happened on a wide variety of platforms. For instance, some of my packages were failing t-tests because some platforms had installed extended precision Perl floating point math packages (I had to round down FP results to single precision in t-tests). Also, I can't test some parts of my packages on GA because they can't or won't install some necessary libraries and packages.

PhilterPaper commented 1 year ago

9.35 fails on the same test. CPAN testers report same problem.

Since the Mojolicious developer(s) apparently don't have a Windows/Strawberry Perl 5.38 system to test on, please feel free to contact me if I can be of any help in testing for you.

PhilterPaper commented 8 months ago

Ditto release 9.36. CPAN testers apparently haven't gotten to it yet.

Update: fails on CPAN Testers Windows when 5.34 and up.

dcsjulio commented 5 months ago

Same here. Build fails using strawberry perl.

I suspect that the reason for that is that File::Find works with slashes, while canonpath returns backslashes on windows.

So when doing the delete of the current directory on the new sub, it fails because that key does not exist.

PhilterPaper commented 5 months ago

That would be quite a "gotcha" (using backslash \ on one hand and slash / on the other). Should be a simple fix, if it is. Note that in Windows, only the command line interpreter requires backslashes, while slashes can normally be used elsewhere.

PhilterPaper commented 2 months ago

Latest release (9.38) same failure.

stevieb9 commented 1 week ago

This problem still persists. Strawberry Perl 5.40.0, Mojo 9.38.