Skip to content

Commit 5c48a51

Browse files
committed
Add tests for SonarQube scan enabling conditions based on cluster configuration
1 parent b4739c5 commit 5c48a51

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/groovy/vars/OdsComponentStageScanWithSonarSpec.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ class OdsComponentStageScanWithSonarSpec extends PipelineSpockTestBase {
172172
// Cluster enabled not explicitly set (defaults true); project value still governs
173173
'not set' | 'true' || '{"data": {"projects.foo.enabled": "true"}}' | true | ''
174174
'not set' | 'false' || '{"data": {"projects.foo.enabled": "false"}}' | false | 'Skipping SonarQube scan because project is not enabled'
175+
// Project not set (empty map) → falls back to cluster configuration
176+
'true' | 'not set' || '{"data": {"enabled": "true"}}' | true | ''
177+
'false' | 'not set' || '{"data": {"enabled": "false"}}' | false | 'Skipping SonarQube scan because is not enabled at cluster level'
175178
}
176179

177180
@Unroll

0 commit comments

Comments
 (0)