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

t-test faillures #5

Closed
PhilterPaper opened this issue Dec 2, 2022 · 6 comments
Closed

t-test faillures #5

PhilterPaper opened this issue Dec 2, 2022 · 6 comments

Comments

@PhilterPaper
Copy link

The latest version (1.006, October 22, 2022) is failing on t-tests t/basic.t subtests 4-7, which were just added. This is on Windows 10 with Strawberry Perl 5.24, 5.26, and 5.32. Could you check this?

C:\Users\Phil\Desktop>cpan

cpan shell -- CPAN exploration and modules installation (v2.34)
Enter 'h' for help.

cpan> upgrade Email::Date::Format
Database was generated on Fri, 02 Dec 2022 15:10:38 GMT

Package namespace         installed    latest  in CPAN file
Email::Date::Format           1.005     1.006  RJBS/Email-Date-Format-1.006.tar.gz
Running install for module 'Email::Date::Format'
Checksum for C:\Strawberry\cpan\sources\authors\id\R\RJ\RJBS\Email-Date-Format-1.006.tar.gz ok
Scanning cache C:\Strawberry\cpan\build for sizes
............................................................................DONE
Configuring R/RJ/RJBS/Email-Date-Format-1.006.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a gmake-style Makefile
Writing Makefile for Email::Date::Format
Writing MYMETA.yml and MYMETA.json
  RJBS/Email-Date-Format-1.006.tar.gz
  C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for R/RJ/RJBS/Email-Date-Format-1.006.tar.gz
cp lib/Email/Date/Format.pm blib\lib\Email\Date\Format.pm
  RJBS/Email-Date-Format-1.006.tar.gz
  C:\Strawberry\c\bin\gmake.exe -- OK
Running make test for RJBS/Email-Date-Format-1.006.tar.gz
"C:\Strawberry\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/00-report-prereqs.t .. #
# Versions for all modules listed in MYMETA.json (including optional ones):
#
# === Configure Requires ===
#
#     Module              Want Have
#     ------------------- ---- ----
#     ExtUtils::MakeMaker 6.78 7.64
#
# === Build Requires ===
#
#     Module              Want Have
#     ------------------- ---- ----
#     ExtUtils::MakeMaker  any 7.64
#
# === Test Requires ===
#
#     Module              Want     Have
#     ------------------- ---- --------
#     ExtUtils::MakeMaker  any     7.64
#     File::Spec           any     3.78
#     Test::More          0.96 1.302191
#
# === Test Recommends ===
#
#     Module         Want     Have
#     ---------- -------- --------
#     CPAN::Meta 2.120900 2.150010
#
# === Runtime Requires ===
#
#     Module      Want Have
#     ----------- ---- ----
#     Exporter    5.57 5.74
#     Time::Local  any 1.30
#     strict       any 1.11
#     warnings     any 1.47
#
t/00-report-prereqs.t .. ok
t/basic.t .............. 1/7
#   Failed test 'positive timezone before year rollover'
#   at t/basic.t line 39.
#          got: '-0500'
#     expected: '+1100'

#   Failed test 'positive timezone after year rollover'
#   at t/basic.t line 40.
#          got: '-0500'
#     expected: '+1100'

#   Failed test 'negative timezone before year rollover'
#   at t/basic.t line 42.
#          got: '-0500'
#     expected: '-0900'

#   Failed test 'negative timezone after year rollover'
#   at t/basic.t line 43.
#          got: '-0500'
#     expected: '-0900'
# Looks like you failed 4 tests of 7.
t/basic.t .............. Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/7 subtests

Test Summary Report
-------------------
t/basic.t            (Wstat: 1024 (exited 4) Tests: 7 Failed: 4)
  Failed tests:  4-7
  Non-zero exit status: 4
Files=2, Tests=8,  1 wallclock secs ( 0.05 usr +  0.05 sys =  0.09 CPU)
Result: FAIL
Failed 1/2 test programs. 4/8 subtests failed.
gmake: *** [Makefile:865: test_dynamic] Error 4
Lockfile removed.
  RJBS/Email-Date-Format-1.006.tar.gz
  C:\Strawberry\c\bin\gmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports RJBS/Email-Date-Format-1.006.tar.gz
Stopping: 'install' failed for 'Email::Date::Format'.
Failed during this command:
 RJBS/Email-Date-Format-1.006.tar.gz          : make_test NO

cpan>

FWIW, I'm in Eastern STANDARD Time (UTC-0500).

@PhilterPaper
Copy link
Author

I see in t/basic.t there is a line $ENV{TZ} = "UTC-11";. While it is certainly no problem to read ENV hash elements in Windows, writing to them seems to be a Dark Art. In a one-liner perl -E "$ENV{TZ} = 'UTC-0500'; print $ENV{TZ};", it works (TZ is not set by default), but I'm not sure how far the TZ element is going to be passed into the library (i.e., how persistent it will be, even when running in the same program). Bottom line is that processes, shell, and ENV is sort of a hacked add-on to Windows duct-taped to the side.

@rjbs
Copy link
Owner

rjbs commented Jan 1, 2023

I can… skip the test on Windows? :/

@PhilterPaper
Copy link
Author

You may have to skip those subtests on Windows ($^O eq 'MSWin32'). I can see that your code doesn't make use of the TZ environment variable directly, but apparently expects other libraries to do so. I can't figure how to get a $ENV{TZ} setting out of the local environment. If I set it like you do ($ENV{TZ} = 'UTC-11';), it appears in the local %ENV (but Data::Dumper doesn't seem to see it!) and even system("echo %TZ%"); shows up changed. Conversely, system("set TZ='UTC-11'"); doesn't seem to show up. At the moment, I'm stumped. I can read existing Windows environment variables such as %Path%, but don't seem to be able to set them except through the system Settings panel. I even tried using Win32::Env to set TZ, but it didn't seem to have any effect. The strange thing is that your first setting of TZ to UTC+4 appears to have worked, as that's the value of TZ for the rest of the basic.t file. That one is declared "local", but using local on other ENV{TZ} = string lines didn't have any effect.

rjbs added a commit that referenced this issue Jan 14, 2023
@rjbs
Copy link
Owner

rjbs commented Jan 14, 2023

Thanks, I've skipped the TZ-setting tests on Win32.

@rjbs rjbs closed this as completed Jan 14, 2023
@PhilterPaper
Copy link
Author

OK, it installs properly on all my Perl levels (Strawberry Perl). Thank you for fixing it!

@rjbs
Copy link
Owner

rjbs commented Jan 14, 2023

You're quite welcome, and thanks for bringing it to my attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants