Repository navigation
feat(standard-tests): fail on an empty test-scenario set unless acceptance-test-config.yml declares a bypass_reason - #1228
Draft
Anatolii Yatsuk (tolik0) wants to merge 1 commit into
Draft
Anatolii Yatsuk (tolik0) wants to merge 1 commit into
Anatolii Yatsuk (tolik0) wants to merge 1 commit into
Conversation
…tance-test-config.yml declares a bypass_reason An acceptance-test-config.yml that yielded no runnable config made pytest skip every scenario test as an empty parameter set, and the run passed. A connector whose configs were never collected, whose file was missing, or whose layout the reader did not understand looked the same as a tested one. Collection now fails when no scenario can run and no bypass_reason says why. A bypass is accepted at the top level of the file (the whole connector, and the opt-out for a connector without test configs), on a section, or on an entry without config_path. Bypasses are reported as skipped tests carrying the declared reason, grouped by reason, plus one line after collection. The reader also: - parses legacy list-format sections as the section's tests list; - fails with a migration message on a legacy top-level `tests:` key; - treats a missing file as an error for Python and manifest-only connectors, and as a bypass for Java connectors; - wraps invalid entries in an error that names the entry and field but never prints the offending values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
👋 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/empty-scenarios-fail#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/empty-scenarios-failPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Comment on lines
+123
to
+124
| "`acceptance_tests.spec.tests[0]`: no `config_path` and no `bypass_reason` " | ||
| "(keys: `spec_path`).", |
Comment on lines
+400
to
+401
| "*No test scenarios for connector 'source-test': *acceptance-test-config.yml lists no " | ||
| "config the standard tests can run, and declares no `bypass_reason`. Found:", |
Comment on lines
+475
to
+476
| "SKIPPED [[]1[]] *: acceptance-test-config.yml bypasses the connector: " | ||
| "No sandbox account", |
Comment on lines
+503
to
+505
| "source-test: acceptance-test-config.yml declares 3 bypass(es), reported as skipped " | ||
| "tests: connection.tests[[]1[]], basic_read: The GSM config fails check; " | ||
| "full_refresh: Covered by basic_read", |
PyTest Results (Fast)5 788 tests +40 5 757 ✅ +39 12m 5s ⏱️ -5s Results for commit 747d79c. ± Comparison against base commit 2082c2d. This pull request skips 1 test. |
PyTest Results (Full)5 791 tests +40 5 760 ✅ +39 16m 45s ⏱️ -15s Results for commit 747d79c. ± Comparison against base commit 2082c2d. This pull request skips 1 test. |
Anatolii Yatsuk (tolik0)
marked this pull request as draft
October 14, 2026 14:12
4 of 5 tasks
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.
What
Implements P0.3 of the CAT → FAST coverage epic (airbytehq/airbyte-internal-issues#17131, under airbytehq/airbyte-internal-issues#17129): an empty test-scenario set must fail, not silently skip.
Until now,
pytest_generate_testsparametrizedscenariowith whateverget_scenarios()returned. An empty list made pytest skip every scenario test asgot empty parameter setand the run passed. A connector whose configs were never collected, whose file was missing, or whose layout the reader did not understand looked the same as a tested one.How
Zero scenarios is an error. When no scenario can run and no
bypass_reasonexplains why, collection fails with one message that names the file and says why each section and entry produced nothing (e.g.`acceptance_tests.spec.tests[0]`: no `config_path` and no `bypass_reason` (keys: `spec_path`)), followed by the fix. The error is raised withpytrace=Falseoutside theexceptblock, so it prints once, without a traceback.Explicit, machine-readable bypass. A
bypass_reasoncounts in three places:connection: {bypass_reason: ...}), the layout CAT used and that ~285 connectors have today. It is ignored when the section lists a runnable config, as before.config_path. An entry with aconfig_pathalways runs.Only the collected sections count (
spec,connection,discovery,basic_read,full_refresh). Anincrementalbypass or an IAM-role config does not make a connector "bypassed".Bypasses are visible. Each scenario test gets one extra skipped param per distinct reason (
[bypassed-connection-discovery-basic_read-full_refresh],[bypassed-connector]) whose skip message isacceptance-test-config.yml bypasses <scope>: <reason>, and collection prints one line per connector, e.g.source-hibob: acceptance-test-config.yml declares 1 bypass(es), reported as skipped tests: the connector: No test config in GSM for this connector. The reasons land in the JUnit XML.Legacy list-format sections (
connection: [...]) are read as the section'stestslist, throughsection_entries(), which the spec backward-compatibility waiver reader from feat(standard-tests): check spec backward compatibility against the published version #1220 now shares.Legacy top-level
tests:fails with one message naming the file and the migration (rename toacceptance_tests:, nest entries undertests). Converting those 34 connectors is airbytehq/airbyte-internal-issues#16264.A missing file is an error for Python and manifest-only connectors. Java connectors (
language:javainmetadata.yaml) are reported as bypassed, since their Gradle suites test them.No values in failure messages. An entry the scenario model rejects (e.g.
empty_streamsas plain strings) is reported by location, field and rule; pydantic's input values are not printed.Changes
airbyte_cdk/test/standard_tests/_acceptance_test_config.py(new, private): loading, layout errors, scenario and bypass collection, and the empty-set message.docker_base.py:acceptance_test_configandget_scenarios()use it. Newget_scenario_bypasses()anddescribe_empty_scenarios().get_scenarios()raisesMissingAcceptanceTestConfigError(aFileNotFoundError) orAcceptanceTestConfigError(aValueError) instead of warning, so existingexcept FileNotFoundError/except ValueErrorcallers keep working.pytest_hooks.py: the failure, the bypass params and the collection line (pytest_report_collectionfinish).scenario.py: one field,ConnectorTestScenario.bypass_reason, holding the reason on the placeholder scenario of a skipped bypass test. Kept minimal on purpose (see Rollout)._spec_compatibility.py: reads thespecsection through the sharedsection_entries().cdk-migrations.md: new## Upgrading to the next minor release (unreleased)section with a before/now table, the three bypass forms and the migration steps.Fleet impact
Classifier over the 591 non-archived Python and manifest-only connectors on airbyte master (
1e22e3c), and over master plus both fleet PRs:acceptance-test-config.ymlUserWarning, silently skippedtests:expect_recordswithoutpath)Certified connectors newly declaring a bypass: destination-pinecone (GSM holds a config no entry lists) and source-granola (no GSM config).
The connectors kept in the private enterprise repository, whose CI runs the same standard tests, are not affected: the same classifier finds every Python and manifest-only connector there runnable.
Rollout
airbyte-cdk[dev]7.36.0. PR A's new files carryacceptance_tests: {}next to thebypass_reasonbecause 7.36.0 rejects a file withoutacceptance_tests. Neither PR bumps a version (CheckVersionIncrementskips: onlyacceptance-test-config.ymlchanged).feat, no!), with the migration note under the shared "next minor release (unreleased)" heading.scenario.py,docker_base.pyandcdk-migrations.md;git merge-treereports content conflicts in all three. The resolution is mechanical: P1.5 also keepsConnectorTestScenario.bypass_reason, its unknown-key check belongs in_collect_entry()here (which validates each entry), and the two migration notes sit side by side under the same heading. Whichever lands second rebases; when both are in, dropbypass_reasonfromAWAITING_READERin feat(standard-tests): remove the ignored scenario fields and reject acceptance-test-config keys that are not read #1226'stest_scenario_keys.py, since this PR reads it.honor acceptance-test bypass_reason for basic_read) overlaps the bypass handling and can be closed in favor of this one.Follow-ups
Two minor gaps from review, left for a follow-up so this PR stays as reviewed:
get_scenarios()with in-code scenarios and has noacceptance-test-config.ymlnow fails collection, because the bypass lookup reads the file. No connector in the monorepo or the CDK overridesget_scenarios(). Fix: treat a missing file as "no bypasses" whenget_scenarios()returned scenarios.Test plan
unit_tests/test/test_empty_scenarios.py(39 tests,pytesterruns of the real hooks): every bypass form and its scope; the empty-set message; section bypass ignored next to runnable entries; blank and non-string reasons; top-level bypass with and without runnable entries; legacy list sections; legacy top-leveltests:; unusable layouts; missing file for Python, manifest-only and Java; collection failures print once, without a traceback or chained exception; skipped bypass params, ids and grouping; validation errors without values.poetry run pytest unit_tests/test unit_tests/resources: 834 passed, 20 skipped. The skip count depends on the registry: pokeapi's spec backward-compatibility test skips while the registry publishes a newer version than its fixture.poe lintandruff format --checkclean;poe type-checkreports no error in the changed files (the 51 existing errors are unchanged against main); Prettier clean on the new migration section.CLI proofs with this branch's
airbyte-cdk, on copies of monorepo connectors with GSM secrets fetched byairbyte-cdk secrets fetch:connector testexit 0, 9 passed, 3 skippedtests:connector testexit 0 (5 passed, 16 skipped);image testexit 0image testexit 0, 4 passed (discover kept)image testexit 0, 3 passedClassifier: master has 9 + 25 connectors to fix; master plus both fleet PRs has 0 and 0.
🤖 Generated with Claude Code