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

update acceptance tests to use new connection scheduling format #16167

Merged
merged 5 commits into from
Sep 13, 2022

Conversation

mfsiega-airbyte
Copy link
Contributor

What

The frontend has moved to the new connection schedule format, so we now want our acceptance tests to also use this path.

Also adds an e2e test for cron scheduling.

@mfsiega-airbyte mfsiega-airbyte requested review from a team and pmossman and removed request for a team August 31, 2022 13:49
@mfsiega-airbyte mfsiega-airbyte marked this pull request as draft August 31, 2022 16:11
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets August 31, 2022 18:45 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 1, 2022 17:41 Inactive
@github-actions github-actions bot added area/platform issues related to the platform area/scheduler labels Sep 7, 2022
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 7, 2022 12:51 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 7, 2022 14:05 Inactive
@mfsiega-airbyte mfsiega-airbyte marked this pull request as ready for review September 7, 2022 15:28
@mfsiega-airbyte mfsiega-airbyte requested review from a team and removed request for a team September 7, 2022 15:30
Copy link
Contributor

@pmossman pmossman left a comment

Choose a reason for hiding this comment

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

@mfsiega-airbyte this looks good to me! I added a few questions/recommendations but I'll mark this as approved and let you decide how many of the suggestions you want to adopt or not.

testHarness.createConnection(TEST_CONNECTION, sourceId, destinationId, List.of(operationId), catalog, ConnectionScheduleType.BASIC,
BASIC_SCHEDULE_DATA).getConnectionId();

for (int i = 0; i < 10; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is basically just to impose a limit on how many times the test checks for the job to succeed, right? Might be worth a comment, or maybe worth adding some explicit logging in the case where we tried 10 times and the job was still waiting so that it's very clear in the case where this test fails

final AirbyteCatalog catalog = testHarness.discoverSourceSchema(sourceId);

final ConnectionScheduleData connectionScheduleData = new ConnectionScheduleData().cron(
new ConnectionScheduleDataCron().cronExpression("* */2 * * * ?").cronTimeZone("UTC"));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add a comment explaining in human language what this cron expression means. I think this one is 'every 2 minutes', right?

This also makes me think it might be worth adding another test case, for a cron expression that we know shouldn't run any time soon, particularly since before we introduced cron schedules, a new scheduled connection always ran immediately

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment to clarify what the cron means.

I do like the idea of another test - in the interest of getting something merged I'll go ahead for now, but I'll add a note to the overall ticket to revisit before closing.

@@ -35,7 +35,8 @@ public static ImmutableMap<String, Object> generateSyncMetadata(final StandardSy
metadata.put("connection_id", standardSync.getConnectionId());

final String frequencyString;
if (standardSync.getManual()) {
// TODO(https://github.com/airbytehq/airbyte/issues/2170): handle cron strings properly.
Copy link
Contributor

Choose a reason for hiding this comment

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

So this basically relies on us "dual-writing" to the old schedule column, and the linked issue is for the clean-up task that will ultimately deprecate the old schedule column, right?

Would it make sense to update the code here right now to prefer the new column if set, and only fall back to getSchedule if the new column wasn't available?

We could even add some logging that tells us whenever this code had to use the old schedule. That way, when we eventually get around to removing the old schedule, we'll have logs that can help improve our confidence that the column is indeed safe to remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved in a separate PR.

@github-actions github-actions bot removed area/scheduler area/platform issues related to the platform labels Sep 12, 2022
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 12, 2022 18:59 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 13, 2022 06:17 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 13, 2022 11:51 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 13, 2022 12:14 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 13, 2022 13:06 Inactive
@mfsiega-airbyte mfsiega-airbyte temporarily deployed to more-secrets September 13, 2022 14:12 Inactive
@mfsiega-airbyte mfsiega-airbyte merged commit 3dfe362 into master Sep 13, 2022
@mfsiega-airbyte mfsiega-airbyte deleted the msiega/cronstrings branch September 13, 2022 15:11
robbinhan pushed a commit to robbinhan/airbyte that referenced this pull request Sep 29, 2022
…ytehq#16167)

* update acceptance tests to use new scheduling format now that frontend has moved over

* readability improvements in sync schedule tests

* fix pmd issues in new acceptance test
jhammarstedt pushed a commit to jhammarstedt/airbyte that referenced this pull request Oct 31, 2022
…ytehq#16167)

* update acceptance tests to use new scheduling format now that frontend has moved over

* readability improvements in sync schedule tests

* fix pmd issues in new acceptance test
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