testhost

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 12 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 testhost serves a repository over HTTPS with git's own smart HTTP server, taking pushes, for tests that publish: a git host on this machine, with a certificate a pool can be told to trust.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Git

func Git(t *testing.T, dir string, args ...string) string

Git runs git in dir as a person would, with an identity, and fails the test when it fails.

func Write

func Write(t *testing.T, path, content string)

Write writes content to path, making its directory.

Types

type Host

type Host struct {
	Repository  repo.Repo
	Served      string
	Work        string
	Certificate string
	Hosts       repo.Hosts
	Token       []credentials.Credential
}

Host is acme/web served at 127.0.0.1, with main holding one commit, and a clone of it, Work, to commit on the host's side.

func New

func New(t *testing.T) Host

New serves a repository for the length of the test.

func (Host) Commit

func (host Host) Commit(t *testing.T, name, content string)

Commit writes a file in Work, commits it and pushes it to the host's main.

func (Host) Head

func (host Host) Head(t *testing.T, branch string) string

Head is the commit a branch of the served repository is on.

func (Host) Pool

func (host Host) Pool(t *testing.T, pools string) string

Pool clones the served repository, bare, into the pool of it under pools, trusting the server's certificate.

Jump to

Keyboard shortcuts

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