Create a workflow that uses environment variables
(test_yaml_dir)
| 302 | |
| 303 | @pytest.fixture |
| 304 | def env_variable_yaml(test_yaml_dir): |
| 305 | """Create a workflow that uses environment variables""" |
| 306 | yaml_content = """ |
| 307 | name: "env_var_test_${TEST_ENV_VAR:-default}" |
| 308 | goal: "Test environment variable expansion" |
| 309 | |
| 310 | parameters: |
| 311 | env_value: "${TEST_ENV_VAR:-fallback_value}" |
| 312 | project_name: "${PROJECT_NAME:-my_project}" |
| 313 | |
| 314 | workflow: |
| 315 | - task: |
| 316 | name: "use_env_vars" |
| 317 | instruction: "Process with env value: {{env_value}} for project {{project_name}}" |
| 318 | """ |
| 319 | |
| 320 | file_path = test_yaml_dir / "env_variable_workflow.yaml" |
| 321 | with open(file_path, "w") as f: |
| 322 | f.write(yaml_content) |
| 323 | |
| 324 | return str(file_path) |
| 325 | |
| 326 | |
| 327 | class TestYAMLWorkflowIntegration: |