@@ -296,29 +296,31 @@ func TestValidateUpstreamCommitSummaries(t *testing.T) {
296296 {valid : true , summary : "UPSTREAM: <drop>: a change" },
297297 {valid : true , summary : "UPSTREAM: coreos/etcd: <carry>: a change" },
298298 {valid : true , summary : "UPSTREAM: coreos/etcd: <drop>: a change" },
299- {valid : true , summary : "UPSTREAM: revert: abcd123: 12345: a change" },
300- {valid : true , summary : "UPSTREAM: revert: abcd123: k8s.io/heapster: 12345: a change" },
301- {valid : true , summary : "UPSTREAM: revert: abcd123: <carry>: a change" },
302- {valid : true , summary : "UPSTREAM: revert: abcd123: <drop>: a change" },
303- {valid : true , summary : "UPSTREAM: revert: abcd123: coreos/etcd: <carry>: a change" },
304- {valid : true , summary : "UPSTREAM: revert: abcd123: coreos/etcd: <drop>: a change" },
299+ {valid : true , summary : "UPSTREAM: revert: 12345: a change" },
300+ {valid : true , summary : "UPSTREAM: revert: k8s.io/heapster: 12345: a change" },
301+ {valid : true , summary : "UPSTREAM: revert: <carry>: a change" },
302+ {valid : true , summary : "UPSTREAM: revert: <drop>: a change" },
303+ {valid : true , summary : "UPSTREAM: revert: coreos/etcd: <carry>: a change" },
304+ {valid : true , summary : "UPSTREAM: revert: coreos/etcd: <drop>: a change" },
305305 {valid : false , summary : "UPSTREAM: whoopsie daisy" },
306306 {valid : true , summary : "UPSTREAM: gopkg.in/ldap.v2: 51: exposed better API for paged search" },
307307 }
308308 for _ , test := range tests {
309- commit := util.Commit {Summary : test .summary , Sha : "abcd000" }
310- err := ValidateUpstreamCommitSummaries ([]util.Commit {commit })
311- if err != nil {
312- if test .valid {
313- t .Fatalf ("unexpected error:\n %s" , err )
309+ t .Run (test .summary , func (t * testing.T ) {
310+ commit := util.Commit {Summary : test .summary , Sha : "abcd000" }
311+ err := ValidateUpstreamCommitSummaries ([]util.Commit {commit })
312+ if err != nil {
313+ if test .valid {
314+ t .Fatalf ("unexpected error:\n %s" , err )
315+ } else {
316+ t .Logf ("got expected error:\n %s" , err )
317+ }
314318 } else {
315- t .Logf ("got expected error:\n %s" , err )
319+ if ! test .valid {
320+ t .Fatalf ("expected an error, got none; summary: %s" , test .summary )
321+ }
316322 }
317- } else {
318- if ! test .valid {
319- t .Fatalf ("expected an error, got none; summary: %s" , test .summary )
320- }
321- }
323+ })
322324 }
323325}
324326
@@ -409,7 +411,7 @@ func TestValidateUpstreamCommitModifiesOnlyDeclaredGodepRepo(t *testing.T) {
409411 commits : []util.Commit {
410412 {
411413 Sha : "aaa0001" ,
412- Summary : "UPSTREAM: revert: abcd000: 12345: a change" ,
414+ Summary : "UPSTREAM: revert: 12345: a change" ,
413415 Files : []util.File {
414416 "Godeps/_workspace/src/k8s.io/kubernetes/file1" ,
415417 "Godeps/_workspace/src/k8s.io/kubernetes/file2" ,
@@ -423,7 +425,7 @@ func TestValidateUpstreamCommitModifiesOnlyDeclaredGodepRepo(t *testing.T) {
423425 commits : []util.Commit {
424426 {
425427 Sha : "aaa0001" ,
426- Summary : "UPSTREAM: revert: abcd000: coreos/etcd: 12345: a change" ,
428+ Summary : "UPSTREAM: revert: coreos/etcd: 12345: a change" ,
427429 Files : []util.File {
428430 "Godeps/_workspace/src/k8s.io/kubernetes/file1" ,
429431 "Godeps/_workspace/src/k8s.io/kubernetes/file2" ,
@@ -437,7 +439,7 @@ func TestValidateUpstreamCommitModifiesOnlyDeclaredGodepRepo(t *testing.T) {
437439 commits : []util.Commit {
438440 {
439441 Sha : "aaa0001" ,
440- Summary : "UPSTREAM: revert: abcd000: coreos/etcd: 12345: a change" ,
442+ Summary : "UPSTREAM: revert: coreos/etcd: 12345: a change" ,
441443 Files : []util.File {
442444 "Godeps/_workspace/src/github.com/coreos/etcd/file1" ,
443445 "Godeps/_workspace/src/github.com/coreos/etcd/file2" ,
0 commit comments