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
CDK: assert >0 state messages per read (fix tests) #35906
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @erohmensing and the rest of your teammates on Graphite |
645c51a
to
e490543
Compare
airbyte-cdk/python/unit_tests/sources/file_based/test_scenarios.py
Outdated
Show resolved
Hide resolved
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.
lgtm!
@@ -467,48 +467,46 @@ | |||
) | |||
).build() | |||
|
|||
multi_format_analytics_scenario: TestScenario[InMemoryFilesSource] = ( | |||
csv_analytics_scenario: TestScenario[InMemoryFilesSource] = ( |
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.
This test used to test analytics for multi-format. However, we don't actually support multi format. Although the analytics come out, the read fails silently, which means that we don't get the state message we expect.
Instead, we test the analytics separately (for the cases we do support - one format) and don't allow a read to silently fail.
@@ -1450,7 +1487,6 @@ | |||
} | |||
) | |||
.set_expected_discover_error(AirbyteTracedException, FileBasedSourceError.SCHEMA_INFERENCE_ERROR.value) | |||
.set_expected_records([]) |
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.
These 2 scenarios were scenarios that fail discover. They previously had "0 expected records", but fail silently if sent through the read tests. Instead, they are still discover scenarios, but no longer read scenarios - if discover fails, we don't expect the read to succeed.
These in particular don't assert any specific expected errors, which hints toward silent failure. If we got these cases to yell more aggressively about their errors, we could bring them back as read tests with expected errors.
.set_expected_discover_error(AirbyteTracedException, FileBasedSourceError.SCHEMA_INFERENCE_ERROR.value) | ||
).build() | ||
|
||
csv_no_records_scenario: TestScenario[InMemoryFilesSource] = ( |
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.
New scenario - a basic test for if we get 0 records in an expected, okay way. Essentially - if there's no data available, we expect 0 records, and I added this case to make sure that even if 0 records are synced, we get a state message.
discover_failure_scenarios = [ | ||
earlier_csv_scenario, | ||
empty_schema_inference_scenario, | ||
] | ||
|
||
discover_success_scenarios = [ | ||
csv_no_records_scenario, |
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.
See other comment - not all discover scenarios can be used as read scenarios, as some that fail discover do not read successfully (in that they don't error successfully either)
airbyte-cdk/python/unit_tests/sources/file_based/test_scenarios.py
Outdated
Show resolved
Hide resolved
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.
✔️
airbyte-cdk/python/unit_tests/sources/file_based/test_scenarios.py
Outdated
Show resolved
Hide resolved
ae515d5
to
7ee8a18
Compare
Merge activity
|
What
How
🚨 User Impact 🚨
None - test changes
Pre-merge Actions
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.0.0.1
Dockerfile
has version0.0.1
README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog with an entry for the initial version. See changelog exampledocs/integrations/README.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
Updating a connector
Community member or Airbyter
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
Connector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:generateScaffolds
then checking in your changesUpdating the Python CDK
Airbyter
Before merging:
--use-local-cdk --name=source-<connector>
as optionsairbyte-ci connectors --use-local-cdk --name=source-<connector> test
After merging: