Skip to content

fix(standard-tests): pass --config when the scenario's config is an empty object - #1240

Draft
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1792509503-standard-tests-empty-config
Draft

devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1792509503-standard-tests-empty-config

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

run_test_job only passed --config when the loaded config dict was truthy. When a scenario declares a config whose content is {} (for example a no-auth connector whose CI secret is {}), the harness dropped --config. check, discover and read then exited with SystemExit: 2 (the following arguments are required: --config).

- if config_dict and verb != "spec":
+ has_config = test_scenario.config_dict is not None or test_scenario.config_path is not None
+ if verb != "spec" and (config_dict or has_config):

Scenarios that declare no config still run without --config. spec never receives one.

Related to https://github.com/airbytehq/oncall/issues/13787:

Found while fixing source-whisky-hunter (airbytehq/airbyte#89520). Its acceptance config points at secrets/config.json, and the GSM secret is {} because the Whisky Hunter API needs no auth.

Tests

  • New unit_tests/test/test_job_runner_config.py covers four cases: an empty config file passes --config (with {} written to it), a non-empty config_dict passes --config, no declared config passes no --config, and spec passes no --config.
  • Without the fix, the empty-file test fails because the captured args are ['discover']. With the fix, the focused tests pass (18 passed). Ruff and mypy are clean.
  • airbyte-cdk connector test . for source-whisky-hunter with this branch: 9 passed, 3 skipped. Without the fix, test_check, test_discover, test_basic_read and test_fail_read_with_bad_catalog fail.

Link to Devin session: https://app.devin.ai/sessions/2de2624e9bb44fcc9e5a390759cab108
Open in Devin Desktop: https://app.devin.ai/desktop/session/2de2624e9bb44fcc9e5a390759cab108?variant=devin

…mpty object

Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

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@devin/1792509503-standard-tests-empty-config#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/1792509503-standard-tests-empty-config

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
  • /prerelease - Triggers a prerelease publish with default arguments
  • /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
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

Comment thread unit_tests/test/test_job_runner_config.py Fixed
Co-Authored-By: bot_apk <apk@cognition.ai>
@github-actions

Copy link
Copy Markdown

PyTest Results (Full)

5 845 tests  +4   5 814 ✅ +4   11m 1s ⏱️ - 5m 40s
    1 suites ±0      31 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 0329775. ± Comparison against base commit 8b721cd.

@github-actions

Copy link
Copy Markdown

PyTest Results (Fast)

5 842 tests  +4   5 811 ✅ +4   12m 10s ⏱️ + 4m 1s
    1 suites ±0      31 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 0329775. ± Comparison against base commit 8b721cd.

This branch has not been deployed

No deployments
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.

0 participants