@@ -1062,6 +1062,12 @@ func TestGenerateBuildFromBuild(t *testing.T) {
1062
1062
build := & buildapi.Build {
1063
1063
ObjectMeta : kapi.ObjectMeta {
1064
1064
Name : "test-build" ,
1065
+ Annotations : map [string ]string {
1066
+ buildapi .BuildJenkinsStatusJSONAnnotation : "foo" ,
1067
+ buildapi .BuildJenkinsLogURLAnnotation : "bar" ,
1068
+ buildapi .BuildJenkinsBuildURIAnnotation : "baz" ,
1069
+ buildapi .BuildPodNameAnnotation : "ruby-sample-build-1-build" ,
1070
+ },
1065
1071
},
1066
1072
Spec : buildapi.BuildSpec {
1067
1073
CommonSpec : buildapi.CommonSpec {
@@ -1084,6 +1090,18 @@ func TestGenerateBuildFromBuild(t *testing.T) {
1084
1090
if ! reflect .DeepEqual (build .ObjectMeta .Labels , newBuild .ObjectMeta .Labels ) {
1085
1091
t .Errorf ("Build labels does not match the original Build labels" )
1086
1092
}
1093
+ if _ , ok := newBuild .ObjectMeta .Annotations [buildapi .BuildJenkinsStatusJSONAnnotation ]; ok {
1094
+ t .Errorf ("%s annotation exists, expected it not to" , buildapi .BuildJenkinsStatusJSONAnnotation )
1095
+ }
1096
+ if _ , ok := newBuild .ObjectMeta .Annotations [buildapi .BuildJenkinsLogURLAnnotation ]; ok {
1097
+ t .Errorf ("%s annotation exists, expected it not to" , buildapi .BuildJenkinsLogURLAnnotation )
1098
+ }
1099
+ if _ , ok := newBuild .ObjectMeta .Annotations [buildapi .BuildJenkinsBuildURIAnnotation ]; ok {
1100
+ t .Errorf ("%s annotation exists, expected it not to" , buildapi .BuildJenkinsBuildURIAnnotation )
1101
+ }
1102
+ if _ , ok := newBuild .ObjectMeta .Annotations [buildapi .BuildPodNameAnnotation ]; ok {
1103
+ t .Errorf ("%s annotation exists, expected it not to" , buildapi .BuildPodNameAnnotation )
1104
+ }
1087
1105
}
1088
1106
1089
1107
func TestGenerateBuildFromBuildWithBuildConfig (t * testing.T ) {
0 commit comments