mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 02:29:03 +00:00 
			
		
		
		
	 d8e2187980
			
		
	
	
		d8e2187980
		
			
		
	
	
	
	
		
			
			* pydantic v2 * pydanticv2 * fix parser * fix annotated * fix model dumping * mysql ingestion * clean root models * clean root models * bump airflow * bump airflow * bump airflow * optionals * optionals * optionals * jdk * airflow migrate * fab provider * fab provider * fab provider * some more fixes * fixing tests and imports * model_dump and model_validate * model_dump and model_validate * model_dump and model_validate * union * pylint * pylint * integration tests * fix CostAnalysisReportData * integration tests * tests * missing defaults * missing defaults
		
			
				
	
	
		
			30 lines
		
	
	
		
			1005 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			1005 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from os import walk
 | |
| from pathlib import Path
 | |
| from unittest import TestCase
 | |
| 
 | |
| import yaml
 | |
| 
 | |
| from metadata.ingestion.api.parser import parse_workflow_config_gracefully
 | |
| 
 | |
| 
 | |
| class TestWorkflowParse(TestCase):
 | |
|     """
 | |
|     Test parsing scenarios of JSON Schemas
 | |
|     """
 | |
| 
 | |
|     def test_parse_workflow_config(self):
 | |
|         package_path = (
 | |
|             f"{Path(__file__).parent.parent.parent}/src/metadata/examples/workflows"
 | |
|         )
 | |
|         workflow_files = [files for _, _, files in walk(package_path)]
 | |
|         for yaml_file in workflow_files[0]:
 | |
|             with self.subTest(file_name=yaml_file):
 | |
|                 with open(f"{package_path}/{yaml_file}", "r") as file:
 | |
|                     file_content = file.read()
 | |
|                     try:
 | |
|                         parse_workflow_config_gracefully(yaml.safe_load(file_content))
 | |
|                     except Exception as exc:
 | |
|                         assert False, f"Error parsing {yaml_file}: {exc}"
 | |
|                     finally:
 | |
|                         file.close()
 |