@@ -943,6 +943,43 @@ func TestPluginShouldClearRawEnvFromNestedSteps(t *testing.T) {
943943 assert .Nil (t , secondStep .Build .RawEnv , "Second nested step Build.RawEnv should be nil" )
944944}
945945
946+ func TestPluginShouldProcessNotifyInNestedSteps (t * testing.T ) {
947+ param := `[{
948+ "github.com/buildkite-plugins/monorepo-diff-buildkite-plugin#v1.0.0": {
949+ "watch": [{
950+ "path": "foo/**",
951+ "config": {
952+ "group": "Foo",
953+ "steps": [{
954+ "command": "./scripts/a.sh",
955+ "label": "Run A",
956+ "notify": [{
957+ "github_commit_status": {
958+ "context": "buildkite/foo/a"
959+ }
960+ }]
961+ }]
962+ }
963+ }]
964+ }
965+ }]`
966+
967+ got , err := initializePlugin (param )
968+ assert .NoError (t , err )
969+
970+ // Verify nested step exists
971+ assert .Equal (t , 1 , len (got .Watch [0 ].Step .Steps ))
972+
973+ nestedStep := got .Watch [0 ].Step .Steps [0 ]
974+
975+ // Verify RawNotify is cleared
976+ assert .Nil (t , nestedStep .RawNotify , "RawNotify should be nil after processing" )
977+
978+ // Verify Notify is populated
979+ assert .Equal (t , 1 , len (nestedStep .Notify ), "Notify should have 1 entry" )
980+ assert .Equal (t , "buildkite/foo/a" , nestedStep .Notify [0 ].GithubStatus .Context )
981+ }
982+
946983func TestPluginShouldPreserveDependsOnString (t * testing.T ) {
947984 param := `[{
948985 "github.com/buildkite-plugins/monorepo-diff-buildkite-plugin#commit": {
@@ -1331,8 +1368,8 @@ func TestParseEnvMapEmptyStringPreserved(t *testing.T) {
13311368 result , err := parseEnv (input )
13321369
13331370 assert .NoError (t , err )
1334- assert .Equal (t , "" , result ["TEST_VAR" ]) // Empty string preserved
1335- assert .Equal (t , "" , result ["ANOTHER_VAR" ]) // Empty string preserved
1371+ assert .Equal (t , "" , result ["TEST_VAR" ]) // Empty string preserved
1372+ assert .Equal (t , "" , result ["ANOTHER_VAR" ]) // Empty string preserved
13361373 assert .Equal (t , "value" , result ["EXPLICIT" ])
13371374}
13381375
@@ -1663,8 +1700,8 @@ func TestMapEnvWithOSEnvReading(t *testing.T) {
16631700 got , err := initializePlugin (param )
16641701
16651702 assert .NoError (t , err )
1666- assert .Equal (t , "us-west-2" , got .Env ["AWS_REGION" ]) // Null reads from OS env
1667- assert .Equal (t , "" , got .Env ["EMPTY_VAR" ]) // Empty string is literal
1703+ assert .Equal (t , "us-west-2" , got .Env ["AWS_REGION" ]) // Null reads from OS env
1704+ assert .Equal (t , "" , got .Env ["EMPTY_VAR" ]) // Empty string is literal
16681705 assert .Equal (t , "explicit-value" , got .Env ["EXPLICIT" ])
16691706}
16701707
0 commit comments