Documentation
¶
Overview ¶
Package framework provides shared helpers for the qcloud e2e test suite.
Index ¶
- func Binary() (string, error)
- type Env
- func (e *Env) Redact(s string) string
- func (e *Env) Run(t *testing.T, args ...string) RunResult
- func (e *Env) RunAllowFail(t *testing.T, args ...string) RunResult
- func (e *Env) RunJSON(t *testing.T, v any, args ...string)
- func (e *Env) RunWithTimeout(t *testing.T, timeout time.Duration, args ...string) RunResult
- type RunResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Binary ¶
Binary returns the path to the qcloud binary to exercise. The binary is resolved exactly once per process:
- $QCLOUD_E2E_BINARY, if set.
- A cached download of the release named by $QCLOUD_E2E_RELEASE (default "latest"), verified against the release's checksums.txt.
Downloads are cached under os.UserCacheDir()/qcloud-e2e keyed by the archive sha256, so repeated test runs on the same host reuse the same binary.
Types ¶
type Env ¶
type Env struct {
BinaryPath string
APIKey string
AccountID string
Endpoint string
// contains filtered or unexported fields
}
Env bundles everything an e2e test needs to shell out to qcloud against a real Qdrant Cloud backend.
func NewEnv ¶
NewEnv returns an Env wired up with credentials from the environment and an isolated empty config file. It skips the test if QCLOUD_E2E is not set.
The binary is the one returned by Binary; it is resolved once per process.
func (*Env) Redact ¶
Redact masks the API key and JWT-like tokens in s. Useful when asserting against stdout/stderr.
func (*Env) Run ¶
Run invokes the binary with the given args and the default timeout, failing the test if the command exits non-zero. Stdout and stderr are streamed to t.Log.
func (*Env) RunAllowFail ¶
RunAllowFail is like Run but returns the result without failing the test. Useful for commands where a non-zero exit is part of the assertion.