testutils

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LaunchTestGitea

func LaunchTestGitea(opts GiteaOpts) (TeardownTestGitea, TestGiteaInfo, error)

Launch a gitea server, running on http://127.0.0.1:3000 A teardown method is returned to shut it down. It is assumed that a recent gitea binary is located in the binary path.

func SetupDefaultTestEnvironment

func SetupDefaultTestEnvironment() (TeardownTestGitea, TestGiteaInfo, string, error)

func WaitOnServer

func WaitOnServer(url string) error

Types

type DirectoryContent

type DirectoryContent map[string]string

This is a test dependency that will most likely be migrated elsewhere. Do not depend on this.

func GetDirectoryContent

func GetDirectoryContent(rootPath string, skipPrefix string) (DirectoryContent, error)

This is a test dependency that will most likely be migrated elsewhere. Do not depend on this.

func (DirectoryContent) Equals

func (cont DirectoryContent) Equals(other DirectoryContent) bool

type GiteaOpts

type GiteaOpts struct {
	Workdir  string
	BindIp   string
	BindPort int64
	Password string
	Email    string
	SshPub   string
	Repos    []string
	Debug    bool
}

func (*GiteaOpts) GetUrl

func (opt *GiteaOpts) GetUrl() string

type GiteaTemplate

type GiteaTemplate struct {
	Options GiteaOpts
	User    string
}

type TeardownTestGitea

type TeardownTestGitea func() error

type TestGiteaInfo

type TestGiteaInfo struct {
	User           string
	RepoUrls       []string
	KnownHostsFile string
}

Jump to

Keyboard shortcuts

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