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

CAT: fixed TestSpec.test_oauth_is_default_method to skip connector spec without predicate key #34559

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 3.3.1
Fix TestSpec.test_oauth_is_default_method to skip connectors that doesn't have predicate_key object.

## 3.3.0
Add `test_certified_connector_has_allowed_hosts` and `test_certified_connector_has_suggested_streams` tests to the `connector_attribute` test suite

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,8 @@ def test_oauth_is_default_method(self, skip_oauth_default_method_test: bool, act
advanced_auth = actual_connector_spec.advanced_auth
if not advanced_auth:
pytest.skip("Source does not have OAuth method.")
if not advanced_auth.predicate_key:
pytest.skip("Advanced Auth object does not have predicate_key, only one option to authenticate.")

spec_schema = actual_connector_spec.connectionSpecification
credentials = advanced_auth.predicate_key[0]
Expand Down
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 = "connector-acceptance-test"
version = "3.2.0"
version = "3.3.1"
description = "Contains acceptance tests for connectors."
authors = ["Airbyte <contact@airbyte.io>"]
license = "MIT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,61 @@ def test_validate_oauth_flow(connector_spec, expected_error):
),
"Credentials object does not have oneOf option.",
),
# SUCCESS: Skipped: no predicate key.
(
ConnectorSpecification(
connectionSpecification={
"type": "object",
"properties": {
"api_url": {"type": "object"},
"credentials": {
"type": "object",
"properties": {
"auth_type": {"type": "string", "const": "oauth2.0"},
"client_id": {"type": "string"},
"client_secret": {"type": "string"},
"access_token": {"type": "string"},
"refresh_token": {"type": "string"},
"token_expiry_date": {"type": "string", "format": "date-time"},
},
},
},
},
advanced_auth={
"auth_flow_type": "oauth2.0",
"oauth_config_specification": {
"oauth_user_input_from_connector_config_specification": {
"type": "object",
"properties": {"domain": {"type": "string", "path_in_connector_config": ["api_url"]}},
},
"complete_oauth_output_specification": {
"type": "object",
"properties": {
"access_token": {"type": "string", "path_in_connector_config": ["credentials", "access_token"]},
"refresh_token": {"type": "string", "path_in_connector_config": ["credentials", "refresh_token"]},
"token_expiry_date": {
"type": "string",
"format": "date-time",
"path_in_connector_config": ["credentials", "token_expiry_date"],
},
},
},
"complete_oauth_server_input_specification": {
"type": "object",
"properties": {"client_id": {"type": "string"}, "client_secret": {"type": "string"}},
},
"complete_oauth_server_output_specification": {
"type": "object",
"properties": {
"client_id": {"type": "string", "path_in_connector_config": ["credentials", "client_id"]},
"client_secret": {"type": "string", "path_in_connector_config": ["credentials", "client_secret"]},
},
},
},
},
),
"Advanced Auth object does not have predicate_key, only one option to authenticate.",
)
]
)
def test_validate_auth_default_method(connector_spec, expected_error):
Expand Down
Loading