testutils

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCacheFile

func CreateCacheFile(dir string, size int64) (string, error)

CreateCacheFile creates a random data file of the given size in the provided directory (corresponding to one of bazel-remote's keyspaces) and returns its sha256 hash and any error that occurred.

func NewSilentLogger

func NewSilentLogger() *log.Logger

NewSilentLogger returns a cheap logger that doesn't print anything, useful for tests.

func RandomDataAndHash

func RandomDataAndHash(size int64) ([]byte, string)

RandomDataAndHash creates a random blob of the specified size, and returns that blob along with its sha256 hash.

func TempDir

func TempDir(t *testing.T) string

TempDir creates a temporary directory and returns its name. If an error occurs, then it panics.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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