Skip to content

Commit

Permalink
Always use fixed TIME as session base in TestDateTimeFunctions
Browse files Browse the repository at this point in the history
Using this will allow to write simpler tests and avoid intermittent
error caused by DST or changes in time zone policies.

Without this change some test would require to rewrite to much logic
from implementation making them less usefull.
  • Loading branch information
fiedukow committed Mar 10, 2017
1 parent 9dc288e commit 6cae932
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package com.facebook.presto.operator.scalar;

import org.joda.time.DateTime;
import org.testng.annotations.Test;

import static com.facebook.presto.spi.StandardErrorCode.FUNCTION_NOT_FOUND;
Expand All @@ -27,6 +28,7 @@ public TestDateTimeFunctions()
testSessionBuilder()
.setTimeZoneKey(TIME_ZONE_KEY)
.setSystemProperty("legacy_timestamp", "false")
.setStartTime(new DateTime(2017, 04, 01, 12, 34, 56, 789, UTC_TIME_ZONE).getMillis())
.build()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package com.facebook.presto.operator.scalar;

import org.joda.time.DateTime;
import org.testng.annotations.Test;

import static com.facebook.presto.spi.type.VarcharType.VARCHAR;
Expand All @@ -29,6 +30,7 @@ public TestDateTimeFunctionsLegacy()
testSessionBuilder()
.setTimeZoneKey(TIME_ZONE_KEY)
.setSystemProperty("legacy_timestamp", "true")
.setStartTime(new DateTime(2017, 04, 01, 12, 34, 56, 789, UTC_TIME_ZONE).getMillis())
.build()
);
}
Expand Down

0 comments on commit 6cae932

Please sign in to comment.