Documentation
¶
Index ¶
- type Actions
- func (a *Actions) GetUserInfo(tokenName string) *Actions
- func (a *Actions) ListAccounts(tokenName string) *Actions
- func (a *Actions) ListApplications(tokenName string) *Actions
- func (a *Actions) ListProjects(tokenName string) *Actions
- func (a *Actions) ListRepositories(tokenName string) *Actions
- func (a *Actions) Login(tokenName string) *Actions
- func (a *Actions) LoginWithSSO(tokenName string) *Actions
- func (a *Actions) Logout(tokenName string) *Actions
- func (a *Actions) Sleep(d time.Duration) *Actions
- func (a *Actions) Then() *Consequences
- func (a *Actions) WithDirectOIDC() *Actions
- type Consequences
- func (c *Consequences) ActionShouldFail(block func(err error)) *Consequences
- func (c *Consequences) ActionShouldSucceed() *Consequences
- func (c *Consequences) AndCLIOutput(block func(output string, err error)) *Consequences
- func (c *Consequences) Given() *Context
- func (c *Consequences) When() *Actions
- type Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actions ¶
type Actions struct {
// contains filtered or unexported fields
}
Actions implements the "when" part of given/when/then for session/logout tests.
func (*Actions) GetUserInfo ¶
GetUserInfo calls "argocd account get-user-info" using the named token.
func (*Actions) ListAccounts ¶
ListAccounts calls "argocd account list" using the named token.
func (*Actions) ListApplications ¶
ListApplications calls "argocd app list" using the named token.
func (*Actions) ListProjects ¶
ListProjects calls "argocd proj list" using the named token.
func (*Actions) ListRepositories ¶
ListRepositories calls "argocd repo list" using the named token.
func (*Actions) Login ¶
Login creates a new session as admin using the argocd CLI login command. Each token name gets its own isolated config file so multiple sessions can coexist without interfering with each other.
func (*Actions) LoginWithSSO ¶
LoginWithSSO mints an OIDC token directly from the shared mock OIDC server, bypassing the normal browser-based SSO flow. Each call creates a unique user identity based on tokenName so multiple SSO sessions produce different tokens. This exercises the IDP token verification and revocation code path in SessionManager.VerifyToken.
func (*Actions) Logout ¶
Logout revokes the named token using the argocd CLI logout command. This triggers the full CLI logout flow including server-side token revocation.
func (*Actions) Then ¶
func (a *Actions) Then() *Consequences
func (*Actions) WithDirectOIDC ¶
WithDirectOIDC configures ArgoCD with oidc.config pointing directly to a shared mock OIDC server (bypassing Dex). Tests using this setup should use LoginWithSSO to mint OIDC tokens programmatically. This exercises the IDP token verification and revocation code path in SessionManager.VerifyToken.
type Consequences ¶
type Consequences struct {
// contains filtered or unexported fields
}
Consequences implements the "then" part of given/when/then for session/logout tests.
func (*Consequences) ActionShouldFail ¶
func (c *Consequences) ActionShouldFail(block func(err error)) *Consequences
ActionShouldFail asserts that the last action returned an error and passes it to the callback for further inspection.
func (*Consequences) ActionShouldSucceed ¶
func (c *Consequences) ActionShouldSucceed() *Consequences
ActionShouldSucceed asserts that the last action completed without error.
func (*Consequences) AndCLIOutput ¶
func (c *Consequences) AndCLIOutput(block func(output string, err error)) *Consequences
AndCLIOutput passes the CLI output and error from the last action to the callback for custom assertions.
func (*Consequences) Given ¶
func (c *Consequences) Given() *Context
Given returns the Context to allow chaining back to setup.
func (*Consequences) When ¶
func (c *Consequences) When() *Actions
When returns the Actions to allow chaining back to actions.
type Context ¶
Context implements the "given" part of given/when/then for session/logout tests.
func GivenWithSameState ¶
func GivenWithSameState(ctx fixture.TestContext) *Context
GivenWithSameState creates a new Context that shares the same TestState as an existing context.