@@ -1393,6 +1393,46 @@ func TestValidationFailMessage_TrimsOutput(t *testing.T) {
13931393 assert .Equal (t , "some output" , msg )
13941394}
13951395
1396+ func TestValidationEnv_IncludesSchemaWhenSet (t * testing.T ) {
1397+ h := & harness.Harness {
1398+ RunnerEnv : map [string ]string {"FOO" : "bar" },
1399+ ValidationLoop : & harness.ValidationLoop {
1400+ Script : "scripts/validate.sh" ,
1401+ Schema : "/tmp/test-schema.json" ,
1402+ },
1403+ }
1404+ env := validationEnv (h , "/repo" , "/run" )
1405+ assert .Contains (t , env , "FULLSEND_OUTPUT_SCHEMA=/tmp/test-schema.json" )
1406+ assert .Contains (t , env , "TARGET_REPO_DIR=/repo" )
1407+ assert .Contains (t , env , "FULLSEND_RUN_DIR=/run" )
1408+ assert .Contains (t , env , "FOO=bar" )
1409+ }
1410+
1411+ func TestValidationEnv_OmitsSchemaWhenEmpty (t * testing.T ) {
1412+ h := & harness.Harness {
1413+ RunnerEnv : map [string ]string {"FOO" : "bar" },
1414+ ValidationLoop : & harness.ValidationLoop {
1415+ Script : "scripts/validate.sh" ,
1416+ },
1417+ }
1418+ env := validationEnv (h , "/repo" , "/run" )
1419+ for _ , e := range env {
1420+ assert .False (t , strings .HasPrefix (e , "FULLSEND_OUTPUT_SCHEMA=" ),
1421+ "FULLSEND_OUTPUT_SCHEMA should not be set when Schema is empty" )
1422+ }
1423+ }
1424+
1425+ func TestValidationEnv_OmitsSchemaWhenNoValidationLoop (t * testing.T ) {
1426+ h := & harness.Harness {
1427+ RunnerEnv : map [string ]string {"FOO" : "bar" },
1428+ }
1429+ env := validationEnv (h , "/repo" , "/run" )
1430+ for _ , e := range env {
1431+ assert .False (t , strings .HasPrefix (e , "FULLSEND_OUTPUT_SCHEMA=" ),
1432+ "FULLSEND_OUTPUT_SCHEMA should not be set when ValidationLoop is nil" )
1433+ }
1434+ }
1435+
13961436func TestOpenTeeReader_EmptyPath (t * testing.T ) {
13971437 src := strings .NewReader ("hello" )
13981438 printer := ui .New (io .Discard )
0 commit comments