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

Source-acceptance-test: improvements #3888

Merged
merged 10 commits into from
Jun 8, 2021

Conversation

vovavovavovavova
Copy link
Contributor

@vovavovavovavova vovavovavovavova commented Jun 4, 2021

Closes #3467

How

By solving listed issues described in the issue.
Please note, that solving (3) issue makes old acceptance-test-config.yml files incompatible, because it contains old state_path field and does not contain required future_state_path. Config field need to be overwritten.

@@ -51,11 +51,12 @@ def future_state_fixture(future_state_path) -> Path:

@pytest.fixture(name="cursor_paths")
def cursor_paths_fixture(inputs, configured_catalog_for_incremental) -> Mapping[str, Any]:
cursor_paths = getattr(inputs, "cursor_paths")
cursor_paths = getattr(inputs, "cursor_paths", None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cursor_paths = getattr(inputs, "cursor_paths", None)
cursor_paths = getattr(inputs, "cursor_paths", {})

result = {}

for stream in configured_catalog_for_incremental.streams:
path = cursor_paths.get(stream.stream.name, [stream.cursor_field[-1]])
default_ = [stream.cursor_field[-1]]
Copy link
Contributor

Choose a reason for hiding this comment

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

then you don't need to change anythin here

Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

LGTM with some comments.

Can you create a follow up PR which renames state_path in all connectors?

Also you will need to publish the SAT docker image

stream.cursor_field = stream.stream.default_cursor_field[:]
else:
pytest.fail(
"Configured catalog should have `cursor_field` " "either `default_cursor_field` specified for all incremental streams"
Copy link
Contributor

Choose a reason for hiding this comment

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

suggested wording improvement

Suggested change
"Configured catalog should have `cursor_field` " "either `default_cursor_field` specified for all incremental streams"
f"All incremental streams should either have `cursor_field` declared in the configured catalog or `default_cursor_field` specified in the catalog output by discover. Stream {stream.stream.name} does not have either property defined."

@@ -51,7 +51,7 @@ def future_state_fixture(future_state_path) -> Path:

@pytest.fixture(name="cursor_paths")
def cursor_paths_fixture(inputs, configured_catalog_for_incremental) -> Mapping[str, Any]:
cursor_paths = getattr(inputs, "cursor_paths")
cursor_paths = getattr(inputs, "cursor_paths") or {}
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the impact of this change?

Copy link
Contributor Author

@vovavovavovavova vovavovavovavova Jun 7, 2021

Choose a reason for hiding this comment

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

cursor_paths = getattr(inputs, "cursor_paths") returns None if cursor_paths are commented in yaml. This case will fail few lines below on cursor_paths.get

@vovavovavovavova vovavovavovavova changed the title Valdemar/#3467 sat improvements Source-acceptance test: improvements Jun 7, 2021
@vovavovavovavova vovavovavovavova changed the title Source-acceptance test: improvements Source-acceptance-test: improvements Jun 7, 2021
@vovavovavovavova
Copy link
Contributor Author

vovavovavovavova commented Jun 7, 2021

/publish connector=bases/source-acceptance-test

🕑 bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/915474621
✅ bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/915474621

@vovavovavovavova vovavovavovavova merged commit 21394c6 into master Jun 8, 2021
@vovavovavovavova vovavovavovavova deleted the valdemar/#3467_sat_improvements branch June 8, 2021 06:09
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.

SAT: Usability improvements
3 participants