formats

package
v0.0.0-...-35d8de9 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GTestResults

type GTestResults struct {
	AllTests   []string `json:"all_tests"`
	GlobalTags []string `json:"global_tags"`

	// PerIterationData is a vector of run iterations, each mapping test names to a list of test data.
	PerIterationData []map[string][]*GTestRunResult `json:"per_iteration_data"`

	// TestLocations maps test names to their location in code.
	TestLocations map[string]*Location `json:"test_locations"`
}

GTestResults represents the structure as described to be generated in https://cs.chromium.org/chromium/src/base/test/launcher/test_results_tracker.h?l=83&rcl=96020cfd447cb285acfa1a96c37a67ed22fa2499 (base::TestResultsTracker::SaveSummaryAsJSON)

Fields not used by Test Results are omitted.

func (*GTestResults) ConvertFromJSON

func (r *GTestResults) ConvertFromJSON(ctx context.Context, reader io.Reader) error

ConvertFromJSON reads the provided reader into the receiver.

The receiver is cleared and its fields overwritten.

func (*GTestResults) ToProtos

ToProtos converts test results in r []*pb.TestResult and updates inv in-place accordingly. If an error is returned, inv is left unchanged.

Does not populate TestResult.Name.

type GTestRunResult

type GTestRunResult struct {
	Status        string `json:"status"`
	ElapsedTimeMs int    `json:"elapsed_time_ms"`

	LosslessSnippet     bool   `json:"losless_snippet"`
	OutputSnippetBase64 string `json:"output_snippet_base64"`
}

GTestRunResult represents the per_iteration_data as described in https://cs.chromium.org/chromium/src/base/test/launcher/test_results_tracker.h?l=83&rcl=96020cfd447cb285acfa1a96c37a67ed22fa2499 (base::TestResultsTracker::SaveSummaryAsJSON)

Fields not used by Test Results are omitted.

type JSONTestResults

type JSONTestResults struct {
	Interrupted bool `json:"interrupted"`

	PathDelimiter string `json:"path_delimiter"`

	TestsRaw json.RawMessage `json:"tests"`
	Tests    map[string]*TestFields

	Version int32 `json:"version"`

	ArtifactTypes map[string]string `json:"artifact_types"`

	BuildNumber string `json:"build_number"`
	BuilderName string `json:"builder_name"`

	// Metadata associated with results, which may include a list of expectation_files, or
	// test_name_prefix e.g. in GPU tests (distinct from test_path_prefix passed in the recorder API
	// request).
	Metadata map[string]json.RawMessage `json:"metadata"`
}

JSONTestResults represents the structure in https://chromium.googlesource.com/chromium/src/+/master/docs/testing/json_test_results_format.md

Deprecated fields and fields not used by Test Results are omitted.

func (*JSONTestResults) ConvertFromJSON

func (r *JSONTestResults) ConvertFromJSON(ctx context.Context, reader io.Reader) error

ConvertFromJSON converts a JSON of test results in the JSON Test Results format to the internal struct format.

The receiver is cleared and its fields overwritten.

func (*JSONTestResults) ToProtos

ToProtos converts test results in r []*pb.TestResult and updates inv in-place accordingly. If an error is returned, inv is left unchanged.

Does not populate TestResult.Name.

type Location

type Location struct {
	File string `json:"file"`
	Line int    `json:"line"`
}

Location describes a code location.

type TestFields

type TestFields struct {
	Actual   string `json:"actual"`
	Expected string `json:"expected"`

	Artifacts map[string][]string `json:"artifacts"`

	Time  float64   `json:"time"`
	Times []float64 `json:"times"`
}

TestFields represents the test fields structure in https://chromium.googlesource.com/chromium/src/+/master/docs/testing/json_test_results_format.md

Deprecated fields and fields not used by Test Results are omitted.

Jump to

Keyboard shortcuts

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