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 Stripe: adding integration tests #33306

Merged
merged 49 commits into from Jan 11, 2024
Merged

Conversation

maxi297
Copy link
Contributor

@maxi297 maxi297 commented Dec 11, 2023

What

Adding integration tests for source-stripe events stream

How

Recommended reading order

  1. `airbyte-integrations/connectors/source-stripe/unit_tests/integration/test_events.py``
  2. The rest

Copy link

vercel bot commented Dec 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Jan 11, 2024 3:16pm

Copy link
Contributor

github-actions bot commented Dec 11, 2023

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@maxi297
Copy link
Contributor Author

maxi297 commented Dec 11, 2023

Currently failing because some of the tooling is not release until this is released

_a_response().build()
)
self._read(_config().with_start_date(_A_START_DATE))
http_mocker.assert_number_of_calls(request, 3) # one call for full_refresh availability, one call for incremental availability and one call for the actual read
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a CDK bug? why does it check the full refresh availability if we're reading in incremental mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a CDK bug but a stripe one if it's one. See

is_available, reason = self._check_availability_for_sync_mode(stream, SyncMode.full_refresh, logger, source, None)
if not is_available or not stream.supports_incremental:
return is_available, reason
return self._check_availability_for_sync_mode(stream, SyncMode.incremental, logger, source, {stream.cursor_field: 0})

Basically, as long as the stream is available in full_refresh and supports incremental, we check availability for both

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like the team tried to add the state in the availability strategy in order to check properly (see #32223). It feels like this is a case where we instantiate things without all the information and hence we need to update the library which we agreed is not a good pattern.

My feeling is that when we will have full_refresh with state, we will need to rethink that so I would punt on that

assert output.most_recent_state == {"events": {"created": cursor_value}}

@HttpMocker()
def test_given_state_when_read_then_use_state_for_query_params(self, http_mocker: HttpMocker) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

the query params are derived from the stream slices, not the state, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The stream slices is a implementation detail. At this level, the input that affect the HTTP requests is the state

@maxi297 maxi297 changed the title [ISSUE #32871] source-stripe streams integration tests 🐛 Source Stripe: adding integration tests Dec 15, 2023
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Dec 15, 2023
@maxi297 maxi297 marked this pull request as ready for review December 15, 2023 18:54
@octavia-squidington-iv octavia-squidington-iv requested a review from a team December 15, 2023 18:56
Copy link
Contributor

@girarda girarda left a comment

Choose a reason for hiding this comment

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

:shipit:

@maxi297 maxi297 merged commit 5b0c717 into master Jan 11, 2024
25 of 26 checks passed
@maxi297 maxi297 deleted the issue-32871/test_events branch January 11, 2024 15:50
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
Co-authored-by: maxi297 <maxi297@users.noreply.github.com>
Co-authored-by: Catherine Noll <clnoll@users.noreply.github.com>
Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
Co-authored-by: maxi297 <maxi297@users.noreply.github.com>
Co-authored-by: Catherine Noll <clnoll@users.noreply.github.com>
Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
Co-authored-by: maxi297 <maxi297@users.noreply.github.com>
Co-authored-by: Catherine Noll <clnoll@users.noreply.github.com>
Co-authored-by: Brian Lai <51336873+brianjlai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/stripe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants