Documentation ¶
Index ¶
- Constants
- func ActivateAuthClient(tb testing.TB, c *client.APIClient, port ...string)
- func ActivateEnterprise(t testing.TB, c *client.APIClient, port ...string)
- func ActivateLicense(t testing.TB, c *client.APIClient, port string, expireTime ...time.Time)
- func AuthenticateClient(tb testing.TB, c *client.APIClient, subject string) *client.APIClient
- func AuthenticatedPachClient(tb testing.TB, c *client.APIClient, subject string, port ...string) *client.APIClient
- func BashCmd(cmd string, subs ...string) *exec.Cmd
- func BuildBindings(s ...string) *auth.RoleBinding
- func BuildClusterBindings(s ...string) *auth.RoleBinding
- func Command(name string, args ...string) *exec.Cmd
- func CommitCnt(t *testing.T, c *client.APIClient, repo *pfs.Repo) int
- func ConfigureOIDCProvider(t *testing.T, c *client.APIClient, unitTest bool) error
- func CreateEphemeralDB(t testing.TB, db *pachsql.DB, dbName string)
- func DebugFiles(t testing.TB, projectName, repoName string) (map[string]*globlib.Glob, []string)
- func DeletePipelineRC(t testing.TB, pipeline, namespace string)
- func DexHost(c *client.APIClient) string
- func DoOAuthExchange(t testing.TB, pachClient, enterpriseClient *client.APIClient, loginURL string)
- func DoOAuthExchangeOnce(t testing.TB, pachClient, enterpriseClient *client.APIClient, loginURL string) error
- func GenerateEphemeralDBName(t testing.TB) string
- func GetKubeClient(t testing.TB) *kube.Clientset
- func GetOIDCTokenForTrustedApp(t testing.TB, testClient *client.APIClient, unitTest bool) string
- func GetProjectRoleBinding(t *testing.T, c *client.APIClient, project string) *auth.RoleBinding
- func GetRepoRoleBinding(t *testing.T, c *client.APIClient, projectName, repoName string) *auth.RoleBinding
- func GetTestEnterpriseCode(t testing.TB) string
- func Group(group string) string
- func Listen(t testing.TB) net.Listener
- func LogHttpResponse(t testing.TB, response *http.Response, msg string)
- func NewLoggingHTTPClient(t testing.TB) *http.Client
- func OIDCOIDCConfig(host, issuerPort, redirectPort string, local bool) *auth.OIDCConfig
- func OpenDB(t testing.TB, opts ...dbutil.Option) *pachsql.DB
- func OpenDBURL(t testing.TB, u pachsql.URL, password string) *pachsql.DB
- func PachctlBashCmd(t *testing.T, c *client.APIClient, scriptTemplate string, subs ...string) *exec.Cmd
- func PachctlBashCmdCtx(ctx context.Context, t *testing.T, c *client.APIClient, scriptTemplate string, ...) *exec.Cmd
- func PipelineNames(t *testing.T, c *client.APIClient, project string) []string
- func Pl(projectName, pipelineName string) string
- func RandomRobot(t *testing.T, c *client.APIClient, name string) (string, *client.APIClient)
- func RepoInfoToName(repoInfo interface{}) interface{}
- func RewriteRedirect(t testing.TB, resp *http.Response, host string) string
- func RewriteURL(t testing.TB, urlStr, host string) string
- func Robot(robot string) string
- func TSProtoOrDie(t testing.TB, ts time.Time) *timestamppb.Timestamp
- func UnauthenticatedPachClient(tb testing.TB, c *client.APIClient) *client.APIClient
- func UniqueString(prefix string) string
- func User(email string) string
- type Cmd
- type Pachctl
Constants ¶
const DefaultTransformImage = "ubuntu:20.04"
const DexMockConnectorEmail = `kilgore@kilgore.trout`
DexMockConnectorEmail is the identity returned for all requests to the mock Dex connector (see https://github.com/dexidp/dex/blob/c113df2730052e20881dd68561289f8ae121300b/connector/mock/connectortest.go#L21) Kilgore Trout is a recurring character of Kurt Vonnegut's
const (
// RootToken is the hard-coded admin token used on all activated test clusters
RootToken = "iamroot"
)
Variables ¶
This section is empty.
Functions ¶
func ActivateAuthClient ¶
ActivateAuthClient activates the auth service in the test cluster, if it isn't already enabled
func ActivateEnterprise ¶
ActivateEnterprise activates enterprise in Pachyderm (if it's not on already.)
func ActivateLicense ¶
func AuthenticateClient ¶
creates a new authenticated pach client, without re-activating
func AuthenticatedPachClient ¶
func BashCmd ¶
BashCmd is a convenience function that: 1. Performs a Go template substitution on 'cmd' using the strings in 'subs' 2. Returns a command that runs the result string from 1 as a Bash script
func BuildBindings ¶
func BuildBindings(s ...string) *auth.RoleBinding
func BuildClusterBindings ¶
func BuildClusterBindings(s ...string) *auth.RoleBinding
func Command ¶
Command is a convenience function that replaces exec.Command. It's both shorter and it uses the current process's stderr as output for the command, which makes debugging failures much easier (i.e. you get an error message rather than "exit status 1")
func ConfigureOIDCProvider ¶
ConfigureOIDCProvider configures the identity service and the auth service to use a mock connector.
func CreateEphemeralDB ¶
CreateEphemeralDB creates a new database using db with a lifetime scoped to the test t.
func DebugFiles ¶
func DeletePipelineRC ¶
DeletePipelineRC deletes the RC belonging to the pipeline 'pipeline'. This can be used to test PPS's robustness
func DoOAuthExchange ¶
DoOAuthExchange does the OAuth dance to log in to the mock provider, given a login URL
func DoOAuthExchangeOnce ¶ added in v2.8.0
func GenerateEphemeralDBName ¶
GenerateEphemeralDBName generates a random name suitable for use as a Postgres identifier
func GetKubeClient ¶
GetKubeClient connects to the Kubernetes API server either from inside the cluster or from a test binary running on a machine with kubectl (it will connect to the same cluster as kubectl)
func GetProjectRoleBinding ¶
func GetRepoRoleBinding ¶
func GetTestEnterpriseCode ¶
GetTestEnterpriseCode Pulls the enterprise code out of the env var stored in CI
func Listen ¶ added in v2.8.0
Listen creates a new net.Listener on localhost and ensures the listener is closed when the test exits
func OIDCOIDCConfig ¶
func OIDCOIDCConfig(host, issuerPort, redirectPort string, local bool) *auth.OIDCConfig
OIDCOIDCConfig is an auth config which can be used to connect to the identity service in tests
func OpenDB ¶
OpenDB connects to a database using opts and returns it. The database will be closed at the end of the test.
func OpenDBURL ¶
OpenDBURL connects to a database using u and returns it. The database will be closed at the end of the test.
func PachctlBashCmd ¶
func PachctlBashCmdCtx ¶ added in v2.8.0
func PipelineNames ¶
PipelineNames returns the names of all pipelines that 'c' gets from ListPipeline in the specified project.
func RandomRobot ¶
func RepoInfoToName ¶
func RepoInfoToName(repoInfo interface{}) interface{}
func RewriteRedirect ¶
RewriteRedirect rewrites the Location header to point to the returned path at `host`
func RewriteURL ¶
RewriteURL rewrites the host and scheme in urlStr
func TSProtoOrDie ¶
func UnauthenticatedPachClient ¶
GetUnauthenticatedPachClient returns a copy of the testing pach client with no auth token
func UniqueString ¶
UniqueString adds a UUID suffix to 'prefix'. This helps avoid name conflicts between tests that share the same Pachyderm cluster
Types ¶
type Cmd ¶
type Pachctl ¶
type Pachctl struct {
// contains filtered or unexported fields
}
func NewPachctl ¶
NewPachctl returns a new Pachctl object configured with the given client information, with the configuration stored in configPath.
func (Pachctl) Close ¶
Close cleans up the pachctl config file. It does not delete its parent directory.
func (Pachctl) Command ¶
Command provides a Cmd to execute script with Bash. If context is cancelled then the command will be terminated.
func (*Pachctl) CommandTemplate ¶
func (p *Pachctl) CommandTemplate(ctx context.Context, scriptTemplate string, data any) (Cmd, error)
Command provides a Cmd to execute script with Bash. Script is interpreted as a Go template and provided with data. If context is cancelled then the command will be terminated.