Repository navigation
feat(standard-tests): run the Docker read test by default and check its records - #1231
Draft
Anatolii Yatsuk (tolik0) wants to merge 6 commits into
Draft
Anatolii Yatsuk (tolik0) wants to merge 6 commits into
Anatolii Yatsuk (tolik0) wants to merge 6 commits into
Conversation
…ts records The Docker read test was skipped everywhere: `--read-from-streams` was registered with default=None, which the fixture turned into "none". Python connectors get no other read in CI until their in-process suite is enabled, so they had no read coverage at all. - `--read-from-streams` and `--read-scenarios` now default to reading; `none` (or `false`) stays the explicit opt-out. - `--read-scenarios=default` falls back to a connector's first read config when none is named config/valid_config/default, so it can no longer skip every read of a connector. `--read-scenarios=none` and a scenario list no longer raise ValueError for the configs they leave out; those configs are skipped. - The Docker read records get the checks of test_basic_read (assert_read_records): records per stream for basic_read configs, schema validation with the validate_schema opt-out, rejected at test_strictness_level: high. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rking directory The platform runs a connector with its working directory on a writable volume. The Docker tests ran in the image's WORKDIR, which the image's non-root user cannot write to, so the Docker read of connectors that download a bulk export to the working directory (source-shopify, source-salesforce) failed with PermissionError in the test only. Run check, discover and read with a tmpfs working directory at /source, the platform's source directory. Also add the migration note for the Docker read test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…er tests in the migration guide Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… matrix The FAST standard-test steps collect the Docker tests too, so with the read on by default the matrix read every connector twice. The `image test` step keeps the read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…of the Docker read CDK 7.36.0 and earlier map only `false` to the opt-out: they read `none` as a stream name and run the Docker discover plus an empty read. The FAST steps of the connector test matrix now pass `false`, which skips the read on every CDK version, and the migration guide and docstrings recommend `false` for CI files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st Python connectors source-s3 and source-hardcoded-records already read through their own integration tests, so the migration note should not claim the Docker read is the first read for every Python connector (review round 2, finding 1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@tolik0/cdk/enable-docker-read-test#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch tolik0/cdk/enable-docker-read-testPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
PyTest Results (Fast)5 776 tests +28 5 746 ✅ +28 10m 35s ⏱️ - 1m 35s Results for commit e70cec4. ± Comparison against base commit 2082c2d. This pull request skips 1 and un-skips 1 tests. |
PyTest Results (Full)5 779 tests +28 5 749 ✅ +28 16m 13s ⏱️ -47s Results for commit e70cec4. ± Comparison against base commit 2082c2d. This pull request skips 1 and un-skips 1 tests. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of airbytehq/airbyte-internal-issues#17137 (P1.4 "Docker read test", under airbytehq/airbyte-internal-issues#17129). Companion monorepo PR: airbytehq/airbyte#88939.
What
test_docker_image_build_and_readrunsreadinside the connector image, and it never ran. The cause:--read-from-streamswas registered without a default.getoption(default=...)fallback for a registered option.none.Neither the CDK's connector matrix nor the connector monorepo passed the option. Python connectors' in-process tests are deselected in the monorepo until P0.7, so the standard tests never run a
readfor a Python connector. Onlysource-s3andsource-hardcoded-recordsread, through their own integration tests.This PR:
--read-from-streamsand--read-scenariosget a real default,default.--read-from-streams=false(ornone, from this release on) stays the opt-out.PYTEST_ADDOPTS=--read-from-streams=falseworks forairbyte-cdk image test, which has no pytest passthrough.falsein CI files: CDK 7.36.0 and earlier readnoneas a stream name and run the read.test_basic_read. A config underbasic_readgoes through the sameassert_read_recordscall:empty_streamsare not read.validate_schema: falseopts out, and is rejected attest_strictness_level: highbefore any Docker command.full_refreshmust return some records.check,discoverandreadin a writable/sourceworking directory (an in-memorytmpfs), as the platform does. The imageWORKDIRis not writable by theairbyteuser. Because of that,source-shopifyandsource-salesforcefailed the read withPermissionErroron their bulk-export temp files. A sync never hits that error.--read-scenariosread only configs namedconfig,valid_configordefault. 12 source connectors name their read configs differently and would have skipped the read once it was enabled. They now read their first read config.--read-scenarios=noneraised aValueErrorfor every config, and a list raised one for each config it left out. Both now skip.connector-tests.ymlalso collect the Docker tests, so they pass--read-from-streams=false. Theimage teststep keeps the read.How
--read-scenarios(which configs)default: configs namedconfig,valid_configordefault; else the first read config expected to succeedall, a comma list of config names,none(skip)--read-from-streams(which streams)default: the connector'ssuggestedStreams, or every read stream when it declares none or none of them is readall, a comma list of stream names,false/none(skip; onlyfalseskips on CDK 7.36.0 and earlier)The test calls only
assert_read_recordsandassert_schema_validation_opt_out_allowedfrom_read_assertions.py, both onmain. P1.2's follow-up checks (primary keys, state) can be added to both reads later without touching this test's control flow.Files
airbyte_cdk/test/standard_tests/pytest_hooks.py: real defaults for both options, fixture parsing, docstrings.airbyte_cdk/test/standard_tests/docker_base.py: default scenario selection, stream selection, record checks,/sourceworking directory forcheck,discoverandread.unit_tests/test/test_docker_read.py(new, 28 tests)..github/workflows/connector-tests.yml:--read-from-streams=falsein both FAST steps.cdk-migrations.md: new "Upgrading to the next minor release (unreleased)" section.Fleet impact
Measured locally against the published images of airbytehq/airbyte
master(1e22e3c689c), on this branch. Each connector ran twice: with--read-from-streams=none(the read skipped, as today) and with the new default.check/discoverfails today: expired or missing test credentials, test accounts gone)status: failedones)tests:config (airbytehq/airbyte-internal-issues#16264)Newly red Python connectors (stream names only)
source-facebook-marketingads_insights*streamssource-google-adsaccount_performance_report,geographic_view_with_metrics; itssuggestedStreamslists 13 stream names that no longer existsource-facebook-pagesempty_streamssource-linnworksstock_locations,stock_location_detailssource-marketoactivities_*streams (test activities aged out)source-fireboltsource-rechargeplans.discount_amountis a decimal string, the schema says integersource-zoho-crmenummisses historical values (Industry,Lead_Source)Cost of the default read per Python connector:
suggestedStreamsand so reads all its activity exports.On 5 certified manifest-only connectors the read took 11 to 159 s (klaviyo).
--read-from-streams=allcosts up to 4 minutes more per connector (stripe, freshdesk), so it is not the default.Manifest-only connectors were sampled, not swept. Their in-process
test_basic_read(#1218) already runs the same checks on every read config and stream, and its 23 red connectors were fixed on master. The Docker read covers a subset of that. It can only add failures from two places: the image itself (packaging, file system), or the connector's pinned SDM base version (baseImageinmetadata.yaml), which can differ from the CDK of the unpinned CLI. The sample showed neither.Rollout
pageno longer listed inempty_streams), facebook-marketing and marketo (streams without test data declared inempty_streams), zoho-crm (picklistenum) and the google-adssuggestedStreams. It leaves recharge (a breaking type change), linnworks and firebolt (test data) and the google-ads test window to their owners.poe test-integration-testswith--read-from-streams=false. Every CDK version honours that value: 7.36.0 skips the read with it, checked onsource-pokeapi. That PR is a no-op until this release and safe to merge first.cdk-migrations.mdconflicts with feat(standard-tests): remove the ignored scenario fields and reject acceptance-test-config keys that are not read #1226, feat(standard-tests): lint spec structure, form rendering and OAuth config paths #1227, feat(standard-tests): fail on an empty test-scenario set unless acceptance-test-config.yml declares a bypass_reason #1228 and feat(standard-tests): check primary keys, state messages and error traces in read tests #1230, which all add a section under the same "next minor release (unreleased)" heading. The resolution is mechanical: keep the sections side by side. The code files merge cleanly with all four.test_basic_read. Whichever lands second makes the Docker read pass the same arguments toassert_read_records.cdk-migrations.md, "Upgrading to the next minor release (unreleased)".Test plan
unit_tests/test: 812 passed, 9 skipped (28 new intest_docker_read.py)poe type-check(mypyairbyte_cdk) cleannone/default/allon 11 published connector images (5 certified manifest-only, 6 Python). The manifest-only rows ran before the writable/sourceworking directory was added;source-klaviyo,source-pokeapiandsource-intercomwere re-run green on the final branchnone/defaulton the 58 Python sources with anacceptance-test-config.yml: 49 run, 9 not run (8 no test secret, 1 rotating refresh token)Test Connectorsmatrix on this PR green (source-google-driveonly runs whenfile_basedchanges)🤖 Generated with Claude Code