fixture

package
v0.0.0-...-c9cfaf6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package fixture provides fake objects for testing.

Index

Constants

This section is empty.

Variables

View Source
var (
	ModuleSHA = "788b7f06fee85b7e1d2aa4a3a86f8dbbbcc771ae"

	RevInfo = &mod.RevInfo{
		Version: "v1.10.3",
		Time:    time.Date(2020, 3, 11, 11, 43, 27, 0, time.UTC),
	}

	Module = &entity.Module{
		Path:    "github.com/klauspost/compress",
		Version: RevInfo.Version,
	}

	Package = &entity.Package{
		Module:       Module,
		RelativePath: "huff0",
	}

	Benchmark = &entity.Benchmark{
		Package:  Package,
		FullName: "BenchmarkCompress1X/reuse=none/corpus=pngdata.001",
		Name:     "Compress1X",
		Parameters: map[string]string{
			"reuse":  "none",
			"corpus": "pngdata.001",
		},
		Unit: "MB/s",
	}

	Commit = &entity.Commit{
		SHA:     "d401c427b29f48d5cbc5092e62c20aa8524ce356",
		Tree:    "69f35623bf5c665d687eba295db7bc619a5f9f31",
		Parents: []string{"60b9ae4cf3a0428668748a53f278a80d41fbfc38"},
		Author: entity.Person{
			Name:  "Michael McLoughlin",
			Email: "mmcloughlin@gmail.com",
		},
		AuthorTime: time.Date(2017, 15, 7, 18, 21, 26, 0, time.FixedZone("UTC-6", -6*60*60)),
		Committer: entity.Person{
			Name:  "Adam Langley",
			Email: "agl@golang.org",
		},
		CommitTime: time.Date(2017, 8, 9, 19, 29, 14, 0, time.UTC),
		Message:    "crypto/rand: batch large calls to linux getrandom",
	}

	CommitPosition = &entity.CommitPosition{
		SHA:        Commit.SHA,
		CommitTime: Commit.CommitTime,
		Index:      32150,
	}

	DataFile = &entity.DataFile{
		Name:   "e5a4b8be-c0e5-42c4-a243-2b458ceff483.txt",
		SHA256: decodesha256("a36064ebcadaea9b4b419ef66b487a6bdf1f0d5f90efa513d35f800d4dfceeb1"),
	}

	Environment = entity.Properties{
		"a": "1",
		"b": "2",
	}

	Result = &entity.Result{
		File:        DataFile,
		Line:        42,
		Benchmark:   Benchmark,
		Commit:      Commit,
		Environment: Environment,
		Metadata: entity.Properties{
			"c": "3",
			"d": "4",
		},
		Iterations: 4096,
		Value:      123.45,
	}

	Worker = "gopher"

	TaskSpec = entity.TaskSpec{
		Type:       entity.TaskTypeModule,
		TargetUUID: Module.UUID(),
		CommitSHA:  Commit.SHA,
	}

	Task = &entity.Task{
		UUID:             uuid.MustParse("6e68e764-e3fd-4e86-b122-e07382dd57b0"),
		Worker:           Worker,
		Spec:             TaskSpec,
		Status:           entity.TaskStatusCreated,
		LastStatusUpdate: time.Date(2020, 4, 7, 20, 50, 13, 0, time.UTC),
		DatafileUUID:     uuid.Nil,
	}

	Change = &entity.Change{
		ID: trace.ID{
			BenchmarkUUID:   Benchmark.UUID(),
			EnvironmentUUID: Environment.UUID(),
		},
		Change: change.Change{
			CommitIndex: CommitPosition.Index,
			EffectSize:  4.72,
			Pre:         change.Stats{N: 30, Mean: 42, Variance: 3},
			Post:        change.Stats{N: 30, Mean: 50, Variance: 3.5},
		},
	}
)

Sample entity objects for testing purposes.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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