Skip to content

Commit d6bcc80

Browse files
committed
.
1 parent fbe9733 commit d6bcc80

File tree

2 files changed

+0
-81
lines changed

2 files changed

+0
-81
lines changed

backend/tests/unit/onyx/connectors/test_connector_factory.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -267,49 +267,3 @@ def test_instantiate_connector_loads_class_lazily(self) -> None:
267267
# But the class should have been loaded into cache
268268
assert DocumentSource.WEB in _connector_cache
269269
assert _connector_cache[DocumentSource.WEB].__name__ == "WebConnector"
270-
271-
272-
class TestFactoryValidationScript:
273-
"""Test that provides a validation script for CI/CD."""
274-
275-
def test_validate_all_mappings_cli(self) -> None:
276-
"""Comprehensive validation that can be run in CI."""
277-
print("\n=== CONNECTOR FACTORY VALIDATION ===")
278-
279-
total_connectors = len(CONNECTOR_CLASS_MAP)
280-
successful_loads = 0
281-
errors = []
282-
283-
for source, mapping in CONNECTOR_CLASS_MAP.items():
284-
try:
285-
_load_connector_class(source)
286-
print(f"✓ {source.value}: {mapping.class_name}")
287-
successful_loads += 1
288-
except Exception as e:
289-
error_msg = f"✗ {source.value}: {e}"
290-
print(error_msg)
291-
errors.append(error_msg)
292-
293-
print("\n=== SUMMARY ===")
294-
print(f"Total connectors: {total_connectors}")
295-
print(f"Successfully loaded: {successful_loads}")
296-
print(f"Failed to load: {len(errors)}")
297-
298-
if errors:
299-
print("\n=== ERRORS ===")
300-
for error in errors:
301-
print(error)
302-
pytest.fail(f"Connector validation failed: {len(errors)} errors")
303-
304-
print("✅ All connector mappings are valid!")
305-
306-
307-
if __name__ == "__main__":
308-
# Allow running this file directly for validation
309-
import sys
310-
311-
sys.path.insert(0, "/Users/edwinluo/onyx/backend")
312-
313-
# Run the validation
314-
test = TestFactoryValidationScript()
315-
test.test_validate_all_mappings_cli()

backend/tests/unit/onyx/federated_connectors/test_federated_connector_factory.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -196,38 +196,3 @@ def test_all_federated_connector_sources_mapped(self) -> None:
196196
f"FederatedConnectorSource values without connector mappings: "
197197
f"{[s.value for s in unmapped_sources]}"
198198
)
199-
200-
201-
class TestFederatedConnectorValidationScript:
202-
"""Test that provides a validation script for CI/CD."""
203-
204-
def test_validate_all_federated_mappings_cli(self) -> None:
205-
"""Comprehensive validation that can be run in CI."""
206-
print("\n=== FEDERATED CONNECTOR FACTORY VALIDATION ===")
207-
208-
total_connectors = len(FEDERATED_CONNECTOR_CLASS_MAP)
209-
successful_loads = 0
210-
errors = []
211-
212-
for source, mapping in FEDERATED_CONNECTOR_CLASS_MAP.items():
213-
try:
214-
_load_federated_connector_class(source)
215-
print(f"✓ {source.value}: {mapping.class_name}")
216-
successful_loads += 1
217-
except Exception as e:
218-
error_msg = f"✗ {source.value}: {e}"
219-
print(error_msg)
220-
errors.append(error_msg)
221-
222-
print("\n=== SUMMARY ===")
223-
print(f"Total federated connectors: {total_connectors}")
224-
print(f"Successfully loaded: {successful_loads}")
225-
print(f"Failed to load: {len(errors)}")
226-
227-
if errors:
228-
print("\n=== ERRORS ===")
229-
for error in errors:
230-
print(error)
231-
pytest.fail(f"Federated connector validation failed: {len(errors)} errors")
232-
233-
print("✅ All federated connector mappings are valid!")

0 commit comments

Comments
 (0)