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: ensure 12:00:00 hour part on fake timestamp #3452

Merged
merged 1 commit into from
Jan 16, 2019

Conversation

lovell
Copy link
Contributor

@lovell lovell commented Jan 15, 2019

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

Description of change

Hello, the currency unit tests are currently setting a fake timestamp to 1047010195974, equivalent to 2003-03-07T04:09:55Z. Tests that depend on this value fail on any machine with a TZ of UTC+12 to UTC-4, including the common timezone of UTC itself.

AssertionError: expected 'https://cdn.jsdelivr.net/gh/prebid/currency-file@1/latest.json?date=20030307' to equal 'https://cdn.jsdelivr.net/gh/prebid/currency-file@1/latest.json?date=20030306'

The change in this PR winds the fake timestamp back to the equivalent of 2003-03-06T12:00:00Z so the tests will pass with any TZ from UTC+12 to UTC-11.

Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix @lovell !

@mkendall07 mkendall07 merged commit d626c73 into prebid:master Jan 16, 2019
@lovell lovell deleted the test-currency-timer-epoch branch January 16, 2019 12:13
@lovell
Copy link
Contributor Author

lovell commented Jan 16, 2019

Thanks, this was a quick fix to deal with the effect rather than the cause. The underlying code should probably be modified to use getUTCDate instead of getDate etc.

amuraco pushed a commit to amuraco/Prebid.js that referenced this pull request Jan 28, 2019
ghost pushed a commit to devunrulymedia/Prebid.js that referenced this pull request Jan 30, 2019
pedrolopezmrf pushed a commit to Marfeel/Prebid.js that referenced this pull request Mar 18, 2019
jacekburys-quantcast pushed a commit to jacekburys-quantcast/Prebid.js that referenced this pull request May 15, 2019
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

Successfully merging this pull request may close these issues.

2 participants