airbyte-cdk 6.60.9__py3-none-any.whl → 6.60.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airbyte_cdk/cli/airbyte_cdk/_connector.py +10 -0
- airbyte_cdk/cli/airbyte_cdk/_image.py +12 -1
- airbyte_cdk/test/models/scenario.py +5 -0
- airbyte_cdk/test/standard_tests/pytest_hooks.py +18 -3
- {airbyte_cdk-6.60.9.dist-info → airbyte_cdk-6.60.10.dist-info}/METADATA +1 -1
- {airbyte_cdk-6.60.9.dist-info → airbyte_cdk-6.60.10.dist-info}/RECORD +10 -10
- {airbyte_cdk-6.60.9.dist-info → airbyte_cdk-6.60.10.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.60.9.dist-info → airbyte_cdk-6.60.10.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.60.9.dist-info → airbyte_cdk-6.60.10.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.60.9.dist-info → airbyte_cdk-6.60.10.dist-info}/entry_points.txt +0 -0
@@ -123,11 +123,18 @@ def connector_cli_group() -> None:
|
|
123
123
|
multiple=True,
|
124
124
|
help="Additional argument(s) to pass to pytest. Can be specified multiple times.",
|
125
125
|
)
|
126
|
+
@click.option(
|
127
|
+
"--no-creds",
|
128
|
+
is_flag=True,
|
129
|
+
default=False,
|
130
|
+
help="Skip tests that require credentials (marked with 'requires_creds').",
|
131
|
+
)
|
126
132
|
def connector_test(
|
127
133
|
connector: str | Path | None = None,
|
128
134
|
*,
|
129
135
|
collect_only: bool = False,
|
130
136
|
pytest_args: list[str] | None = None,
|
137
|
+
no_creds: bool = False,
|
131
138
|
) -> None:
|
132
139
|
"""Run connector tests.
|
133
140
|
|
@@ -147,6 +154,9 @@ def connector_test(
|
|
147
154
|
if collect_only:
|
148
155
|
pytest_args.append("--collect-only")
|
149
156
|
|
157
|
+
if no_creds:
|
158
|
+
pytest_args.extend(["-m", "not requires_creds"])
|
159
|
+
|
150
160
|
run_connector_tests(
|
151
161
|
connector_name=connector_name,
|
152
162
|
connector_directory=connector_directory,
|
@@ -100,10 +100,17 @@ def build(
|
|
100
100
|
"--image",
|
101
101
|
help="Image to test, instead of building a new one.",
|
102
102
|
)
|
103
|
+
@click.option(
|
104
|
+
"--no-creds",
|
105
|
+
is_flag=True,
|
106
|
+
default=False,
|
107
|
+
help="Skip tests that require credentials (marked with 'requires_creds').",
|
108
|
+
)
|
103
109
|
def image_test( # "image test" command
|
104
110
|
connector: str | None = None,
|
105
111
|
*,
|
106
112
|
image: str | None = None,
|
113
|
+
no_creds: bool = False,
|
107
114
|
) -> None:
|
108
115
|
"""Test a connector Docker image.
|
109
116
|
|
@@ -124,7 +131,11 @@ def image_test( # "image test" command
|
|
124
131
|
connector_name, connector_directory = resolve_connector_name_and_directory(connector)
|
125
132
|
|
126
133
|
# Select only tests with the 'image_tests' mark
|
127
|
-
|
134
|
+
pytest_filter = "image_tests"
|
135
|
+
if no_creds:
|
136
|
+
pytest_filter += " and not requires_creds"
|
137
|
+
|
138
|
+
pytest_args = ["-m", pytest_filter]
|
128
139
|
if not image:
|
129
140
|
metadata_file_path: Path = connector_directory / "metadata.yaml"
|
130
141
|
try:
|
@@ -186,3 +186,8 @@ class ConnectorTestScenario(BaseModel):
|
|
186
186
|
**self.model_dump(exclude={"status"}),
|
187
187
|
status="succeed",
|
188
188
|
)
|
189
|
+
|
190
|
+
@property
|
191
|
+
def requires_creds(self) -> bool:
|
192
|
+
"""Return True if the scenario requires credentials to run."""
|
193
|
+
return bool(self.config_path and "secrets" in self.config_path.parts)
|
@@ -161,7 +161,7 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
|
|
161
161
|
if test_class is None:
|
162
162
|
return
|
163
163
|
|
164
|
-
#
|
164
|
+
# Check that the class is compatible with our test suite
|
165
165
|
scenarios_attr = getattr(test_class, "get_scenarios", None)
|
166
166
|
if scenarios_attr is None:
|
167
167
|
raise ValueError(
|
@@ -169,6 +169,21 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
|
|
169
169
|
"Please define the 'scenarios' attribute in the test class."
|
170
170
|
)
|
171
171
|
|
172
|
+
# Get the scenarios defined or discovered in the test class
|
172
173
|
scenarios = test_class.get_scenarios()
|
173
|
-
|
174
|
-
|
174
|
+
|
175
|
+
# Create pytest.param objects with special marks as needed
|
176
|
+
parametrized_scenarios = [
|
177
|
+
pytest.param(
|
178
|
+
scenario,
|
179
|
+
marks=[pytest.mark.requires_creds] if scenario.requires_creds else [],
|
180
|
+
)
|
181
|
+
for scenario in scenarios
|
182
|
+
]
|
183
|
+
|
184
|
+
# Parametrize the 'scenario' argument with the scenarios
|
185
|
+
metafunc.parametrize(
|
186
|
+
"scenario",
|
187
|
+
parametrized_scenarios,
|
188
|
+
ids=[str(scenario) for scenario in scenarios],
|
189
|
+
)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
airbyte_cdk/__init__.py,sha256=lZNgioD1bHnzRbPK-TXjo7JOVKEL8mz9b5uflj-wIFI,12232
|
2
2
|
airbyte_cdk/cli/__init__.py,sha256=CXsai3MYMLZ_sqi2vPAIVcKDun8VRqlv0cKffBI0iSY,346
|
3
3
|
airbyte_cdk/cli/airbyte_cdk/__init__.py,sha256=8IoEcbdYr7CMAh97Xut5__uHH9vV4LKUtSBNTk3qEWY,2031
|
4
|
-
airbyte_cdk/cli/airbyte_cdk/_connector.py,sha256=
|
5
|
-
airbyte_cdk/cli/airbyte_cdk/_image.py,sha256=
|
4
|
+
airbyte_cdk/cli/airbyte_cdk/_connector.py,sha256=3AaKtp7QIuJcVrk7eHB9JokDyw2mTSBNiHCdpreL5no,6500
|
5
|
+
airbyte_cdk/cli/airbyte_cdk/_image.py,sha256=1Yu5CL5Eo07eY0OPBSgv1NfKoyNXualRr14KeGn0F0E,5773
|
6
6
|
airbyte_cdk/cli/airbyte_cdk/_manifest.py,sha256=aFdeeWgek7oXR3YfZPxk7kBZ64Blmsr0dAXN6BVGiIA,482
|
7
7
|
airbyte_cdk/cli/airbyte_cdk/_secrets.py,sha256=zkO9bO5pfOA-EJb0HRdEdSiybMFkyiqiQ6MWXldAg0s,17630
|
8
8
|
airbyte_cdk/cli/airbyte_cdk/_version.py,sha256=ohZNIktLFk91sdzqFW5idaNrZAPX2dIRnz---_fcKOE,352
|
@@ -389,14 +389,14 @@ airbyte_cdk/test/mock_http/response.py,sha256=s4-cQQqTtmeej0pQDWqmG0vUWpHS-93lIW
|
|
389
389
|
airbyte_cdk/test/mock_http/response_builder.py,sha256=F-v7ebftqGj7YVIMLKdodmU9U8Dq8aIyllWGo2NGwHc,8331
|
390
390
|
airbyte_cdk/test/models/__init__.py,sha256=5f5oFcuUA3dyNTfvvTWav2pTD8WX4nznObKgMTmvdus,290
|
391
391
|
airbyte_cdk/test/models/outcome.py,sha256=niSX6gkP4P-_kQUF1jkbBXq72FC3Rtkvtdl0gJsUyho,2263
|
392
|
-
airbyte_cdk/test/models/scenario.py,sha256=
|
392
|
+
airbyte_cdk/test/models/scenario.py,sha256=M6vq4btxUI6ZiSQNNoNFOgUsZNDFdoieGOTe-AVHstc,6435
|
393
393
|
airbyte_cdk/test/standard_tests/__init__.py,sha256=TGCSc9bqfiEhdfyz7SVqwBog2CsCY1unCXocSXswtV0,1369
|
394
394
|
airbyte_cdk/test/standard_tests/_job_runner.py,sha256=PF3ffgaB8ZQX5bdNLL37wq7S9P3VJhGBXsNIIv6JSb4,5639
|
395
395
|
airbyte_cdk/test/standard_tests/connector_base.py,sha256=AhM856o5cFYN6bKYvyTdNLP7NFKYWXR_-U6kXqDAHdQ,4994
|
396
396
|
airbyte_cdk/test/standard_tests/declarative_sources.py,sha256=4lmXKVJEhYeZAYaaXODwkn-DoJt_V--Thbea0kzOqdc,3502
|
397
397
|
airbyte_cdk/test/standard_tests/destination_base.py,sha256=MARZip2mdo_PzGvzf2VBTAfrP4tbjrJYgeJUApnAArA,731
|
398
398
|
airbyte_cdk/test/standard_tests/docker_base.py,sha256=zWrtv4aKKLXc4cLuAp0c2BpLSGu8-PY94Ytf_nEfx9M,16016
|
399
|
-
airbyte_cdk/test/standard_tests/pytest_hooks.py,sha256=
|
399
|
+
airbyte_cdk/test/standard_tests/pytest_hooks.py,sha256=GSlVx31K0kvk7VX0k4B5Stywba8RU67HsLQ5B8ij5Sw,6263
|
400
400
|
airbyte_cdk/test/standard_tests/source_base.py,sha256=-V8vOJhPndIYUOhBkM85mHSee4jCN0JvGTrF_AaSTaQ,7010
|
401
401
|
airbyte_cdk/test/standard_tests/util.py,sha256=ncXVo6f_gJS2z_Pn6d_OhkuSVRiTy1D5SsPpRYAYWm4,3267
|
402
402
|
airbyte_cdk/test/state_builder.py,sha256=kLPql9lNzUJaBg5YYRLJlY_Hy5JLHJDVyKPMZMoYM44,946
|
@@ -424,9 +424,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
|
|
424
424
|
airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
|
425
425
|
airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
|
426
426
|
airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
|
427
|
-
airbyte_cdk-6.60.
|
428
|
-
airbyte_cdk-6.60.
|
429
|
-
airbyte_cdk-6.60.
|
430
|
-
airbyte_cdk-6.60.
|
431
|
-
airbyte_cdk-6.60.
|
432
|
-
airbyte_cdk-6.60.
|
427
|
+
airbyte_cdk-6.60.10.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
|
428
|
+
airbyte_cdk-6.60.10.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
|
429
|
+
airbyte_cdk-6.60.10.dist-info/METADATA,sha256=KXyH_12QEMpUTXIqXvPXvEFanE8Km-uA1aAK0Hax_o0,6478
|
430
|
+
airbyte_cdk-6.60.10.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
431
|
+
airbyte_cdk-6.60.10.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
|
432
|
+
airbyte_cdk-6.60.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|