Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(live-tests): add enable proxy flag to live tests #52646

Merged
merged 9 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/live_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ on:
description: Use the local CDK when building the target connector
default: "false"
type: boolean
disable_proxy:
description: Disable proxy for requests
default: "false"
type: boolean
connection_subset:
description: The subset of connections to select from.
required: true
Expand Down Expand Up @@ -108,6 +112,15 @@ jobs:
echo "READ_WITH_STATE_FLAG=" >> $GITHUB_ENV
fi

- name: Setup Proxy Flag
if: github.event_name == 'workflow_dispatch'
run: |
if ${{ github.event.inputs.disable_proxy }}; then
echo "DISABLE_PROXY_FLAG=--connector_live_tests.disable-proxy" >> $GITHUB_ENV
else
echo "DISABLE_PROXY_FLAG=" >> $GITHUB_ENV
fi

- name: Setup Connection Subset Option
if: github.event_name == 'workflow_dispatch'
run: |
Expand All @@ -129,4 +142,4 @@ jobs:
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
s3_build_cache_access_key_id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
s3_build_cache_secret_key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
subcommand: connectors ${{ env.USE_LOCAL_CDK_FLAG }} --name ${{ github.event.inputs.connector_name }} test --only-step connector_live_tests --connector_live_tests.test-suite=live --connector_live_tests.connection-id=${{ github.event.inputs.connection_id }} --connector_live_tests.pr-url=${{ github.event.inputs.pr_url }} ${{ env.READ_WITH_STATE_FLAG }} ${{ env.STREAM_PARAMS }} ${{ env.CONNECTION_SUBSET }}
subcommand: connectors ${{ env.USE_LOCAL_CDK_FLAG }} --name ${{ github.event.inputs.connector_name }} test --only-step connector_live_tests --connector_live_tests.test-suite=live --connector_live_tests.connection-id=${{ github.event.inputs.connection_id }} --connector_live_tests.pr-url=${{ github.event.inputs.pr_url }} ${{ env.READ_WITH_STATE_FLAG }} ${{ env.DISABLE_PROXY_FLAG }} ${{ env.STREAM_PARAMS }} ${{ env.CONNECTION_SUBSET }}
15 changes: 14 additions & 1 deletion .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ on:
description: Use the local CDK when building the target connector
default: "false"
type: boolean
disable_proxy:
description: Disable proxy for requests
default: "false"
type: boolean
connection_subset:
description: The subset of connections to select from.
required: true
Expand Down Expand Up @@ -114,6 +118,15 @@ jobs:
echo "READ_WITH_STATE_FLAG=" >> $GITHUB_ENV
fi

- name: Setup Proxy Flag
if: github.event_name == 'workflow_dispatch'
run: |
if ${{ github.event.inputs.disable_proxy }}; then
echo "DISABLE_PROXY_FLAG=--connector_live_tests.disable-proxy" >> $GITHUB_ENV
else
echo "DISABLE_PROXY_FLAG=" >> $GITHUB_ENV
fi

- name: Setup Connection Subset Option
if: github.event_name == 'workflow_dispatch'
run: |
Expand All @@ -135,4 +148,4 @@ jobs:
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
s3_build_cache_access_key_id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
s3_build_cache_secret_key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
subcommand: connectors ${{ env.USE_LOCAL_CDK_FLAG }} --name ${{ github.event.inputs.connector_name }} test --only-step connector_live_tests --connector_live_tests.test-suite=regression --connector_live_tests.connection-id=${{ github.event.inputs.connection_id }} --connector_live_tests.pr-url=${{ github.event.inputs.pr_url }} ${{ env.READ_WITH_STATE_FLAG }} ${{ env.STREAM_PARAMS }} ${{ env.CONNECTION_SUBSET }} --global-status-check-context="Regression Tests" --global-status-check-description='Running regression tests'
subcommand: connectors ${{ env.USE_LOCAL_CDK_FLAG }} --name ${{ github.event.inputs.connector_name }} test --only-step connector_live_tests --connector_live_tests.test-suite=regression --connector_live_tests.connection-id=${{ github.event.inputs.connection_id }} --connector_live_tests.pr-url=${{ github.event.inputs.pr_url }} ${{ env.READ_WITH_STATE_FLAG }} ${{ env.DISABLE_PROXY_FLAG }} ${{ env.STREAM_PARAMS }} ${{ env.CONNECTION_SUBSET }} --global-status-check-context="Regression Tests" --global-status-check-description='Running regression tests'
6 changes: 6 additions & 0 deletions airbyte-ci/connectors/live-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,17 @@ The traffic recorded on the control connector is passed to the target connector
| `--auto-select-connection` | Automatically select a connection for testing. | Optional |
| `--stream` | Name of the stream to test. Can be specified multiple times to test multiple streams. | Optional |
| `--should-read-with-state` | Specify whether to read with state. If not provided, a prompt will appear to choose. | Optional |
| `--disable-proxy` | Specify whether to disable proxy. If not provided, a proxy will be enabled. | Optional |
| `--test-evaluation-mode` | Whether to run tests in "diagnostic" mode or "strict" mode. In diagnostic mode, eligible tests will always pass unless there's an exception. | Optional |
| `--connection-subset` | The subset of connections to select from. Possible values are "sandboxes" or "all" (defaults to sandboxes). | Optional |

## Changelog


### 0.21.0
Add `disable_proxy` flag


### 0.20.0
Support multiple connection objects in the regression tests suite.

Expand Down
46 changes: 44 additions & 2 deletions airbyte-ci/connectors/live-tests/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion airbyte-ci/connectors/live-tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "live-tests"
version = "0.20.0"
version = "0.21.0"
description = "Contains utilities for testing connectors against live data."
authors = ["Airbyte <[email protected]>"]
license = "MIT"
Expand Down
Loading
Loading