Documentation
¶
Overview ¶
Package e2e provides helper functions for end-to-end testing of the GitOps Reverser controller. It includes utilities for template rendering, kubectl operations, and metrics validation.
Package e2e stores suite-scoped state shared by the end-to-end helpers.
This state allows the suite to preserve resources for debugging when a spec fails or the run is interrupted with Ctrl+C / SIGTERM. Cleanup helpers consult it before deleting resources, and kubectl helpers use the shared cancellation signal so long-running commands can stop promptly during shutdown.
Index ¶
- type GiteaTestInstance
- func (g *GiteaTestInstance) Client() *giteaclient.Client
- func (g *GiteaTestInstance) CommitVerification(owner, repo, sha string) (*giteaclient.CommitVerification, error)
- func (g *GiteaTestInstance) Context() (context.Context, context.CancelFunc)
- func (g *GiteaTestInstance) EnsureRepoCollaborator(owner, repo string, user *giteaclient.TestUser) error
- func (g *GiteaTestInstance) EnsureTestUser(login string) (*giteaclient.TestUser, error)
- func (g *GiteaTestInstance) RegisterSigningPublicKey(user *giteaclient.TestUser, publicKey, title string) (*giteaclient.PublicKey, error)
- func (g *GiteaTestInstance) TestUserEmail(login string) string
- type RepoArtifacts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GiteaTestInstance ¶
type GiteaTestInstance struct {
APIBaseURL string
Org string
AdminUser string
AdminPassword string
RequestTimeout time.Duration
}
GiteaTestInstance describes the live Gitea instance the e2e suite uses for repo fixtures, signing-key registration, and commit verification.
func (*GiteaTestInstance) Client ¶
func (g *GiteaTestInstance) Client() *giteaclient.Client
func (*GiteaTestInstance) CommitVerification ¶
func (g *GiteaTestInstance) CommitVerification(owner, repo, sha string) (*giteaclient.CommitVerification, error)
func (*GiteaTestInstance) Context ¶
func (g *GiteaTestInstance) Context() (context.Context, context.CancelFunc)
func (*GiteaTestInstance) EnsureRepoCollaborator ¶
func (g *GiteaTestInstance) EnsureRepoCollaborator(owner, repo string, user *giteaclient.TestUser) error
func (*GiteaTestInstance) EnsureTestUser ¶
func (g *GiteaTestInstance) EnsureTestUser(login string) (*giteaclient.TestUser, error)
func (*GiteaTestInstance) RegisterSigningPublicKey ¶
func (g *GiteaTestInstance) RegisterSigningPublicKey( user *giteaclient.TestUser, publicKey, title string, ) (*giteaclient.PublicKey, error)
func (*GiteaTestInstance) TestUserEmail ¶
func (g *GiteaTestInstance) TestUserEmail(login string) string
type RepoArtifacts ¶
type RepoArtifacts struct {
RepoName string
RepoURLHTTP string
RepoURLSSH string
CheckoutDir string
SecretsYAML string
GitSecretHTTP string
GitSecretSSH string
GitSecretInvalid string
ReceiverWebhookURL string
ReceiverWebhookID string
User *giteaclient.TestUser
}
RepoArtifacts holds the Git repository fixtures produced by one SetupRepo call. Each e2e test file owns its own instance so that mutable repo state is isolated between files.
func SetupRepo ¶
func SetupRepo(_ string, namespace, repoName string) *RepoArtifacts
SetupRepo prepares a repo fixture directly from the e2e process and returns the resulting RepoArtifacts for file-local storage by callers.
namespace must already exist in the cluster before this call. Shared suite preparation must already have provisioned the cluster services, Gitea, and port-forwards. Callers are responsible for applying SecretsYAML to the namespace afterward.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
tools
|
|
|
gen-age-key
command
|
|
|
ginkgo-allure
command
ginkgo-allure converts Ginkgo JSON reports into Allure result files.
|
ginkgo-allure converts Ginkgo JSON reports into Allure result files. |
|
playground-cleanup
command
|
|
|
spec-timings
command
spec-timings reads a Ginkgo JSON report and prints a duration-sorted table of specs with each spec's share of the total wallclock.
|
spec-timings reads a Ginkgo JSON report and prints a duration-sorted table of specs with each spec's share of the total wallclock. |
|
ts
command
ts prefixes each stdin line with the elapsed seconds since startup and the current wallclock, then writes it to stdout.
|
ts prefixes each stdin line with the elapsed seconds since startup and the current wallclock, then writes it to stdout. |