Documentation
¶
Overview ¶
Package faillog contains a method for dumping useful information on error
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpUITreeAndScreenshot ¶
func DumpUITreeAndScreenshot(ctx context.Context, tconn *chrome.TestConn, name string, err interface{})
DumpUITreeAndScreenshot records the current UI tree in "faillog/${name}_ui_tree.txt" in the out directory and the standard test failure data (process list, upstart jobs, and screenshot) in the directory "${name}_faillog".
|name| is used as a disambiguator to prevent multiple different calls from writing to the same place and should be unique per callsite.
|err| is used to control if anything is actually done. If err is nil, nothing is recorded. The intended usage is to do something like defer func() { faillog.DumpUITreeAndScreenshot(ctx, tconn, "crostini_installer", retErr) }() in suspect functions, where |err| is a named return variable to cause logs to be recorded only when the function returns an error. Note that the wrapping closure is required to delay evaluating |retErr| until return time.
Types ¶
This section is empty.