Documentation
¶
Index ¶
- Constants
- Variables
- func AcquireOrg(ctx context.Context, cfg EnvConfig, runID string, pool []string, ...) (string, string, error)
- func CleanupStaleResources(ctx context.Context, client forge.Client, token, org string, t *testing.T)
- func MintEnrollProjectID(cfg EnvConfig) string
- func ModuleRoot(t *testing.T) string
- func NewLiveClient(token string) *gh.LiveClient
- func OrgPool() []string
- func ReleaseLock(ctx context.Context, client forge.Client, org, runID string, t *testing.T)
- func RunCLI(t *testing.T, binary, token string, args ...string) string
- func RunCLIFromDir(t *testing.T, binary, token, dir string, args ...string) string
- func TeardownPerRepoInstall(ctx context.Context, client forge.Client, token, org, repo string, ...)
- func TryRunCLI(binary, token string, args ...string) (string, error)
- func TryRunCLIWithT(t *testing.T, binary, token string, args ...string) (string, error)
- type EnvConfig
Constants ¶
const DefaultHostedMintGCPProject = "it-gcp-konflux-dev-fullsend"
DefaultHostedMintGCPProject is the GCP project hosting the public mint service. See docs/guides/infrastructure/mint-administration.md.
const (
// TestRepo is the pre-existing repo in pool orgs used for enrollment testing.
TestRepo = "test-repo"
)
Variables ¶
var ErrAllOrgsRateLimited = errors.New("all pool orgs rate-limited")
ErrAllOrgsRateLimited is returned by AcquireOrg when every pool org was skipped due to GitHub API rate limiting. Callers can detect this with errors.Is and t.Skip instead of failing the test.
Functions ¶
func AcquireOrg ¶
func AcquireOrg(ctx context.Context, cfg EnvConfig, runID string, pool []string, timeout time.Duration, logf func(string, ...any)) (string, string, error)
AcquireOrg scans the pool for an unlocked org and acquires its lock.
func CleanupStaleResources ¶
func CleanupStaleResources(ctx context.Context, client forge.Client, token, org string, t *testing.T)
CleanupStaleResources removes leftover resources from previous test runs. This is the "teardown-first" part of the dual cleanup strategy.
func MintEnrollProjectID ¶
MintEnrollProjectID returns the GCP project for `fullsend mint enroll`. Inference may use a different project via E2E_GCP_PROJECT_ID; the hosted mint always lives in DefaultHostedMintGCPProject unless E2E_GCP_MINT_PROJECT_ID is set.
func ModuleRoot ¶
ModuleRoot returns the directory of the module under test.
func NewLiveClient ¶
func NewLiveClient(token string) *gh.LiveClient
NewLiveClient creates a GitHub API client from a token.
func OrgPool ¶
func OrgPool() []string
OrgPool returns the halfsend org names used for parallel e2e runs.
func ReleaseLock ¶
ReleaseLock deletes the org lock repo when the run still holds it.
func RunCLIFromDir ¶
RunCLIFromDir runs the CLI with cwd set to dir.
func TeardownPerRepoInstall ¶
func TeardownPerRepoInstall(ctx context.Context, client forge.Client, token, org, repo string, logf func(string, ...any))
TeardownPerRepoInstall removes per-repo fullsend artifacts from a test repository.
Types ¶
type EnvConfig ¶
type EnvConfig struct {
MintURL string
UseMint bool
GCPProjectID string
WIFProvider string
LockTimeout time.Duration
}
EnvConfig is the exported view of envConfig for behaviour tests.
func LoadEnvConfig ¶
LoadEnvConfig reads and validates required env vars for e2e and behaviour tests.