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 assume time zone is GMT #7

Open
wambold opened this issue Feb 18, 2015 · 3 comments
Open

Tests assume time zone is GMT #7

wambold opened this issue Feb 18, 2015 · 3 comments
Assignees

Comments

@wambold
Copy link
Contributor

wambold commented Feb 18, 2015

I'm in the PST timezone. If I run the tests normally, I get:

Tests run: 125, Failures: 7, Errors: 2, Skipped: 0

But if I run with

TZ=GMT mvn clean package

I get:

Tests run: 125, Failures: 1, Errors: 2, Skipped: 0

A number of your tests make assumptions that they are being run in the GMT time zone. I suggest explictly setting the timezone in your tests or changing your documentation.

@psidnell
Copy link
Owner

psidnell commented Apr 5, 2015

Interesting, we changed to BST in the UK and now I get a similar issue - unit tests failing because the times are an hour out...

It looks like something's amiss with ExpressionFunctions.roundToDay(...)

@psidnell
Copy link
Owner

psidnell commented Apr 5, 2015

I've issued a fix that may relate to this, you may find you don't need to set the TZ manually now to get the tests to pass.

@psidnell psidnell self-assigned this Apr 5, 2015
@dkadams
Copy link
Contributor

dkadams commented Oct 24, 2017

I'm still encountering this issue. Here's the specific failure I'm seeing, in the EDT timezone:

Failed tests: testFormats(org.psidnell.omnifocus.integrationtest.IntegrationTest): Error on line 3 "Learn Engineering",,"2010-12-01",, != "Learn Engineering",,"2010-11-30",, expected:<...ngineering",,"2010-1[2-01]",,> but was:<...ngineering",,"2010-1[1-30]",,>

The root problem is that the export data rightly contain local date times for host system's timezone. IntegrationTest.java relies on comparing baseline committed vs generated exports. So, unless the timezone is somehow set while the tests are run, they will fail unless the test host's system timezone matches with the host on which the baseline was generated.

Create pull request #14 with a fix.

psidnell added a commit that referenced this issue Oct 29, 2017
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

3 participants