@@ -91,6 +91,22 @@ void whenBambooResultEnvVarIsPresentThenBuildScanHasACiBuildLinkToIt() {
91
91
assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://bamboo.example.com" );
92
92
}
93
93
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
+
94
110
@ Test
95
111
void whenCircleBuildUrlEnvVarIsPresentThenBuildScanHasACiBuildLinkToIt () {
96
112
new BuildScanConventions (this .develocity , this .processRunner ,
@@ -99,6 +115,22 @@ void whenCircleBuildUrlEnvVarIsPresentThenBuildScanHasACiBuildLinkToIt() {
99
115
assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://circleci.example.com/gh/org/project/123" );
100
116
}
101
117
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
+
102
134
@ Test
103
135
void whenJenkinsUrlAndBuildUrlEnvVarsArePresentThenBuildScanHasACiBuildLinkToBuildUrl () {
104
136
Map <String , String > env = new HashMap <>();
@@ -108,6 +140,14 @@ void whenJenkinsUrlAndBuildUrlEnvVarsArePresentThenBuildScanHasACiBuildLinkToBui
108
140
assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://jenkins.example.com/builds/123" );
109
141
}
110
142
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
+
111
151
@ Test
112
152
void whenCiEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal () {
113
153
new BuildScanConventions (this .develocity , this .processRunner , Collections .singletonMap ("CI" , null ))
@@ -116,11 +156,10 @@ void whenCiEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal() {
116
156
}
117
157
118
158
@ 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 ))
122
161
.execute (this .buildScan );
123
- assertThat (this .buildScan .tags ). contains ("CI" ). doesNotContain ( "Local " );
162
+ assertThat (this .buildScan .values ). containsEntry ("CI provider" , "Concourse " );
124
163
}
125
164
126
165
@ Test
@@ -143,12 +182,32 @@ void whenGitHubActionsEnvVarsArePresentThenBuildScanHasACiBuildLinkToIt() {
143
182
"https://github.com/spring-projects/spring-boot/actions/runs/1234567890" );
144
183
}
145
184
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
+
146
193
@ Test
147
194
void whenNoCiIndicatorsArePresentThenBuildScanIsTaggedWithLocalNotCi () {
148
195
new BuildScanConventions (this .develocity , this .processRunner , Collections .emptyMap ()).execute (this .buildScan );
149
196
assertThat (this .buildScan .tags ).contains ("Local" ).doesNotContain ("CI" );
150
197
}
151
198
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
+
152
211
@ Test
153
212
void buildScanIsTaggedWithJdkVersion () {
154
213
new BuildScanConventions (this .develocity , this .processRunner ).execute (this .buildScan );
0 commit comments