fix(standard-tests): validate CONNECTION_STATUS in test_docker_image_build_and_check#991
Draft
devin-ai-integration[bot] wants to merge 3 commits intomainfrom
Draft
Conversation
…build_and_check Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 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@devin/1776447019-fix-docker-check-status-validation#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 devin/1776447019-fix-docker-check-status-validationPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
|
/prerelease
|
2 tasks
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.
Related to https://github.com/airbytehq/airbyte-internal-issues/issues/16212:
Summary
DockerConnectorTestSuite.test_docker_image_build_and_checkinairbyte_cdk/test/standard_tests/docker_base.pyhad two gaps that allowed aconnector to silently pass CI even when its
checkcommand returnedCONNECTION_STATUS: FAILED:CONNECTION_STATUSvalidation. The test only calledrun_docker_airbyte_command(..., raise_if_errors=True), which only inspectsTRACE ERRORmessages. A connector whosecheckexited with code0andemitted
CONNECTION_STATUS: FAILED(without a trace error) passed the test.status: failedscenarios were skipped. When a scenario'sacceptance-test-config.ymlentry declaredstatus: "failed", the testearly-returned via
pytest.skip(...), soinvalid_config.json-stylescenarios were never exercised at all.
This PR closes both gaps:
pytest.skipforexpect_exception()scenarios is removed, sostatus: failedconfigs now actually run the containerizedcheck.run_docker_airbyte_commandis only asked to raise on trace errors when thescenario expects success; otherwise the test inspects the result directly.
_assert_check_result_matches_expected_outcomehelper asserts thatexactly one
CONNECTION_STATUSmessage was emitted and that its statusmatches the scenario's
ExpectedOutcome(SUCCEEDED/FAILED, withALLOW_ANYstill accepting either).The bug was originally surfaced while working on
airbyte#76373
(
source-google-ads), where aDynamicStreamCheckConfigregression returnedCONNECTION_STATUS: FAILEDbut CI stayed green.Test Coverage
A new unit test file
unit_tests/test/test_docker_base.pycovers the newhelper with 9 parametrized cases, including the two regression cases called
out above (IDs
succeed_scenario_with_failed_status_raises__gap_1andfailed_scenario_with_failed_status_passes__gap_2). These tests constructEntrypointOutputobjects directly with syntheticCONNECTION_STATUSmessages, so they exercise the assertion logic without needing Docker.
Declarative-First Evaluation: not applicable — this change is in the CDK's
standard-test harness, not in a declarative connector manifest.
Breaking Change Evaluation: not a breaking change for connector end users. The
change tightens an internal test in the CDK's standard-test suite, which may
cause previously-passing connectors to fail CI if their
checkwas returningFAILED(or emitting zero/multipleCONNECTION_STATUSmessages) against astatus: "succeed"scenario — but that is the intended behavior and thereason for the fix. No connector runtime behavior is modified, so standard
semantic versioning (PATCH/MINOR, handled by the CDK's release-drafter)
applies.
This PR is marked
Related torather thanResolvesbecause the test-harnessfix doesn't directly close the investigative issue on its own — follow-up may
be needed to confirm no connectors regress when this tightened check lands.
Happy to flip it to
Resolvesif the triager prefers.Review & Testing Checklist for Human
test_docker_image_build_and_checkto assert onCONNECTION_STATUSis the intended behavior, and that it's acceptablefor any in-flight connectors whose
checkquietly returnsFAILEDforstatus: "succeed"scenarios to start failing CI.Related tovsResolveschoice for the linked oncallissue.
test against a connector locally) to make sure the assertion output is
actionable.
Notes
ALLOW_ANY/ missing-status scenarios.handles versioning on merge.
Link to Devin session: https://app.devin.ai/sessions/030e6c81e83a484a8cff5faa48d1eb29