@@ -2947,6 +2947,171 @@ runtimes:
29472947 let _ = fs:: remove_dir_all ( & temp_dir) ;
29482948}
29492949
2950+ /// Integration test: `runtimes: python: true` end-to-end compilation
2951+ ///
2952+ /// Verifies that a pipeline compiled with `runtimes: python: true` contains
2953+ /// the `UsePythonVersion@0` task and defaults to Python `3.x`.
2954+ #[ test]
2955+ fn test_python_runtime_compiled_output ( ) {
2956+ let temp_dir = std:: env:: temp_dir ( ) . join ( format ! (
2957+ "agentic-pipeline-python-{}" ,
2958+ std:: process:: id( )
2959+ ) ) ;
2960+ fs:: create_dir_all ( & temp_dir) . expect ( "Failed to create temp directory" ) ;
2961+
2962+ let input = r#"---
2963+ name: "Python Agent"
2964+ description: "Agent with Python runtime"
2965+ runtimes:
2966+ python: true
2967+ safe-outputs:
2968+ noop: {}
2969+ ---
2970+
2971+ ## Python Agent
2972+ "# ;
2973+
2974+ let input_path = temp_dir. join ( "python-agent.md" ) ;
2975+ let output_path = temp_dir. join ( "python-agent.yml" ) ;
2976+ fs:: write ( & input_path, input) . expect ( "Failed to write test input" ) ;
2977+
2978+ let binary_path = PathBuf :: from ( env ! ( "CARGO_BIN_EXE_ado-aw" ) ) ;
2979+ let output = std:: process:: Command :: new ( & binary_path)
2980+ . args ( [
2981+ "compile" ,
2982+ input_path. to_str ( ) . unwrap ( ) ,
2983+ "-o" ,
2984+ output_path. to_str ( ) . unwrap ( ) ,
2985+ ] )
2986+ . output ( )
2987+ . expect ( "Failed to run compiler" ) ;
2988+
2989+ assert ! (
2990+ output. status. success( ) ,
2991+ "Compiler should succeed: {}" ,
2992+ String :: from_utf8_lossy( & output. stderr)
2993+ ) ;
2994+
2995+ let compiled = fs:: read_to_string ( & output_path) . expect ( "Should read compiled YAML" ) ;
2996+ assert ! (
2997+ compiled. contains( "UsePythonVersion@0" ) ,
2998+ "should have Python install step"
2999+ ) ;
3000+ assert ! (
3001+ compiled. contains( "versionSpec: '3.x'" ) ,
3002+ "should default to Python 3.x"
3003+ ) ;
3004+
3005+ let _ = fs:: remove_dir_all ( & temp_dir) ;
3006+ }
3007+
3008+ /// Integration test: `runtimes: python:` with pinned version
3009+ #[ test]
3010+ fn test_python_runtime_pinned_version_compiled_output ( ) {
3011+ let temp_dir = std:: env:: temp_dir ( ) . join ( format ! (
3012+ "agentic-pipeline-python-pinned-{}" ,
3013+ std:: process:: id( )
3014+ ) ) ;
3015+ fs:: create_dir_all ( & temp_dir) . expect ( "Failed to create temp directory" ) ;
3016+
3017+ let input = r#"---
3018+ name: "Python 3.12 Agent"
3019+ description: "Agent with pinned Python runtime"
3020+ runtimes:
3021+ python:
3022+ version: "3.12"
3023+ safe-outputs:
3024+ noop: {}
3025+ ---
3026+
3027+ ## Python Agent
3028+ "# ;
3029+
3030+ let input_path = temp_dir. join ( "python-pinned-agent.md" ) ;
3031+ let output_path = temp_dir. join ( "python-pinned-agent.yml" ) ;
3032+ fs:: write ( & input_path, input) . expect ( "Failed to write test input" ) ;
3033+
3034+ let binary_path = PathBuf :: from ( env ! ( "CARGO_BIN_EXE_ado-aw" ) ) ;
3035+ let output = std:: process:: Command :: new ( & binary_path)
3036+ . args ( [
3037+ "compile" ,
3038+ input_path. to_str ( ) . unwrap ( ) ,
3039+ "-o" ,
3040+ output_path. to_str ( ) . unwrap ( ) ,
3041+ ] )
3042+ . output ( )
3043+ . expect ( "Failed to run compiler" ) ;
3044+
3045+ assert ! (
3046+ output. status. success( ) ,
3047+ "Compiler should succeed: {}" ,
3048+ String :: from_utf8_lossy( & output. stderr)
3049+ ) ;
3050+
3051+ let compiled = fs:: read_to_string ( & output_path) . expect ( "Should read compiled YAML" ) ;
3052+ assert ! (
3053+ compiled. contains( "versionSpec: '3.12'" ) ,
3054+ "should use pinned version"
3055+ ) ;
3056+
3057+ let _ = fs:: remove_dir_all ( & temp_dir) ;
3058+ }
3059+
3060+ /// Integration test: `runtimes: node: true` end-to-end compilation
3061+ #[ test]
3062+ fn test_node_runtime_compiled_output ( ) {
3063+ let temp_dir = std:: env:: temp_dir ( ) . join ( format ! (
3064+ "agentic-pipeline-node-{}" ,
3065+ std:: process:: id( )
3066+ ) ) ;
3067+ fs:: create_dir_all ( & temp_dir) . expect ( "Failed to create temp directory" ) ;
3068+
3069+ let input = r#"---
3070+ name: "Node Agent"
3071+ description: "Agent with Node runtime"
3072+ runtimes:
3073+ node: true
3074+ safe-outputs:
3075+ noop: {}
3076+ ---
3077+
3078+ ## Node Agent
3079+ "# ;
3080+
3081+ let input_path = temp_dir. join ( "node-agent.md" ) ;
3082+ let output_path = temp_dir. join ( "node-agent.yml" ) ;
3083+ fs:: write ( & input_path, input) . expect ( "Failed to write test input" ) ;
3084+
3085+ let binary_path = PathBuf :: from ( env ! ( "CARGO_BIN_EXE_ado-aw" ) ) ;
3086+ let output = std:: process:: Command :: new ( & binary_path)
3087+ . args ( [
3088+ "compile" ,
3089+ input_path. to_str ( ) . unwrap ( ) ,
3090+ "-o" ,
3091+ output_path. to_str ( ) . unwrap ( ) ,
3092+ ] )
3093+ . output ( )
3094+ . expect ( "Failed to run compiler" ) ;
3095+
3096+ assert ! (
3097+ output. status. success( ) ,
3098+ "Compiler should succeed: {}" ,
3099+ String :: from_utf8_lossy( & output. stderr)
3100+ ) ;
3101+
3102+ let compiled = fs:: read_to_string ( & output_path) . expect ( "Should read compiled YAML" ) ;
3103+ assert ! (
3104+ compiled. contains( "NodeTool@0" ) ,
3105+ "should have Node install step"
3106+ ) ;
3107+ assert ! (
3108+ compiled. contains( "versionSpec: '22.x'" ) ,
3109+ "should default to Node 22.x"
3110+ ) ;
3111+
3112+ let _ = fs:: remove_dir_all ( & temp_dir) ;
3113+ }
3114+
29503115/// Integration test: `schedule:` object form with `branches:` end-to-end compilation
29513116///
29523117/// Verifies that a pipeline compiled with the object-form schedule containing
0 commit comments