diff --git a/scripts/fix.sh b/scripts/fix.sh index 6bfae8809..264854b9b 100755 --- a/scripts/fix.sh +++ b/scripts/fix.sh @@ -13,8 +13,8 @@ function mod_tidy_fix { function bash_ws_fix { log_callout "Fixing whitespaces in the bash scripts" # Makes sure all bash scripts do use ' ' (double space) for indention. - log_cmd "% find ./ -name '*.sh' | xargs sed --follow-symlinks -i 's|\t| |g'" - find ./ -print0 -name '*.sh' | xargs -0 sed --follow-symlinks -i 's|\t| |g' + log_cmd "find ./ -name '*.sh' -print0 | xargs -0 sed --follow-symlinks -i 's|\t| |g'" + find ./ -name '*.sh' -print0 | xargs -0 sed --follow-symlinks -i 's|\t| |g' } log_callout -e "\nFixing etcd code for you...\n" diff --git a/server/etcdserver/server_test.go b/server/etcdserver/server_test.go index 84bf785b6..bb2fd64b1 100644 --- a/server/etcdserver/server_test.go +++ b/server/etcdserver/server_test.go @@ -999,7 +999,8 @@ func TestSnapshot(t *testing.T) { defer func() { ch <- struct{}{} }() if len(gaction) != 2 { - t.Fatalf("len(action) = %d, want 2", len(gaction)) + t.Errorf("len(action) = %d, want 2", len(gaction)) + return } if !reflect.DeepEqual(gaction[0], testutil.Action{Name: "SaveSnap"}) { t.Errorf("action = %s, want SaveSnap", gaction[0]) @@ -1156,6 +1157,7 @@ func TestTriggerSnap(t *testing.T) { donec := make(chan struct{}) go func() { + defer close(donec) wcnt := 3 + snapc gaction, _ := p.Wait(wcnt) @@ -1163,9 +1165,9 @@ func TestTriggerSnap(t *testing.T) { // (SnapshotCount+1) * Puts + SaveSnap = (SnapshotCount+1) * Save + SaveSnap + Release if len(gaction) != wcnt { t.Logf("gaction: %v", gaction) - t.Fatalf("len(action) = %d, want %d", len(gaction), wcnt) + t.Errorf("len(action) = %d, want %d", len(gaction), wcnt) + return } - if !reflect.DeepEqual(gaction[wcnt-2], testutil.Action{Name: "SaveSnap"}) { t.Errorf("action = %s, want SaveSnap", gaction[wcnt-2]) } @@ -1173,7 +1175,6 @@ func TestTriggerSnap(t *testing.T) { if !reflect.DeepEqual(gaction[wcnt-1], testutil.Action{Name: "Release"}) { t.Errorf("action = %s, want Release", gaction[wcnt-1]) } - close(donec) }() for i := 0; i < snapc+1; i++ { diff --git a/test b/test index b69a006db..55627ef25 100755 --- a/test +++ b/test @@ -303,7 +303,6 @@ function fmt_pass { revive \ license_header \ receiver_name \ - commit_title \ mod_tidy \ dep \ shellcheck \ @@ -421,30 +420,6 @@ function receiver_name_pass { run_for_modules receiver_name_for_package } -function commit_title_pass { - git log --oneline "$(git merge-base HEAD master)"...HEAD | while read -r l; do - commitMsg=$(echo "$l" | cut -f2- -d' ') - if [[ "$commitMsg" == Merge* ]]; then - # ignore "Merge pull" commits - continue - fi - if [[ "$commitMsg" == Revert* ]]; then - # ignore revert commits - continue - fi - - pkgPrefix=$(echo "$commitMsg" | cut -f1 -d':') - spaceCommas=$(echo "$commitMsg" | sed 's/ /\n/g' | grep -c ',$' || echo 0) - commaSpaces=$(echo "$commitMsg" | sed 's/,/\n/g' | grep -c '^ ' || echo 0) - if [[ $(echo "$commitMsg" | grep -c ":..*") == 0 || "$commitMsg" == "$pkgPrefix" || "$spaceCommas" != "$commaSpaces" ]]; then - log_error "$l"... - log_error "Expected commit title format '{\", \"}: '" - log_error "Got: $l" - return 255 - fi - done -} - # goword_for_package package # checks spelling and comments in the 'package' in the current module #