Pārlūkot izejas kodu

Make pprof driver tests less noisy. (#349)

Alexey Alexandrov 7 gadus atpakaļ
vecāks
revīzija
6084089963
No account linked to committer's email address
2 mainītis faili ar 5 papildinājumiem un 3 dzēšanām
  1. 4
    2
      internal/driver/fetch_test.go
  2. 1
    1
      internal/proftest/proftest.go

+ 4
- 2
internal/driver/fetch_test.go Parādīt failu

@@ -283,8 +283,10 @@ func TestFetchWithBase(t *testing.T) {
283 283
 			}
284 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 290
 			src, _, err := parseFlags(o)
289 291
 
290 292
 			if err != nil {

+ 1
- 1
internal/proftest/proftest.go Parādīt failu

@@ -122,7 +122,7 @@ func (ui *TestUI) PrintErr(args ...interface{}) {
122 122
 	// implementation does. Without this Error() calls fmt.Sprintln() which
123 123
 	// _always_ adds spaces between arguments, unlike fmt.Sprint() which only
124 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 128
 // IsTerminal indicates if the UI is an interactive terminal.