@@ -82,6 +82,8 @@ func TestExecutor_Integration(t *testing.T) {
8282 wantAuthorEmail string
8383
8484 wantErrInclude string
85+ // wantCacheHits overwrites the desired count of cache entries found after execution.
86+ wantCacheHits int
8587 }{
8688 {
8789 name : "success" ,
@@ -407,6 +409,36 @@ output4=integration-test-batch-change`,
407409 },
408410 },
409411 },
412+ {
413+ name : "skips errors" ,
414+ archives : []mock.RepoArchive {
415+ {Repo : srcCLIRepo , Files : map [string ]string {
416+ "README.md" : "# Welcome to the README\n " ,
417+ }},
418+ {Repo : sourcegraphRepo , Files : map [string ]string {
419+ "README.md" : "# Sourcegraph README\n " ,
420+ }},
421+ },
422+ steps : []batches.Step {
423+ {Run : `echo -e "foobar\n" >> README.md` },
424+ {
425+ Run : `exit 1` ,
426+ If : fmt .Sprintf (`${{ eq repository.name %q }}` , sourcegraphRepo .Name ),
427+ },
428+ },
429+ tasks : []* Task {
430+ {Repository : srcCLIRepo },
431+ {Repository : sourcegraphRepo },
432+ },
433+ wantFilesChanged : filesByRepository {
434+ srcCLIRepo .ID : filesByBranch {
435+ changesetTemplateBranch : []string {"README.md" },
436+ },
437+ sourcegraphRepo .ID : {},
438+ },
439+ wantErrInclude : "execution in github.com/sourcegraph/sourcegraph failed: run: exit 1" ,
440+ wantCacheHits : 1 ,
441+ },
410442 }
411443
412444 for _ , tc := range tests {
@@ -488,11 +520,10 @@ output4=integration-test-batch-change`,
488520 if err == nil {
489521 t .Fatalf ("expected error to include %q, but got no error" , tc .wantErrInclude )
490522 } else {
491- if ! strings .Contains (err .Error (), tc .wantErrInclude ) {
523+ if ! strings .Contains (strings . ToLower ( err .Error ()), strings . ToLower ( tc .wantErrInclude ) ) {
492524 t .Errorf ("wrong error. have=%q want included=%q" , err , tc .wantErrInclude )
493525 }
494526 }
495- return
496527 }
497528
498529 wantSpecs := 0
@@ -578,6 +609,9 @@ output4=integration-test-batch-change`,
578609 if tc .wantErrInclude != "" {
579610 want = 0
580611 }
612+ if tc .wantCacheHits != 0 {
613+ want = tc .wantCacheHits
614+ }
581615
582616 // Verify that there is a cache entry for each repo.
583617 if have := cache .size (); have != want {
0 commit comments