-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
add a test to keep available cron time zones in sync #15929
Conversation
final StandardSync actual = new StandardSync(); | ||
ConnectionScheduleHelper.populateSyncFromScheduleTypeAndData(actual, | ||
ConnectionScheduleType.CRON, new ConnectionScheduleData() | ||
.cron(new ConnectionScheduleDataCron() | ||
.cronTimeZone(expectedTimezone) | ||
.cronExpression(EXPECTED_CRON_EXPRESSION))); | ||
assertEquals(ScheduleType.CRON, actual.getScheduleType()); | ||
assertEquals(expectedTimezone, actual.getScheduleData().getCron().getCronTimeZone()); | ||
assertEquals(EXPECTED_CRON_EXPRESSION, actual.getScheduleData().getCron().getCronExpression()); | ||
} catch (IllegalArgumentException | JsonValidationException e) { | ||
throw (RuntimeException) new RuntimeException( | ||
"One of the timezones is not supported - update airbyte-webapp/src/config/availableCronTimeZones.json!") | ||
.initCause(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dumb question: what here is actually validating the cron string is valid? Put another way, trying to understand what part of the call chain changing here will require us changing the FE supported time zones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually not super obvious, but: https://github.com/airbytehq/airbyte/blob/master/airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/ConnectionScheduleHelper.java#L62 (which is in the API codepath) will throw an exception if we give it a bad timezone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! can we add this in as a comment for future readers?
* add a test to keep available cron time zones in sync * clarify test comment
What
Add a test to keep the available cron timezone list in sync between frontend and backend.
How
(1) copy the frontend list into the server package; (2) for each timezone, check that the API accepts it; (3) leave a large comment and test failure message to point on that the frontend list should be updated if the test fails.