@@ -784,3 +784,75 @@ Do something.
784784
785785 let _ = fs:: remove_dir_all ( & temp_dir) ;
786786}
787+
788+ /// Test that the 1ES fixture compiles correctly with no unreplaced markers
789+ /// and uses Copilot CLI (not Agency CLI) in custom jobs
790+ #[ test]
791+ fn test_1es_compiled_output_no_unreplaced_markers ( ) {
792+ let temp_dir = std:: env:: temp_dir ( ) . join ( format ! (
793+ "agentic-pipeline-1es-markers-{}" ,
794+ std:: process:: id( )
795+ ) ) ;
796+ fs:: create_dir_all ( & temp_dir) . expect ( "Failed to create temp directory" ) ;
797+
798+ let fixture_path = PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) )
799+ . join ( "tests" )
800+ . join ( "fixtures" )
801+ . join ( "1es-test-agent.md" ) ;
802+
803+ let output_path = temp_dir. join ( "1es-test-agent.yml" ) ;
804+
805+ // Run the compiler binary
806+ let binary_path = PathBuf :: from ( env ! ( "CARGO_BIN_EXE_ado-aw" ) ) ;
807+ let output = std:: process:: Command :: new ( & binary_path)
808+ . args ( [
809+ "compile" ,
810+ fixture_path. to_str ( ) . unwrap ( ) ,
811+ "-o" ,
812+ output_path. to_str ( ) . unwrap ( ) ,
813+ ] )
814+ . output ( )
815+ . expect ( "Failed to run compiler" ) ;
816+
817+ assert ! (
818+ output. status. success( ) ,
819+ "1ES compiler should succeed: {}" ,
820+ String :: from_utf8_lossy( & output. stderr)
821+ ) ;
822+ assert ! ( output_path. exists( ) , "Compiled 1ES YAML should exist" ) ;
823+
824+ let compiled = fs:: read_to_string ( & output_path) . expect ( "Should read compiled YAML" ) ;
825+
826+ // Verify no unreplaced {{ markers }} remain (excluding ${{ }} which are ADO expressions)
827+ for line in compiled. lines ( ) {
828+ let stripped = line. replace ( "${{" , "" ) ;
829+ assert ! (
830+ !stripped. contains( "{{ " ) ,
831+ "1ES compiled output should not contain unreplaced marker: {}" ,
832+ line. trim( )
833+ ) ;
834+ }
835+
836+ // Verify the compiler version was correctly substituted
837+ let version = env ! ( "CARGO_PKG_VERSION" ) ;
838+ assert ! (
839+ compiled. contains( version) ,
840+ "1ES compiled output should contain compiler version {version}"
841+ ) ;
842+
843+ // Verify 1ES template uses Copilot CLI, not Agency CLI
844+ assert ! (
845+ compiled. contains( "Microsoft.Copilot.CLI.linux-x64" ) ,
846+ "1ES template should install Copilot CLI"
847+ ) ;
848+ assert ! (
849+ !compiled. contains( "install agency.linux-x64" ) ,
850+ "1ES template should not install Agency CLI"
851+ ) ;
852+ assert ! (
853+ !compiled. contains( "agency copilot" ) ,
854+ "1ES template should not invoke 'agency copilot' command"
855+ ) ;
856+
857+ let _ = fs:: remove_dir_all ( & temp_dir) ;
858+ }
0 commit comments