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

improve incremental SAT testing to walk through each stream state instead of just the latest #12802

Merged
merged 7 commits into from
May 18, 2022

Conversation

brianjlai
Copy link
Contributor

@brianjlai brianjlai commented May 12, 2022

What

Our current SAT incremental tests doesn't provide a very strong verification of correct behavior because it only checks the read w/o a state and read using the latest state (which would ultimately result in 0 records returned). This new test provides stronger validation of correctness by walking through multiple stream checkpoints instead of just the first and last. Note this is a first start that still uses cursor date as the assertion criteria. A follow on ticket will be explored to assert against message correctness.

How

This solution adds a new test test_read_sequential_slices that performs a more granular test by checking multiple streams and checkpoints. It does so by performing the following set of steps:

  1. Get the entire set of records being synced by performing a read operation w/o a state value
  2. Partition results into batches of state + record(s)
  3. Loop over these batches and using the initial state value as input make a read operation with the current state value
  4. Verify that all resulting records have a cursor date that is equal to or later than the current state value (This is the current assertion heuristic.

I've tested this against a handful of integrations to verify this won't block validation of our GA or Beta connectors, but in order to avoid adding too many barriers, I've also added the option to disable the test if necessary. By default it will be enabled, but it can be disabled using skip_new_incremental_tests which can be set in acceptance-test-config.yml on a per connector basis.

Recommended reading order

  1. test_incremental.py

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label May 12, 2022
@brianjlai brianjlai changed the title improve SAT test for incrementals to walk through steam states not ju… improve SAT test for incrementals to walk through each stream state instead of just the latest May 12, 2022
@brianjlai brianjlai changed the title improve SAT test for incrementals to walk through each stream state instead of just the latest improve incremental SAT testing to walk through each stream state instead of just the latest May 12, 2022
sample_rate = 1 if len(checkpoint_messages) <= 5 else len(checkpoint_messages) // 5
for message_batch in checkpoint_messages[::sample_rate]:
assert len(message_batch) > 0 and message_batch[0].type == Type.STATE
current_state = message_batch.pop(0)
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 may seem a bit heavy handed to assemble all these partitions just to pop off the state which is used in the next call_read_with_state, but its meant to set up the next part validation in a subsequent PR which uses the record messages from the batch and verifies that they are all present in the result of the current call_read_with_state.

Alternatively, I can remove all the logic and just build a list of state messages, if the check-ins should remain isolated

checkpoint_messages = [message for index, message in enumerate(checkpoint_messages) if message not in checkpoint_messages[:index]]

# To avoid spamming APIs we only test a fraction of slices
sample_rate = 1 if len(checkpoint_messages) <= 5 else len(checkpoint_messages) // 5
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 the most sophisticated way of fractionally determining how many API requests to make

Copy link
Contributor

Choose a reason for hiding this comment

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

another approach could be to try all slices until we reach a slice that has new messages, but no old ones - that should be enough to confirm incrementals work as expected

@girarda
Copy link
Contributor

girarda commented May 12, 2022

@brianjlai can you run the tests for the GA connectors? Looks like there's only 3 of them https://github.com/airbytehq/airbyte/blob/master/airbyte-config/init/src/main/resources/seed/source_definitions.yaml

try:
# try second time as an absolute path in state file (i.e. bookmarks -> stream_name -> column -> value)
state_value = cursor_field.parse(record=state, path=state_cursor_paths[stream_name])
except KeyError:
Copy link
Contributor

Choose a reason for hiding this comment

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

@brianjlai do you know why this sometimes fails to find the state value?

Copy link
Contributor Author

@brianjlai brianjlai May 13, 2022

Choose a reason for hiding this comment

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

Great question! So I am not sure this was working as intended up to this point. In the original comparison, we tested all the record messages against the latest state message. This works for the latest state message because it carries the final states of all prior streams. But going one at a time, I noticed it would fail both parses and the test would fail.

When we compare each stream one at a time forward, the current state message might not have state for the upcoming stream if it is the first one. This allows us to basically skip cursor comparisons if there is no cursor to compare on in state. Also, when reading w/ state, we get messages for the remaining streams in the configured catalog which we should also skip since there is no cursor in the state for it yet. And we'll check it on subsequent reads

Copy link
Contributor

Choose a reason for hiding this comment

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

got it. makes sense!

@@ -70,11 +70,17 @@ def records_with_state(records, state, stream_mapping, state_cursor_paths) -> It
cursor_field = helper.field(stream.cursor_field)
record_value = cursor_field.parse(record=record.record.data)
try:
if state[stream_name] is None:
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 needed? I'd expect the test to only run for streams that exist

Copy link
Contributor Author

@brianjlai brianjlai May 13, 2022

Choose a reason for hiding this comment

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

For some reason yes. It's annoying, but w/o it we end up with a TypeErro when we parse the None type. This was a real state coming from our SAT tests from hubspot:

type=<Type.STATE: 'STATE'> log=None spec=None connectionStatus=None catalog=None record=None
state=AirbyteStateMessage(data={'companies': {'updatedAt': '2022-05-02T11:15:24.476000+00:00'},
'contact_lists': {'updatedAt': 1634044407353}, 'contacts': {'updatedAt': '2022-05-05T14:31:15.068000+00:00'},
'deals': {'updatedAt': '2022-05-11T05:39:31.131000+00:00'}, 'email_events': None})

checkpoint_messages = [message for index, message in enumerate(checkpoint_messages) if message not in checkpoint_messages[:index]]

# To avoid spamming APIs we only test a fraction of slices
sample_rate = 1 if len(checkpoint_messages) <= 5 else len(checkpoint_messages) // 5
Copy link
Contributor

Choose a reason for hiding this comment

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

another approach could be to try all slices until we reach a slice that has new messages, but no old ones - that should be enough to confirm incrementals work as expected

checkpoint_messages = [message for index, message in enumerate(checkpoint_messages) if message not in checkpoint_messages[:index]]

# To avoid spamming APIs we only test a fraction of slices
sample_rate = 1 if len(checkpoint_messages) <= 5 else len(checkpoint_messages) // 5
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: this is the number of slices to check, not a rate

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I would suggest renaming - was a bit confused when first reading through

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.

approved pending integration tests passing for GA sources

Copy link
Contributor

@pedroslopez pedroslopez left a comment

Choose a reason for hiding this comment

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

Looking good! nice setup for even more validations 😄

@@ -110,6 +110,9 @@ class IncrementalConfig(BaseConfig):
default=0,
ge=0,
)
skip_new_incremental_tests: Optional[bool] = Field(
Copy link
Contributor

Choose a reason for hiding this comment

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

"new" as an option feels like it might quickly become an inadequate name , I would suggest a more descriptive name (e.g. ensure_stream_state_consistency - don't love the name but perhaps something similar)

Copy link
Contributor Author

@brianjlai brianjlai May 13, 2022

Choose a reason for hiding this comment

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

great point yeah, the name doesn't tell you much in its current form. I'll adjust it! trying to balance something generic so we don't have too many of these toggles. something like skip_comprehensive_incremental_tests so at least new doesn't get stale, but it still doesn't tell much about what is being skipped :/

response.
"""
if inputs.skip_new_incremental_tests:
pytest.skip("Skipping new incremental test based on acceptance-test-config.yml")
Copy link
Contributor

Choose a reason for hiding this comment

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

When I used pytest.skip within another SAT test I found it was also marking as skipped my unit test that tested the skipping. You may want to mock it and add a return here.

if not inputs.ensure_trace_message_on_failure:
pytest.skip("Skipping `test_airbyte_trace_message_on_failure` because `inputs.ensure_trace_message_on_failure=False`")
return

Copy link
Contributor Author

Choose a reason for hiding this comment

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

were you able to mock the pytest.skip method in your tests? i was playing around with some variations of mocking, but haven't been able to override the behavior to just skip and return

pytest_mock = MagicMock()
pytest_mock.skip.return_value = ""

Copy link
Contributor

@pedroslopez pedroslopez May 17, 2022

Choose a reason for hiding this comment

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

I was! Here's an example:

with patch.object(pytest, "skip", return_value=None):

The return would need to be added after pytest.skip in the SAT case itself

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sweet thanks! and yup already added the return below, but will add the mock in now as well

Comment on lines 149 to 157
Incremental test that makes an initial API request without a state checkpoint. Then we partition the results by stream and
slice checkpoints resulting in batches of messages that look like:
<state message>
<record message>
...
<record message>

Using these batches, we then make API requests using the state message and verify the the correctness of the messages in the
response.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice description! I'm not sure it's appropriate to talk about "APIs" here though. Maybe say "call the read method" instead of "make an API request"?

checkpoint_messages = [message for index, message in enumerate(checkpoint_messages) if message not in checkpoint_messages[:index]]

# To avoid spamming APIs we only test a fraction of slices
sample_rate = 1 if len(checkpoint_messages) <= 5 else len(checkpoint_messages) // 5
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I would suggest renaming - was a bit confused when first reading through

@brianjlai brianjlai marked this pull request as ready for review May 17, 2022 03:26
@brianjlai
Copy link
Contributor Author

brianjlai commented May 17, 2022

/test connector=connectors/source-salesforce

🕑 connectors/source-salesforce https://github.com/airbytehq/airbyte/actions/runs/2336065071
✅ connectors/source-salesforce https://github.com/airbytehq/airbyte/actions/runs/2336065071
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        76      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_incremental.py       121     26    79%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  950    247    74%
Name                                 Stmts   Miss  Cover
--------------------------------------------------------
source_salesforce/__init__.py            2      0   100%
source_salesforce/exceptions.py          8      1    88%
source_salesforce/api.py               150     19    87%
source_salesforce/streams.py           306     67    78%
source_salesforce/rate_limiting.py      22      6    73%
source_salesforce/source.py             77     33    57%
source_salesforce/utils.py               8      7    12%
--------------------------------------------------------
TOTAL                                  573    133    77%
Name                                 Stmts   Miss  Cover
--------------------------------------------------------
source_salesforce/utils.py               8      0   100%
source_salesforce/__init__.py            2      0   100%
source_salesforce/source.py             77      6    92%
source_salesforce/api.py               150     14    91%
source_salesforce/exceptions.py          8      1    88%
source_salesforce/rate_limiting.py      22      3    86%
source_salesforce/streams.py           306     43    86%
--------------------------------------------------------
TOTAL                                  573     67    88%

@brianjlai
Copy link
Contributor Author

brianjlai commented May 17, 2022

/test connector=connectors/source-facebook-marketing

🕑 connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2336067332
✅ connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2336067332
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        76      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_incremental.py       121     26    79%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  950    247    74%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              34      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/api.py                               96     12    88%
source_facebook_marketing/streams/base_streams.py             127     27    79%
source_facebook_marketing/streams/common.py                    41     13    68%
source_facebook_marketing/streams/streams.py                   97     32    67%
source_facebook_marketing/source.py                            39     16    59%
source_facebook_marketing/streams/base_insight_streams.py     129     54    58%
source_facebook_marketing/streams/async_job.py                210    134    36%
source_facebook_marketing/streams/async_job_manager.py         78     60    23%
-------------------------------------------------------------------------------
TOTAL                                                         855    348    59%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/async_job.py                210      0   100%
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              34      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/streams/common.py                    41      1    98%
source_facebook_marketing/source.py                            39      1    97%
source_facebook_marketing/streams/async_job_manager.py         78      3    96%
source_facebook_marketing/api.py                               96      9    91%
source_facebook_marketing/streams/base_insight_streams.py     129     13    90%
source_facebook_marketing/streams/streams.py                   97     22    77%
source_facebook_marketing/streams/base_streams.py             127     30    76%
-------------------------------------------------------------------------------
TOTAL                                                         855     79    91%

@brianjlai
Copy link
Contributor Author

brianjlai commented May 17, 2022

/test connector=connectors/source-google-sheets

🕑 connectors/source-google-sheets https://github.com/airbytehq/airbyte/actions/runs/2336380319
✅ connectors/source-google-sheets https://github.com/airbytehq/airbyte/actions/runs/2336380319
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        76      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_incremental.py       121     26    79%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  950    247    74%
Name                                                Stmts   Miss  Cover
-----------------------------------------------------------------------
google_sheets_source/models/spreadsheet_values.py      12      0   100%
google_sheets_source/models/spreadsheet.py             34      0   100%
google_sheets_source/models/__init__.py                 2      0   100%
google_sheets_source/__init__.py                        2      0   100%
google_sheets_source/helpers.py                       139     26    81%
google_sheets_source/client.py                         22      5    77%
google_sheets_source/google_sheets_source.py          103     84    18%
-----------------------------------------------------------------------
TOTAL                                                 314    115    63%

Python short test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestIncremental.test_two_sequential_reads because not found in the config
================== 22 passed, 1 skipped in 170.95s (0:02:50) ===================

@brianjlai
Copy link
Contributor Author

brianjlai commented May 17, 2022

/test connector=connectors/source-hubspot

🕑 connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/2336380446
✅ connectors/source-hubspot https://github.com/airbytehq/airbyte/actions/runs/2336380446
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        76      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_incremental.py       121     26    79%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  950    247    74%
Name                         Stmts   Miss  Cover
------------------------------------------------
source_hubspot/errors.py         6      0   100%
source_hubspot/__init__.py       2      0   100%
source_hubspot/streams.py      714     61    91%
source_hubspot/source.py        69     12    83%
------------------------------------------------
TOTAL                          791     73    91%

@brianjlai
Copy link
Contributor Author

brianjlai commented May 17, 2022

/test connector=connectors/source-sendgrid

🕑 connectors/source-sendgrid https://github.com/airbytehq/airbyte/actions/runs/2339223018
✅ connectors/source-sendgrid https://github.com/airbytehq/airbyte/actions/runs/2339223018
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        76      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_incremental.py       121     26    79%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  950    247    74%
Name                          Stmts   Miss  Cover
-------------------------------------------------
source_sendgrid/__init__.py       2      0   100%
source_sendgrid/source.py        19      4    79%
source_sendgrid/streams.py      137     54    61%
-------------------------------------------------
TOTAL                           158     58    63%

@brianjlai
Copy link
Contributor Author

brianjlai commented May 17, 2022

/test connector=connectors/source-stripe

🕑 connectors/source-stripe https://github.com/airbytehq/airbyte/actions/runs/2339223390
✅ connectors/source-stripe https://github.com/airbytehq/airbyte/actions/runs/2339223390
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        76      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_incremental.py       121     26    79%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  950    247    74%
Name                        Stmts   Miss  Cover
-----------------------------------------------
source_stripe/__init__.py       2      0   100%
source_stripe/streams.py      235     66    72%
source_stripe/source.py        22     11    50%
-----------------------------------------------
TOTAL                         259     77    70%

@pedroslopez
Copy link
Contributor

@brianjlai do you know if these /test commands build/run the version of the SAT on this branch, or if they just pull the latest published SAT from docker hub?

@brianjlai
Copy link
Contributor Author

@brianjlai do you know if these /test commands build/run the version of the SAT on this branch, or if they just pull the latest published SAT from docker hub?

Yup! The command should include the new tests. The test runs above have my new tests in run output during the action:

test_incremental.py::test_read_with_multiple_states[test_incremental_with_2_states-records0-state_records0-0-None] ✓58% █████▊
	  test_incremental.py::test_read_with_multiple_states[test_first_incremental_only_younger_records-records1-state_records1-0-AssertionError] ✓58% █████▊
	  test_incremental.py::test_read_with_multiple_states[test_incremental_with_threshold-records2-state_records2-3-None] ✓59% █████▉
	  test_incremental.py::test_read_with_multiple_states[test_incremental_with_incorrect_messages-records3-state_records3-0-AssertionError] ✓59% █████▉
	  test_incremental.py::test_read_with_multiple_states[test_incremental_with_multiple_streams-records4-state_records4-0-None] ✓60% ██████
	  test_incremental.py::test_read_with_multiple_states[test_incremental_with_none_state-records5-state_records5-0-None] ✓60% ██████

@brianjlai
Copy link
Contributor Author

brianjlai commented May 18, 2022

/test connector=connectors/source-zendesk-support

🕑 connectors/source-zendesk-support https://github.com/airbytehq/airbyte/actions/runs/2346113003
❌ connectors/source-zendesk-support https://github.com/airbytehq/airbyte/actions/runs/2346113003
🐛 https://gradle.com/s/gbdqjqgpmukcc
Python short test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - Failed: Please check...
=================== 1 failed, 29 passed in 169.71s (0:02:49) ===================

@brianjlai
Copy link
Contributor Author

brianjlai commented May 18, 2022

/publish connector=bases/source-acceptance-test auto-bump-version=false

🕑 bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/2346642162
🚀 Successfully published bases/source-acceptance-test
✅ bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/2346642162

@brianjlai
Copy link
Contributor Author

brianjlai commented May 18, 2022

/test connector=connectors/source-facebook-marketing

🕑 connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2347853524
✅ connectors/source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/2347853524
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        77      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/tests/test_incremental.py       121     25    79%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_core.py              294    106    64%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  960    246    74%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              34      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/api.py                               96     12    88%
source_facebook_marketing/streams/base_streams.py             127     27    79%
source_facebook_marketing/streams/common.py                    41     13    68%
source_facebook_marketing/streams/streams.py                   97     32    67%
source_facebook_marketing/source.py                            39     16    59%
source_facebook_marketing/streams/base_insight_streams.py     129     54    58%
source_facebook_marketing/streams/async_job.py                210    134    36%
source_facebook_marketing/streams/async_job_manager.py         78     60    23%
-------------------------------------------------------------------------------
TOTAL                                                         855    348    59%
Name                                                        Stmts   Miss  Cover
-------------------------------------------------------------------------------
source_facebook_marketing/streams/async_job.py                210      0   100%
source_facebook_marketing/streams/__init__.py                   2      0   100%
source_facebook_marketing/spec.py                              34      0   100%
source_facebook_marketing/__init__.py                           2      0   100%
source_facebook_marketing/streams/common.py                    41      1    98%
source_facebook_marketing/source.py                            39      1    97%
source_facebook_marketing/streams/async_job_manager.py         78      3    96%
source_facebook_marketing/api.py                               96      9    91%
source_facebook_marketing/streams/base_insight_streams.py     129     13    90%
source_facebook_marketing/streams/streams.py                   97     22    77%
source_facebook_marketing/streams/base_streams.py             127     30    76%
-------------------------------------------------------------------------------
TOTAL                                                         855     79    91%

@brianjlai brianjlai merged commit 13b7b1b into master May 18, 2022
@brianjlai brianjlai deleted the brian/improve_sat_incremental_tests branch May 18, 2022 20:01
suhomud pushed a commit that referenced this pull request May 23, 2022
…tead of just the latest (#12802)

* improve SAT test for incrementals to walk through steam states not just the latest

* convert batch to tuple and pr feedback

* bump version and update changelog

* patch pytest so test doesn't get skipped

* update changelog and dockerfile again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants