@@ -91,6 +91,22 @@ void whenBambooResultEnvVarIsPresentThenBuildScanHasACiBuildLinkToIt() {
9191 assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://bamboo.example.com" );
9292 }
9393
94+ @ Test
95+ void whenBambooResultEnvVarIsPresentThenBuildScanHasBambooAsTheCiProviderValue () {
96+ new BuildScanConventions (this .develocity , this .processRunner ,
97+ Collections .singletonMap ("bamboo_resultsUrl" , "https://bamboo.example.com" ))
98+ .execute (this .buildScan );
99+ assertThat (this .buildScan .values ).containsEntry ("CI provider" , "Bamboo" );
100+ }
101+
102+ @ Test
103+ void whenCircleBuildUrlEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal () {
104+ new BuildScanConventions (this .develocity , this .processRunner ,
105+ Collections .singletonMap ("CIRCLE_BUILD_URL" , "https://circleci.example.com/gh/org/project/123" ))
106+ .execute (this .buildScan );
107+ assertThat (this .buildScan .tags ).contains ("CI" ).doesNotContain ("Local" );
108+ }
109+
94110 @ Test
95111 void whenCircleBuildUrlEnvVarIsPresentThenBuildScanHasACiBuildLinkToIt () {
96112 new BuildScanConventions (this .develocity , this .processRunner ,
@@ -99,6 +115,22 @@ void whenCircleBuildUrlEnvVarIsPresentThenBuildScanHasACiBuildLinkToIt() {
99115 assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://circleci.example.com/gh/org/project/123" );
100116 }
101117
118+ @ Test
119+ void whenCircleBuildUrlEnvVarIsPresentThenBuildScanHasCircleCiAsTheCiProviderValue () {
120+ new BuildScanConventions (this .develocity , this .processRunner ,
121+ Collections .singletonMap ("CIRCLE_BUILD_URL" , "https://circleci.example.com/gh/org/project/123" ))
122+ .execute (this .buildScan );
123+ assertThat (this .buildScan .values ).containsEntry ("CI provider" , "CircleCI" );
124+ }
125+
126+ @ Test
127+ void whenJenkinsUrlEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal () {
128+ new BuildScanConventions (this .develocity , this .processRunner ,
129+ Collections .singletonMap ("JENKINS_URL" , "https://jenkins.example.com" ))
130+ .execute (this .buildScan );
131+ assertThat (this .buildScan .tags ).contains ("CI" ).doesNotContain ("Local" );
132+ }
133+
102134 @ Test
103135 void whenJenkinsUrlAndBuildUrlEnvVarsArePresentThenBuildScanHasACiBuildLinkToBuildUrl () {
104136 Map <String , String > env = new HashMap <>();
@@ -108,6 +140,14 @@ void whenJenkinsUrlAndBuildUrlEnvVarsArePresentThenBuildScanHasACiBuildLinkToBui
108140 assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://jenkins.example.com/builds/123" );
109141 }
110142
143+ @ Test
144+ void whenJenkinsUrlEnvVarIsPresentThenBuildScanHasJenkinsAsTheCiProviderValue () {
145+ new BuildScanConventions (this .develocity , this .processRunner ,
146+ Collections .singletonMap ("JENKINS_URL" , "https://jenkins.example.com" ))
147+ .execute (this .buildScan );
148+ assertThat (this .buildScan .values ).containsEntry ("CI provider" , "Jenkins" );
149+ }
150+
111151 @ Test
112152 void whenCiEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal () {
113153 new BuildScanConventions (this .develocity , this .processRunner , Collections .singletonMap ("CI" , null ))
@@ -116,11 +156,10 @@ void whenCiEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal() {
116156 }
117157
118158 @ Test
119- void whenJenkinsUrlEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal () {
120- new BuildScanConventions (this .develocity , this .processRunner ,
121- Collections .singletonMap ("JENKINS_URL" , "https://jenkins.example.com" ))
159+ void whenCiEnvVarIsPresentThenBuildScanHasConcourseAsTheCiProviderValue () {
160+ new BuildScanConventions (this .develocity , this .processRunner , Collections .singletonMap ("CI" , null ))
122161 .execute (this .buildScan );
123- assertThat (this .buildScan .tags ). contains ("CI" ). doesNotContain ( "Local " );
162+ assertThat (this .buildScan .values ). containsEntry ("CI provider" , "Concourse " );
124163 }
125164
126165 @ Test
@@ -143,12 +182,32 @@ void whenGitHubActionsEnvVarsArePresentThenBuildScanHasACiBuildLinkToIt() {
143182 "https://github.com/spring-projects/spring-boot/actions/runs/1234567890" );
144183 }
145184
185+ @ Test
186+ void whenGitHubActionsEnvVarIsPresentThenBuildScanHasGitHubActionsAsTheCiProviderValue () {
187+ new BuildScanConventions (this .develocity , this .processRunner ,
188+ Collections .singletonMap ("GITHUB_ACTIONS" , "true" ))
189+ .execute (this .buildScan );
190+ assertThat (this .buildScan .values ).containsEntry ("CI provider" , "GitHub Actions" );
191+ }
192+
146193 @ Test
147194 void whenNoCiIndicatorsArePresentThenBuildScanIsTaggedWithLocalNotCi () {
148195 new BuildScanConventions (this .develocity , this .processRunner , Collections .emptyMap ()).execute (this .buildScan );
149196 assertThat (this .buildScan .tags ).contains ("Local" ).doesNotContain ("CI" );
150197 }
151198
199+ @ Test
200+ void whenNoCiIndicatorsArePresentThenBuildScanHasNoCiBuildLink () {
201+ new BuildScanConventions (this .develocity , this .processRunner , Collections .emptyMap ()).execute (this .buildScan );
202+ assertThat (this .buildScan .links ).doesNotContainKey ("CI build" );
203+ }
204+
205+ @ Test
206+ void whenNoCiIndicatorsArePresentThenBuildScanHasNoCiProviderValue () {
207+ new BuildScanConventions (this .develocity , this .processRunner , Collections .emptyMap ()).execute (this .buildScan );
208+ assertThat (this .buildScan .values ).doesNotContainKey ("CI provider" );
209+ }
210+
152211 @ Test
153212 void buildScanIsTaggedWithJdkVersion () {
154213 new BuildScanConventions (this .develocity , this .processRunner ).execute (this .buildScan );
0 commit comments