mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 10:39:30 +00:00 
			
		
		
		
	 d09bca26f6
			
		
	
	
		d09bca26f6
		
			
		
	
	
	
	
		
			
			* change tag for sql server due to https://github.com/microsoft/mssql-docker/issues/441 (or some similar issue) * use 2022-latest * fixed mssql tests * format * used new columns * use the custom sql server
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| import sys
 | |
| 
 | |
| import pytest
 | |
| 
 | |
| from metadata.workflow.metadata import MetadataWorkflow
 | |
| from metadata.workflow.usage import UsageWorkflow
 | |
| 
 | |
| if not sys.version_info >= (3, 9):
 | |
|     pytest.skip("requires python 3.9+", allow_module_level=True)
 | |
| 
 | |
| 
 | |
| @pytest.fixture()
 | |
| def usage_config(db_service, workflow_config, db_name):
 | |
|     return {
 | |
|         "source": {
 | |
|             "type": "mssql-usage",
 | |
|             "serviceName": db_service.fullyQualifiedName.root,
 | |
|             "sourceConfig": {
 | |
|                 "config": {
 | |
|                     "queryLogDuration": 2,
 | |
|                     "resultLimit": 1000,
 | |
|                     "databaseFilterPattern": {"includes": ["TestDB", db_name]},
 | |
|                 },
 | |
|             },
 | |
|         },
 | |
|         "processor": {"type": "query-parser", "config": {}},
 | |
|         "stage": {"type": "table-usage", "config": {"filename": "/tmp/mssql_usage"}},
 | |
|         "bulkSink": {
 | |
|             "type": "metadata-usage",
 | |
|             "config": {"filename": "/tmp/mssql_usage"},
 | |
|         },
 | |
|         "workflowConfig": workflow_config,
 | |
|     }
 | |
| 
 | |
| 
 | |
| def test_usage(
 | |
|     patch_passwords_for_db_services,
 | |
|     run_workflow,
 | |
|     ingestion_config,
 | |
|     usage_config,
 | |
| ):
 | |
|     run_workflow(MetadataWorkflow, ingestion_config)
 | |
|     run_workflow(UsageWorkflow, usage_config)
 |