Skip to content

Commit ad3550c

Browse files
feat(live-tests): add enable proxy flag to live tests (airbytehq#52646)
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
1 parent bda219d commit ad3550c

File tree

8 files changed

+116
-18
lines changed

8 files changed

+116
-18
lines changed

.github/workflows/live_tests.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ on:
3333
description: Use the local CDK when building the target connector
3434
default: "false"
3535
type: boolean
36+
disable_proxy:
37+
description: Disable proxy for requests
38+
default: "false"
39+
type: boolean
3640
connection_subset:
3741
description: The subset of connections to select from.
3842
required: true
@@ -108,6 +112,15 @@ jobs:
108112
echo "READ_WITH_STATE_FLAG=" >> $GITHUB_ENV
109113
fi
110114
115+
- name: Setup Proxy Flag
116+
if: github.event_name == 'workflow_dispatch'
117+
run: |
118+
if ${{ github.event.inputs.disable_proxy }}; then
119+
echo "DISABLE_PROXY_FLAG=--connector_live_tests.disable-proxy" >> $GITHUB_ENV
120+
else
121+
echo "DISABLE_PROXY_FLAG=" >> $GITHUB_ENV
122+
fi
123+
111124
- name: Setup Connection Subset Option
112125
if: github.event_name == 'workflow_dispatch'
113126
run: |
@@ -129,4 +142,4 @@ jobs:
129142
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
130143
s3_build_cache_access_key_id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
131144
s3_build_cache_secret_key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
132-
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 }}
145+
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 }}

.github/workflows/regression_tests.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ on:
3333
description: Use the local CDK when building the target connector
3434
default: "false"
3535
type: boolean
36+
disable_proxy:
37+
description: Disable proxy for requests
38+
default: "false"
39+
type: boolean
3640
connection_subset:
3741
description: The subset of connections to select from.
3842
required: true
@@ -114,6 +118,15 @@ jobs:
114118
echo "READ_WITH_STATE_FLAG=" >> $GITHUB_ENV
115119
fi
116120
121+
- name: Setup Proxy Flag
122+
if: github.event_name == 'workflow_dispatch'
123+
run: |
124+
if ${{ github.event.inputs.disable_proxy }}; then
125+
echo "DISABLE_PROXY_FLAG=--connector_live_tests.disable-proxy" >> $GITHUB_ENV
126+
else
127+
echo "DISABLE_PROXY_FLAG=" >> $GITHUB_ENV
128+
fi
129+
117130
- name: Setup Connection Subset Option
118131
if: github.event_name == 'workflow_dispatch'
119132
run: |
@@ -135,4 +148,4 @@ jobs:
135148
github_token: ${{ secrets.GH_PAT_MAINTENANCE_OSS }}
136149
s3_build_cache_access_key_id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
137150
s3_build_cache_secret_key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
138-
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'
151+
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'

airbyte-ci/connectors/live-tests/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,17 @@ The traffic recorded on the control connector is passed to the target connector
174174
| `--auto-select-connection` | Automatically select a connection for testing. | Optional |
175175
| `--stream` | Name of the stream to test. Can be specified multiple times to test multiple streams. | Optional |
176176
| `--should-read-with-state` | Specify whether to read with state. If not provided, a prompt will appear to choose. | Optional |
177+
| `--disable-proxy` | Specify whether to disable proxy. If not provided, a proxy will be enabled. | Optional |
177178
| `--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 |
178179
| `--connection-subset` | The subset of connections to select from. Possible values are "sandboxes" or "all" (defaults to sandboxes). | Optional |
179180

180181
## Changelog
181182

183+
184+
### 0.21.0
185+
Add `disable_proxy` flag
186+
187+
182188
### 0.20.0
183189
Support multiple connection objects in the regression tests suite.
184190

airbyte-ci/connectors/live-tests/poetry.lock

Lines changed: 44 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

airbyte-ci/connectors/live-tests/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "live-tests"
7-
version = "0.20.0"
7+
version = "0.21.0"
88
description = "Contains utilities for testing connectors against live data."
99
authors = ["Airbyte <contact@airbyte.io>"]
1010
license = "MIT"

0 commit comments

Comments
 (0)