소스 검색

Make pprof driver tests less noisy. (#349)

Alexey Alexandrov 7 년 전
부모
커밋
6084089963
No account linked to committer's email address
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 4
    2
      internal/driver/fetch_test.go
  2. 1
    1
      internal/proftest/proftest.go

+ 4
- 2
internal/driver/fetch_test.go 파일 보기

283
 			}
283
 			}
284
 			f.args = tc.sources
284
 			f.args = tc.sources
285
 
285
 
286
-			o := setDefaults(nil)
287
-			o.Flagset = f
286
+			o := setDefaults(&plugin.Options{
287
+				UI:      &proftest.TestUI{T: t, AllowRx: "Local symbolization failed|Some binary filenames not available"},
288
+				Flagset: f,
289
+			})
288
 			src, _, err := parseFlags(o)
290
 			src, _, err := parseFlags(o)
289
 
291
 
290
 			if err != nil {
292
 			if err != nil {

+ 1
- 1
internal/proftest/proftest.go 파일 보기

122
 	// implementation does. Without this Error() calls fmt.Sprintln() which
122
 	// implementation does. Without this Error() calls fmt.Sprintln() which
123
 	// _always_ adds spaces between arguments, unlike fmt.Sprint() which only
123
 	// _always_ adds spaces between arguments, unlike fmt.Sprint() which only
124
 	// adds them between arguments if neither is string.
124
 	// adds them between arguments if neither is string.
125
-	ui.T.Error(fmt.Sprint(args...))
125
+	ui.T.Error("unexpected error: " + fmt.Sprint(args...))
126
 }
126
 }
127
 
127
 
128
 // IsTerminal indicates if the UI is an interactive terminal.
128
 // IsTerminal indicates if the UI is an interactive terminal.