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

Tests cannot find timezone file which is present, then fail (should skip) #198

Closed
koobs opened this issue Mar 2, 2016 · 15 comments
Closed
Milestone

Comments

@koobs
Copy link
Contributor

koobs commented Mar 2, 2016

The following tests fail when testing with source obtained from GitHub. The timezone file is present, but the tests do not find/see them.

Beyond identifying the root cause of this issue, th tests should skip, not fail if the tarball cannot be found.

  1. Include the timezone file as a data file for the tests to use (Edit: timezone file is present)
======================================================================
FAIL: testZoneInfoFileEnd1 (dateutil.test.test_tz.TZTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/koobs/repos/freebsd/ports/devel/py-dateutil/work/dateutil-2.5.0/dateutil/test/test_tz.py", line 310, in testZoneInfoFileEnd1
    "EDT", MISSING_TARBALL)
AssertionError: None != u'EDT' : This test fails if you don't have the dateutil timezone file installed. Please read the README

======================================================================
FAIL: testZoneInfoFileStart1 (dateutil.test.test_tz.TZTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/koobs/repos/freebsd/ports/devel/py-dateutil/work/dateutil-2.5.0/dateutil/test/test_tz.py", line 304, in testZoneInfoFileStart1
    MISSING_TARBALL)
AssertionError: None != u'EST' : This test fails if you don't have the dateutil timezone file installed. Please read the README

======================================================================
FAIL: testZoneInfoOffsetSignal (dateutil.test.test_tz.TZTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/koobs/repos/freebsd/ports/devel/py-dateutil/work/dateutil-2.5.0/dateutil/test/test_tz.py", line 317, in testZoneInfoOffsetSignal
    self.assertNotEqual(utc, None, MISSING_TARBALL)
AssertionError: None == None : This test fails if you don't have the dateutil timezone file installed. Please read the README
@pganssle
Copy link
Member

pganssle commented Mar 2, 2016

@koobs How exactly did you download the source here? Are you using the latest version from master? Looks to me like the zoneinfo tarball is included in the github source.

@pganssle pganssle added the build label Mar 2, 2016
@koobs
Copy link
Contributor Author

koobs commented Mar 3, 2016

@pganssle Latest release tag (I was updating the dateutil FreeBSD Port) Was the tarball only recently added, ie; after the last release was tagged?

@koobs
Copy link
Contributor Author

koobs commented Mar 3, 2016

I can confirm that the dateutil-zoneinfo.tar.gz is present in my repo checkout of 2.5.0 (via tag) and the PyPI 2.5.0 sdist.

Somehow the tests aren't finding them

@koobs koobs changed the title Tests requiring timezone file should be skipped, not fail (2.5.0) Tests cannot find timezone file which is present, then fail (should skip) Mar 3, 2016
@pganssle
Copy link
Member

pganssle commented Mar 3, 2016

@koobs I think the tests are not included in the PyPI sdist anyway (see #193).

I'm unable to duplicate the issue on Ubuntu 15.04. I ran:

git clone git@github.com:dateutil/dateutil.git dateutil_clean
cd dateutil_clean
git checkout 2.5.0
python setup.py test

All tests passed, including the ones requiring the tarball, so I'm not quite sure what's going on in your system.

As for the suggestion that we skip the tests if the tarball is missing, I don't think I want to do that now that the tarball is included in the repository in the same way that I wouldn't want to skip all the "easter" related tests if for some reason easter.py wasn't in the source - the tarball is now an actual part of the library and something is wrong if it's missing.

@koobs
Copy link
Contributor Author

koobs commented Mar 3, 2016

@pganssle I had in my original description mentioned that the tests aren't 'yet' in the sdist, being aware of #193 :) I shouldn't have edited it out.

Skipping the test was suggested because it relies on a separate resource in the first place to execute. A skip if a resource is not available is correct, as the failure is elsewhere. I believe most test runners also allow developers to state 'consider skipped tests failures'. That would be the correct way to ensure 'nothing is ever missed', whether by future accidental omission of the timezone file, or otherwise.

If you don't want to skip the tests given the tarball is shipped with the library, then I suppose we need to isolate the root cause of the failure :)

Where do we start?

@koobs
Copy link
Contributor Author

koobs commented Mar 3, 2016

Tests are being run via setup.py test

@pganssle
Copy link
Member

pganssle commented Mar 3, 2016

Yeah, I'm just saying that the resource not being available should now itself be considered a failure condition. There are other skips in the tests that are not failures, because they are platform-specific.

Can you check if it works if you run python updatezinfo.py before running the tests?

@koobs
Copy link
Contributor Author

koobs commented Mar 4, 2016

It works after running that command:

py-dateutil/work/dateutil-2.5.0] python2.7 updatezinfo.py
Downloading tz file from mirror 0
Updating timezone information...
"/tmp/tmpQUnGnq/factory", line 9: warning: time zone abbreviation differs from POSIX standard (Local time zone must be set--see zic manual page)
Done.
Ran 807 tests in 23.417s OK (skipped=16)

@pganssle
Copy link
Member

pganssle commented Mar 4, 2016

@koobs Hm. And a fresh clone of dateutil 2.5.0 doesn't work? Maybe this is a python2.7 issue? I can try it with python 2.7 a bit later.

@koobs
Copy link
Contributor Author

koobs commented Mar 4, 2016

@pganssle Using the plain /tarball/ GitHub API for fetching tagged (2.5.0) sources, so they're clean. I'll test the tests with 3.3, 3.4 and 3.5 and get back to you

@pganssle
Copy link
Member

pganssle commented Mar 4, 2016

@koobs Fresh clone works fine for me with python2.7. Can you clarify what exactly you mean by the "/tarball/ Github API? Exactly what URL are you pulling this tarball from?

@pganssle pganssle added the tests label Mar 4, 2016
@pganssle pganssle added this to the 2.5.1 milestone Mar 4, 2016
@pganssle
Copy link
Member

pganssle commented Mar 8, 2016

@koobs Did you ever figure out what was causing this issue? Ideally I'd like to resolve it before 2.5.1 is released, but I'm still unable to replicate.

@pganssle pganssle modified the milestones: Next bugfix release, 2.5.1 Mar 16, 2016
@pganssle
Copy link
Member

@koobs Let me know if the issue is resolved in 2.5.1.

@koobs
Copy link
Contributor Author

koobs commented Mar 18, 2016

@pganssle Apologies for the delay. I'll check/confirm 2.5.1 then update here

@koobs
Copy link
Contributor Author

koobs commented May 27, 2019

I can no longer reproduce these test failures this with 2.8.0, closing.

@koobs koobs closed this as completed May 27, 2019
@pganssle pganssle modified the milestones: Bugfix release, 2.5.1 Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants