faillog

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL