Documentation
¶
Overview ¶
Package testfake is a whole cloud on localhost.
It answers Render, Cloudflare and Neon from one HTTP server, in the envelope shapes those APIs really use, so a test can drive the actual binary end to end without an account anywhere. Point the three base-URL variables at it and upkeep cannot tell the difference.
It exists because "easy to test" has to mean something concrete: a contributor with no cloud access, and a pull request from a fork with no secrets, must both be able to run the whole suite.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cloud ¶
type Cloud struct {
// Env is the Render service's environment, keyed by service id.
Env map[string]map[string]string
// Deploys counts triggered deploys, and DeployStatuses is walked one entry
// per poll so a test can say "building, building, live".
Deploys int
DeployStatuses []string
// DeafWrites accepts every write and changes nothing — a provider that
// normalises, defers, or simply lies.
DeafWrites bool
// Buckets that exist, and their two settings.
Buckets map[string]bool
PublicR2 map[string]bool
CORS map[string]json.RawMessage
PagesProj map[string]json.RawMessage
NeonBranch map[string][]string
// Requests is every path the tool asked for, in order, so a test can assert
// what it did NOT do as well as what it did.
Requests []string
// contains filtered or unexported fields
}
Cloud is a fake Render + Cloudflare + Neon. Every field is safe to read after a run and safe to set before one.
Click to show internal directories.
Click to hide internal directories.