testkit

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testkit builds throwaway git remotes and clones of stores for tests: the multi-clone simulator, scenarios and token budgets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Git

func Git(t testing.TB, dir string, args ...string) string

Git runs git and fails the test on error.

func GitEnv

func GitEnv(t testing.TB) string

GitEnv isolates git and ka from the developer's configuration.

func Service

func Service(t testing.TB, dir string) *engine.Service

Service opens a service over a clone.

Types

type Remote

type Remote struct {
	Root string // scratch directory
	Path string // the bare repository
	// contains filtered or unexported fields
}

Remote is a bare repository holding a store.

func NewRemote

func NewRemote(t testing.TB, files map[string]string) *Remote

NewRemote creates a bare remote whose store has project jk (prefix JK) plus the given files (store-relative path -> content).

func NewStoreRemote

func NewStoreRemote(t testing.TB, o engine.InitOptions, files map[string]string) *Remote

NewStoreRemote creates a bare remote holding a store made with o (o.Dir is ignored) plus the given extra files.

func (*Remote) Clone

func (r *Remote) Clone() string

Clone makes a new working clone and returns its directory.

func (*Remote) CountPushes

func (r *Remote) CountPushes()

CountPushes installs a hook that counts pushes received; read with Pushes.

func (*Remote) Pushes

func (r *Remote) Pushes() int

Pushes returns how many pushes the remote has received since CountPushes.

Jump to

Keyboard shortcuts

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