Skip to content

Conversation

aaronsteers
Copy link
Contributor

@aaronsteers aaronsteers commented Sep 29, 2025

Replace the existing configuration DSL with a simpler smoke-tests DSL and add relevant documentation to support the changes.

Summary by CodeRabbit

  • New Features
    • Introduced smoke-test scenarios driven by metadata.yaml, including named scenarios and stream include/exclude controls.
    • Added default “default-scenario” with explicit config placeholders.
    • Added automatic stream filtering when building configured catalogs.
  • Refactor
    • Unified success/failure handling under a single expect_failure flag across test flows.
    • Switched from id-based to name-based scenario selection.
  • Tests
    • Legacy acceptance-test configs are supported via a conversion path to the new scenario model.
    • Updated discovery/read tests to honor expect_failure and centralized stream filtering.
  • Documentation
    • Updated docstrings to reflect the new smoke-test paradigm.

@Copilot Copilot AI review requested due to automatic review settings September 29, 2025 20:13
Copy link

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

Testing This CDK Version

You 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@aj/ci/tests/new-smoke-tests-dsl-config-dialect#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 aj/ci/tests/new-smoke-tests-dsl-config-dialect

Helpful Resources

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment

📝 Edit this welcome message.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the smoke test DSL by replacing the existing complex acceptance test configuration with a cleaner, metadata.yaml-based approach. The changes modernize test scenario definitions and improve the overall testing experience.

  • Replaces complex acceptance test configuration with simplified smoke test DSL in metadata.yaml
  • Updates scenario handling to use new expect_failure field instead of status-based expectations
  • Refactors stream filtering logic to use new callback-based approach instead of explicit empty stream lists

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
airbyte_cdk/test/standard_tests/source_base.py Updates test methods to use new scenario properties and stream filtering
airbyte_cdk/test/standard_tests/docker_base.py Adds metadata.yaml parsing and updates scenario handling for new DSL format
airbyte_cdk/test/standard_tests/declarative_sources.py Updates default scenario creation to use new required fields
airbyte_cdk/test/standard_tests/_job_runner.py Simplifies job execution logic by removing outcome expectations
airbyte_cdk/test/models/scenario.py Major refactor introducing new ConnectorTestScenario model and legacy support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

)

if scenario.expected_outcome.expect_success() and not result.records:
if scenario.expect_failure and not result.records:
Copy link
Preview

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

The logic is inverted. This should check if not scenario.expect_failure and not result.records: to assert that records are expected when the scenario should succeed.

Suggested change
if scenario.expect_failure and not result.records:
if not scenario.expect_failure and not result.records:

Copilot uses AI. Check for mistakes.

)
for stream in discovered_catalog.streams
if stream.name in streams_list
if scenario.get_streams_filter()(stream.name)
Copy link
Preview

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

This filter is applied incorrectly. The condition should also check if stream.name in streams_list to respect the existing stream filtering logic from read_from_streams.

Suggested change
if scenario.get_streams_filter()(stream.name)
if stream.name in streams_list and scenario.get_streams_filter()(stream.name)

Copilot uses AI. Check for mistakes.

Comment on lines +272 to +273
if "config_file" not in definition:
raise ValueError("Smoke test scenario definition must include a 'config_file' field.")
Copy link
Preview

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

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

This validation is too strict. According to the documentation, scenarios can use config_settings without a config_file, but this code requires config_file to always be present.

Suggested change
if "config_file" not in definition:
raise ValueError("Smoke test scenario definition must include a 'config_file' field.")
if "config_file" not in definition and "config_settings" not in definition:
raise ValueError("Smoke test scenario definition must include either a 'config_file' or 'config_settings' field.")

Copilot uses AI. Check for mistakes.

Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

📝 Walkthrough

Walkthrough

Introduces a new smoke-test oriented ConnectorTestScenario and LegacyAcceptanceTestScenario, updates scenario construction and config handling, replaces expected_outcome logic with a single expect_failure flag, adds metadata.yaml-driven scenario loading, and centralizes stream filtering via get_streams_filter across job runner, docker test suite, and source tests.

Changes

Cohort / File(s) Summary
Test models overhaul
airbyte_cdk/test/models/scenario.py
Adds ConnectorTestScenario and LegacyAcceptanceTestScenario models, metadata.yaml-based scenario builders, merged config loading with connector_root, stream filtering via get_streams_filter, expect_failure helpers, and legacy-to-smoke conversion. Deprecates legacy acceptance-test fields/flow.
Default scenario construction
airbyte_cdk/test/standard_tests/_job_runner.py, airbyte_cdk/test/standard_tests/declarative_sources.py
Replaces no-arg construction with ConnectorTestScenario(name="default-scenario", config_file=None, config_settings={}). Shifts flow control from expected_outcome to expect_failure.
Docker test suite flow and loading
airbyte_cdk/test/standard_tests/docker_base.py
Adds connector_metadata_yaml_path, loads smokeTests from metadata.yaml when present; otherwise converts legacy tests via LegacyAcceptanceTestScenario.as_test_scenario(). Switches to expect_failure, name-based scenario selection, and stream filtering via get_streams_filter.
Source tests control flow
airbyte_cdk/test/standard_tests/source_base.py
Uses expect_failure to gate discover/read assertions. Removes empty_streams filtering; applies scenario.get_streams_filter when building configured catalog. Cleans up unused imports.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Test Runner
  participant DTS as DockerConnectorTestSuite
  participant Meta as metadata.yaml
  participant Legacy as LegacyAcceptanceTestScenario
  participant CTS as ConnectorTestScenario
  participant Src as Source Under Test

  Dev->>DTS: get_scenarios()
  alt metadata.yaml has smokeTests
    DTS->>Meta: read smokeTests
    Meta-->>DTS: definitions
    DTS->>CTS: from_metadata_smoke_test_definition(...)
    DTS-->>Dev: [CTS...]
  else legacy path
    DTS->>Legacy: model_validate(legacy_config)
    Legacy->>CTS: as_test_scenario()
    DTS-->>Dev: [CTS...]
  end

  loop per scenario
    Dev->>Src: check(config from CTS.get_config_dict)
    alt CTS.expect_failure
      note right of Dev: Expect error on check
      Src-->>Dev: error/exception
    else
      Src-->>Dev: OK
      Dev->>Src: discover()
      Src-->>Dev: catalog
      Dev->>Dev: filter streams via CTS.get_streams_filter()
      Dev->>Src: read(filtered catalog)
      alt CTS.expect_failure
        note right of Dev: Any success is unexpected
      else
        Src-->>Dev: records
      end
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

testing

Suggested reviewers

  • dbgold17
  • brianjlai
  • maxi297

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Tests: Simplify smoke-tests DSL and update documentation" accurately captures the main thrust of the changeset. The changes systematically replace a legacy acceptance-test configuration model with a new smoke-test oriented DSL, introducing ConnectorTestScenario with new fields and methods, refactoring test flows to use simpler expect_failure flags instead of complex expected_outcome checks, and adding metadata-driven construction from YAML smokeTests definitions. While the title doesn't explicitly mention the removal of legacy acceptance test patterns or the specific new features added, it correctly identifies the core intent—simplifying the smoke-test configuration language—and the changeset does appear to be oriented around this simplification goal.
Docstring Coverage ✅ Passed Docstring coverage is 88.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch aj/ci/tests/new-smoke-tests-dsl-config-dialect

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25132b6 and 5ca54c9.

📒 Files selected for processing (5)
  • airbyte_cdk/test/models/scenario.py (4 hunks)
  • airbyte_cdk/test/standard_tests/_job_runner.py (4 hunks)
  • airbyte_cdk/test/standard_tests/declarative_sources.py (1 hunks)
  • airbyte_cdk/test/standard_tests/docker_base.py (9 hunks)
  • airbyte_cdk/test/standard_tests/source_base.py (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
airbyte_cdk/test/standard_tests/declarative_sources.py (1)
airbyte_cdk/test/models/scenario.py (1)
  • ConnectorTestScenario (130-376)
airbyte_cdk/test/standard_tests/_job_runner.py (2)
airbyte_cdk/test/models/scenario.py (1)
  • ConnectorTestScenario (130-376)
airbyte_cdk/test/entrypoint_wrapper.py (1)
  • errors (204-205)
airbyte_cdk/test/standard_tests/docker_base.py (1)
airbyte_cdk/test/models/scenario.py (5)
  • LegacyAcceptanceTestScenario (379-461)
  • ConnectorTestScenario (130-376)
  • from_metadata_yaml (194-251)
  • as_test_scenario (445-461)
  • get_streams_filter (171-191)
airbyte_cdk/test/standard_tests/source_base.py (2)
airbyte_cdk/test/entrypoint_wrapper.py (3)
  • errors (204-205)
  • catalog (241-245)
  • records (150-151)
airbyte_cdk/test/models/scenario.py (1)
  • get_streams_filter (171-191)
airbyte_cdk/test/models/scenario.py (1)
airbyte_cdk/test/models/outcome.py (2)
  • ExpectedOutcome (15-61)
  • from_status_str (26-40)
🪛 GitHub Actions: Linters
airbyte_cdk/test/standard_tests/docker_base.py

[warning] 1-1: Ruff format would reformat the file. Changes suggested in diff shown.

airbyte_cdk/test/models/scenario.py

[warning] 1-1: Ruff format would reformat the file. Changes suggested in diff shown.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Check: destination-motherduck
  • GitHub Check: Check: source-shopify
  • GitHub Check: Check: source-intercom
  • GitHub Check: Check: source-pokeapi
  • GitHub Check: Check: source-hardcoded-records
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.12, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.13, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Manifest Server Docker Image Build
🔇 Additional comments (22)
airbyte_cdk/test/standard_tests/declarative_sources.py (1)

76-80: LGTM! Default scenario construction updated correctly.

The explicit construction with name="default-scenario", config_file=None, and config_settings={} aligns well with the new smoke-test DSL requiring keyword-only fields. This provides a clear fallback when no scenario is provided.

airbyte_cdk/test/standard_tests/source_base.py (4)

62-66: LGTM! Scenario-based skip logic is clearer.

Using scenario.expect_failure directly for the skip condition is more straightforward than the previous exception-based approach. The skip message clearly indicates why the test is being skipped.


116-120: Good—passing full scenario and checking for expected failure.

Passing the complete scenario to discover (instead of a modified copy) and then checking scenario.expect_failure with discover_result.errors for early return is the right pattern for the new DSL.


122-131: Stream filtering via get_streams_filter() looks correct.

The removal of inline empty-stream filtering and reliance on scenario.get_streams_filter()(stream.name) centralizes the filtering logic as intended by the new DSL.


142-143: Verify the assertion logic here—is the condition inverted?

Line 142-143 raises an error when scenario.expect_failure is true AND no records are returned. This seems backwards—shouldn't we raise an error when we don't expect failure but receive no records? Or is the intent to flag when an expected failure didn't produce the usual error indicators (records still came through)?

The logic reads: "If we expected failure and got zero records, that's an error." But wouldn't zero records be a reasonable outcome for a failed read?

Could you clarify the intended behavior here, wdyt?

airbyte_cdk/test/standard_tests/_job_runner.py (2)

47-51: LGTM! Default scenario construction matches new API.

The explicit construction with name="default-scenario", config_file=None, and config_settings={} aligns with the new keyword-only fields in ConnectorTestScenario. This provides a sensible fallback.


110-141: Migration to expect_failure looks solid.

The replacement of expected_outcome.expect_exception() checks with test_scenario.expect_failure throughout the error handling and control flow is consistent and correct. The logic for both the check verb and other verbs properly respects the new boolean flag.

airbyte_cdk/test/standard_tests/docker_base.py (6)

88-97: Good addition—connector_metadata_yaml_path centralizes metadata location.

This classproperty provides a clean way to locate and validate the metadata.yaml file. The error message is clear if the file is missing.


140-148: Metadata-first loading path is well-structured.

The early return when result is not None (i.e., when smokeTests is defined in metadata.yaml) ensures the new smoke-test DSL takes precedence over legacy acceptance test configs. This is the right migration strategy.


114-121: Deduplication logic updated correctly for new DSL.

The switch from config_path to config_file and from empty_streams to exclude_streams aligns with the new ConnectorTestScenario field names. The merging and deduplication logic remains sound.


179-181: Legacy scenario conversion via as_test_scenario() looks good.

Constructing LegacyAcceptanceTestScenario and then converting to ConnectorTestScenario via as_test_scenario() provides clean interoperability between old and new config formats.


241-242: Migration to expect_failure is correct.

Replacing scenario.expected_outcome.expect_exception() with scenario.expect_failure simplifies the logic and aligns with the new DSL's single boolean flag.

Also applies to: 302-303


400-400: Stream filtering via get_streams_filter() is correct.

Using scenario.get_streams_filter()(stream.name) when building the configured catalog centralizes the filtering logic as intended.

airbyte_cdk/test/models/scenario.py (9)

1-107: Excellent documentation for the new smoke-test DSL!

The module docstring provides comprehensive examples covering basic configuration, inline config settings, and various stream filtering patterns. This will be very helpful for users migrating from the legacy acceptance-test-config.yml format.


171-191: get_streams_filter() logic is clean and correct.

The filter function correctly handles only_streams (allowlist) and exclude_streams (blocklist) with the right precedence. Returning a callable makes it easy to use inline during stream selection.


193-251: from_metadata_yaml() handles edge cases well.

The method correctly distinguishes between three cases: smokeTests undefined (returns None), defined but empty (returns empty list), and defined with scenarios (returns list of scenarios). The suggested_streams extraction and passing is a nice touch.


253-280: Consider relaxing the config_file requirement here—or documenting why it's mandatory.

Lines 272-273 raise a ValueError if config_file is not in the definition, but the ConnectorTestScenario.config_file field has default=None. This means scenarios can exist without a config file (using only config_settings), yet from_metadata_smoke_test_definition forbids it.

Is the intent to require config_file in metadata-driven scenarios while allowing programmatic construction without it? If so, a docstring note would clarify this. Otherwise, consider allowing config_file to be optional here too, wdyt?


282-306: with_expecting_failure/success methods avoid unnecessary copies—nice optimization.

The early return when the expect_failure value is already correct avoids creating redundant copies. This is a good pattern for immutability with efficiency.


308-311: requires_creds heuristic is reasonable.

Checking for "secrets" in the path parts is a simple and effective heuristic for determining whether a scenario needs credentials.


313-348: get_config_dict() merges config correctly.

The method properly handles the precedence: config from file first, then overlay with config_settings. The path resolution logic (making relative paths absolute) and the empty_if_missing parameter are both sensible.


379-461: LegacyAcceptanceTestScenario and as_test_scenario() provide solid backward compatibility.

The legacy class captures the old acceptance test config structure, and as_test_scenario() correctly maps fields to the new ConnectorTestScenario format. The _LEGACY_FAILURE_STATUSES set and status-to-expect_failure conversion are well-handled.


1-1: Address Ruff formatting warning.

The pipeline reports that Ruff format would reformat this file. Please run ruff format on this file to ensure consistent formatting across the codebase, wdyt?

⛔ Skipped due to learnings
Learnt from: aaronsteers
PR: airbytehq/airbyte-python-cdk#13
File: airbyte_cdk/connector.py:99-99
Timestamp: 2024-11-10T04:50:11.914Z
Learning: When a PR's goal is to run the autoformat task from `ruff`, avoid suggesting code changes beyond formatting to prevent potential negative side effects.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

PyTest Results (Fast)

3 772 tests  ±0   3 760 ✅ ±0   6m 2s ⏱️ -13s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 5ca54c9. ± Comparison against base commit 25132b6.

This pull request removes 6 and adds 6 tests. Note that renamed tests count towards both.
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_basic_read['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_check['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_discover['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_check['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_read['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_fail_read_with_bad_catalog['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_basic_read[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_check[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_discover[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_check[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_read[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_fail_read_with_bad_catalog[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
This pull request removes 1 skipped test and adds 1 skipped test. Note that renamed tests count towards both.
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_read['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_read[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]

Copy link

PyTest Results (Full)

3 775 tests  ±0   3 763 ✅ ±0   10m 59s ⏱️ -3s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 5ca54c9. ± Comparison against base commit 25132b6.

This pull request removes 6 and adds 6 tests. Note that renamed tests count towards both.
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_basic_read['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_check['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_discover['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_check['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_read['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_fail_read_with_bad_catalog['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_basic_read[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_check[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_discover[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_check[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_read[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_fail_read_with_bad_catalog[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]
This pull request removes 1 skipped test and adds 1 skipped test. Note that renamed tests count towards both.
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_read['valid_config' Test Scenario]
unit_tests.resources.source_pokeapi_w_components_py.integration_tests.test_airbyte_standards.TestSuiteSourcePokeAPI ‑ test_docker_image_build_and_read[name='valid_config' config_file=PosixPath('valid_config.yaml') config_settings=None expect_failure=False only_streams=None exclude_streams=[] suggested_streams_only=False suggested_streams=None configured_catalog_path=None]

expect_records: AcceptanceTestExpectRecords | None = None
file_types: AcceptanceTestFileTypes | None = None
status: Literal["succeed", "failed", "exception"] | None = None
suggested_streams: list[str] | None = Field(default=None, kw_only=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

it feels strange to support this if we want to encourage the suggested streams to be defined in a single place elsewhere in the metadata file. Do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 suggestedStreams is actually already a thing and it happens to already be defined in metadata.yaml.

I'll find an example to post here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh. Do you mean it's weird to define inside the scenario?

Good point, this isn't intended to be redefined - only passed in by the caller that has access to the full file. I'll clarify that

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 figured the caller would only need the boolean suggested_streams_only to tell the test suite whether to pull the suggested streams out of the metadata file

suggested_streams: list[str] | None = Field(default=None, kw_only=True)
"""List of suggested stream names for the connector (if provided)."""

configured_catalog_path: Path | None = Field(default=None, kw_only=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

how does passing a configured catalog intersect with some of the other options to specify which streams to sync?

Also, IIRC you were a fan of not including the option to specify a catalog. In what cases would this be specified?

class AcceptanceTestEmptyStream(BaseModel):
name: str
bypass_reason: str | None = None
expect_failure: bool = Field(default=False, kw_only=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we had previously discussed the possibility of specifying which step [spec, check, discover, read] we expected to fail. I'm all for keeping it simple, so I prefer this, but I wonder if others on the team want that additional flexibility?

Copy link
Contributor Author

@aaronsteers aaronsteers Sep 29, 2025

Choose a reason for hiding this comment

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

I considered that too. Thanks for raising.

My concern is that tests today are not always clear in regards to where the failure should happen. If we wanted to add more control later, we could still do so.

We could do so either by extending to accept bool | Literal["check", "discover", "read"] or maybe even bool | dict if we wanted to accept something like expect_failure.message_contains`.

Because the bool alone handles what I think the immediate current migration scenarios would be from existing test definitions, I'm inclined to keep it there unless anyone wants to advocate for a specific spec for this first iteration. (Assuming this starting specification is suitably forwards compatible.)


@property
def expected_outcome(self) -> ExpectedOutcome:
"""Whether the test scenario expects an exception to be raised.
Copy link
Contributor

Choose a reason for hiding this comment

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

the docstring doesn't seem to match what the method is called

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. This is carry over, I think. I'll clean it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants