gittest

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package gittest makes git repositories of apps for the tests of aicoded publish. Its git commands have constant arguments: messages and bundles go on standard input or in files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Amend

func Amend(t testing.TB, dir, message string) string

Amend replaces the last commit of dir with one of the message, and returns it.

func Commit

func Commit(t testing.TB, dir, message string) string

Commit commits everything in the repository dir with message, and returns the commit.

func DatabaseApp

func DatabaseApp(t testing.TB, name, draft string) string

DatabaseApp is NewApp for an app that declares sqldb, whose draft is draft, which its .gitignore keeps out of git, as it does the cache of the published migrations.

func Head(t testing.TB, dir string) string

Head returns the commit HEAD of dir.

func Init

func Init(t testing.TB, dir string)

Init makes dir a git repository with no commit. Its git starts no maintenance in the background, which could still be writing in dir when the test removes it.

func NewApp

func NewApp(t testing.TB, name string) string

NewApp makes, in a new temp folder, the app name, which aicoded check passes without the framework, as a git repository with one commit, and returns the folder. It skips the test when git or go is not on PATH.

func Verify

func Verify(t testing.TB, bundles ...[]byte) []string

Verify checks each bundle in turn as the platform's worker does, in a new repository that holds the history of the bundles before it: git bundle verify must accept it, and its HEAD is then fetched. It returns the commit each bundle's HEAD names.

func Write

func Write(t testing.TB, dir string, files map[string]string)

Write writes files, by their paths relative to dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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